goasnmp

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "goasnmp"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"list", "add"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewAddEndpoint

func NewAddEndpoint(s Service) endpoint.Endpoint

NewAddEndpoint returns an endpoint function that calls the method "add" of service "goasnmp".

func NewListEndpoint

func NewListEndpoint(s Service) endpoint.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "goasnmp".

func NewViewedHost

func NewViewedHost(res *Host, view string) *goasnmpviews.Host

NewViewedHost initializes viewed result type Host from result type Host using the given view.

func NewViewedHostCollection

func NewViewedHostCollection(res HostCollection, view string) goasnmpviews.HostCollection

NewViewedHostCollection initializes viewed result type HostCollection from result type HostCollection using the given view.

Types

type AddPayload

type AddPayload struct {
	// Hostname or Ip of Device
	Hostname string
	// Whether or not to walk public tree
	Public bool
	// Whether or not Ondemand polling is supported
	OnDemand *bool
}

AddPayload is the payload type of the goasnmp service add method.

type Client

type Client struct {
	ListEndpoint endpoint.Endpoint
	AddEndpoint  endpoint.Endpoint
}

Client is the "goasnmp" service client.

func NewClient

func NewClient(list, add endpoint.Endpoint) *Client

NewClient initializes a "goasnmp" service client given the endpoints.

func (*Client) Add

func (c *Client) Add(ctx context.Context, p *AddPayload) (res *Host, err error)

Add calls the "add" endpoint of the "goasnmp" service.

func (*Client) List

func (c *Client) List(ctx context.Context) (res HostCollection, err error)

List calls the "list" endpoint of the "goasnmp" service.

type Endpoints

type Endpoints struct {
	List endpoint.Endpoint
	Add  endpoint.Endpoint
}

Endpoints wraps the "goasnmp" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "goasnmp" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(endpoint.Endpoint) endpoint.Endpoint)

Use applies the given middleware to all the "goasnmp" service endpoints.

type Host

type Host struct {
	// Whether or not to walk public tree
	Public *bool
	// Whether or not Ondemand polling is supported
	OnDemand *bool
}

Host is the result type of the goasnmp service add method.

func NewHost

func NewHost(vres *goasnmpviews.Host) *Host

NewHost initializes result type Host from viewed result type Host.

func (*Host) CreateFromInterfaceHost

func (t *Host) CreateFromInterfaceHost(v *media_type.InterfaceHost)

CreateFromInterfaceHost initializes t from the fields of v

func (*Host) CreateFromInterfaceHost2

func (t *Host) CreateFromInterfaceHost2(v *media_type.InterfaceHost)

CreateFromInterfaceHost2 initializes t from the fields of v

type HostCollection

type HostCollection []*Host

HostCollection is the result type of the goasnmp service list method.

func NewHostCollection

func NewHostCollection(vres goasnmpviews.HostCollection) HostCollection

NewHostCollection initializes result type HostCollection from viewed result type HostCollection.

type Service

type Service interface {
	// List implements list.
	List(context.Context) (res HostCollection, err error)
	// Add implements add.
	Add(context.Context, *AddPayload) (res *Host, err error)
}

The goa-snmp service tracks hosts and walks snmp trees

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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