topo

package
v0.7.34 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 12 Imported by: 23

Documentation

Index

Constants

View Source
const (
	// DefaultServicePort :
	DefaultServicePort = 5150

	// DefaultServiceHost :
	DefaultServiceHost = "onos-topo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Create creates a topo object
	Create(ctx context.Context, object *topoapi.Object) error

	// Update updates a topo object
	Update(ctx context.Context, object *topoapi.Object) error

	// Get gets a topo object with a given ID
	Get(ctx context.Context, id topoapi.ID) (*topoapi.Object, error)

	// Watch provides a simple facility for the application to watch for changes in the topology
	Watch(ctx context.Context, ch chan<- topoapi.Event, opts ...WatchOption) error

	// List of topo objects
	List(ctx context.Context, opts ...ListOption) ([]topoapi.Object, error)
}

Client is a topo SDK client

func NewClient

func NewClient(opts ...Option) (Client, error)

NewClient creates a new topo client

type ListOption added in v0.7.13

type ListOption interface {
	// contains filtered or unexported methods
}

ListOption topo client list option

func WithListFilters added in v0.7.13

func WithListFilters(filters *topoapi.Filters) ListOption

WithListFilters sets filters for list method

type ListOptions added in v0.7.13

type ListOptions struct {
	// contains filtered or unexported fields
}

ListOptions topo client get method options

func (ListOptions) GetFilters added in v0.7.13

func (l ListOptions) GetFilters() *topoapi.Filters

GetFilters get filters

type Option added in v0.7.13

type Option interface {
	// contains filtered or unexported methods
}

Option topo client

func WithOptions added in v0.7.13

func WithOptions(opts Options) Option

WithOptions sets the client options

func WithTopoAddress added in v0.7.13

func WithTopoAddress(host string, port int) Option

WithTopoAddress sets the address for the topo service

func WithTopoHost added in v0.7.13

func WithTopoHost(host string) Option

WithTopoHost sets the host for the topo service

func WithTopoPort added in v0.7.13

func WithTopoPort(port int) Option

WithTopoPort sets the port for the topo service

type Options added in v0.7.13

type Options struct {
	// Service is the service options
	Service ServiceOptions
}

Options topo SDK options

type ServiceOptions added in v0.7.13

type ServiceOptions struct {
	// Host is the service host
	Host string
	// Port is the service port
	Port int

	Insecure bool
}

ServiceOptions are the options for a service

func (ServiceOptions) GetAddress added in v0.7.13

func (o ServiceOptions) GetAddress() string

GetAddress gets the service address

func (ServiceOptions) GetHost added in v0.7.13

func (o ServiceOptions) GetHost() string

GetHost gets the service host

func (ServiceOptions) GetPort added in v0.7.13

func (o ServiceOptions) GetPort() int

GetPort gets the service port

func (ServiceOptions) IsInsecure added in v0.7.13

func (o ServiceOptions) IsInsecure() bool

IsInsecure is topo connection secure

type WatchOption added in v0.7.13

type WatchOption interface {
	// contains filtered or unexported methods
}

WatchOption topo client watch option

func WithNoReplay added in v0.7.21

func WithNoReplay(noReplay bool) WatchOption

WithNoReplay sets no replay option

func WithWatchFilters added in v0.7.13

func WithWatchFilters(filters *topoapi.Filters) WatchOption

WithWatchFilters sets filters for watch method

type WatchOptions added in v0.7.13

type WatchOptions struct {
	// contains filtered or unexported fields
}

WatchOptions topo client watch method options

func (WatchOptions) GetFilters added in v0.7.13

func (w WatchOptions) GetFilters() *topoapi.Filters

GetFilters get filters

func (WatchOptions) GetNoReplay added in v0.7.21

func (w WatchOptions) GetNoReplay() bool

GetNoReplay gets no replay option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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