Sha256: f514e4a229dfa385f277b9affea902cc212cb1c39899224f9bff3974173e75d4

Contents?: true

Size: 505 Bytes

Versions: 36

Compression:

Stored size: 505 Bytes

Contents

package <%= package %>

// Client represents a connection to an API server
type Client struct {
	// API URL
	Url string

	// Options for authentication method
	Authentication Authenticator

<% api.resources.each do |r| -%>
	// Resource <%= r.full_dot_name %>
	<%= r.go_name %> *<%= r.go_type %>
<% end -%>
}

// Create a new client for API at url
func New(url string) *Client {
	c := &Client{Url: url}

<% api.resources.each do |r| -%>
	c.<%= r.go_name %> = New<%= r.go_type %>(c)
<% end -%>

	return c
}

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
haveapi-go-client-0.25.0 template/client.go.erb
haveapi-go-client-0.24.0 template/client.go.erb
haveapi-go-client-0.23.7 template/client.go.erb
haveapi-go-client-0.23.6 template/client.go.erb
haveapi-go-client-0.23.5 template/client.go.erb
haveapi-go-client-0.23.4 template/client.go.erb
haveapi-go-client-0.23.3 template/client.go.erb
haveapi-go-client-0.23.2 template/client.go.erb
haveapi-go-client-0.23.1 template/client.go.erb
haveapi-go-client-0.23.0 template/client.go.erb
haveapi-go-client-0.22.1 template/client.go.erb
haveapi-go-client-0.22.0 template/client.go.erb
haveapi-go-client-0.21.1 template/client.go.erb
haveapi-go-client-0.21.0 template/client.go.erb
haveapi-go-client-0.20.0 template/client.go.erb
haveapi-go-client-0.19.3 template/client.go.erb
haveapi-go-client-0.19.2 template/client.go.erb
haveapi-go-client-0.19.1 template/client.go.erb
haveapi-go-client-0.19.0 template/client.go.erb
haveapi-go-client-0.18.2 template/client.go.erb