client

package
v0.0.0-...-7475c9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGoasnmpPath

func AddGoasnmpPath(hostname string) string

AddGoasnmpPath returns the URL path to the goasnmp service add HTTP endpoint.

func BuildAddPayload

func BuildAddPayload(goasnmpAddBody string, goasnmpAddHostname string) (*goasnmp.AddPayload, error)

BuildAddPayload builds the payload for the goasnmp add endpoint from CLI flags.

func DecodeAddResponse

func DecodeAddResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeAddResponse returns a decoder for responses returned by the goasnmp add endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeListResponse

func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeListResponse returns a decoder for responses returned by the goasnmp list endpoint. restoreBody controls whether the response body should be restored after having been read.

func EncodeAddRequest

func EncodeAddRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeAddRequest returns an encoder for requests sent to the goasnmp add server.

func ListGoasnmpPath

func ListGoasnmpPath() string

ListGoasnmpPath returns the URL path to the goasnmp service list HTTP endpoint.

func NewAddHostOK

func NewAddHostOK(body *AddResponseBody) *goasnmpviews.HostView

NewAddHostOK builds a "goasnmp" service "add" endpoint result from a HTTP "OK" response.

func NewListHostCollectionOK

func NewListHostCollectionOK(body ListResponseBody) goasnmpviews.HostCollectionView

NewListHostCollectionOK builds a "goasnmp" service "list" endpoint result from a HTTP "OK" response.

Types

type AddResponseBody

type AddResponseBody struct {
	// Whether or not to walk public tree
	Public *bool `form:"public,omitempty" json:"public,omitempty" xml:"public,omitempty"`
	// Whether or not Ondemand polling is supported
	OnDemand *bool `form:"on_demand,omitempty" json:"on_demand,omitempty" xml:"on_demand,omitempty"`
}

AddResponseBody is the type of the "goasnmp" service "add" endpoint HTTP response body.

type Client

type Client struct {
	// List Doer is the HTTP client used to make requests to the list endpoint.
	ListDoer goahttp.Doer

	// Add Doer is the HTTP client used to make requests to the add endpoint.
	AddDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the goasnmp service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the goasnmp service servers.

func (*Client) Add

func (c *Client) Add() endpoint.Endpoint

Add returns an endpoint that makes HTTP requests to the goasnmp service add server.

func (*Client) BuildAddRequest

func (c *Client) BuildAddRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildAddRequest instantiates a HTTP request object with method and path set to call the "goasnmp" service "add" endpoint

func (*Client) BuildListRequest

func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildListRequest instantiates a HTTP request object with method and path set to call the "goasnmp" service "list" endpoint

func (*Client) List

func (c *Client) List() endpoint.Endpoint

List returns an endpoint that makes HTTP requests to the goasnmp service list server.

type HostResponse

type HostResponse struct {
	// Whether or not to walk public tree
	Public *bool `form:"public,omitempty" json:"public,omitempty" xml:"public,omitempty"`
	// Whether or not Ondemand polling is supported
	OnDemand *bool `form:"on_demand,omitempty" json:"on_demand,omitempty" xml:"on_demand,omitempty"`
}

HostResponse is used to define fields on response body types.

type ListResponseBody

type ListResponseBody []*HostResponse

ListResponseBody is the type of the "goasnmp" service "list" endpoint HTTP response body.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL