topo

package
v0.6.14 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package topo :

Index

Constants

This section is empty.

Variables

View Source
var TopoClientFactory = func(cc *grpc.ClientConn) topoapi.TopoClient {
	return topoapi.NewTopoClient(cc)
}

TopoClientFactory : Default TopoClient creation.

Functions

func CreateTopoClient

func CreateTopoClient(cc *grpc.ClientConn) topoapi.TopoClient

CreateTopoClient creates and returns a new topo entity client

func NewService

func NewService() (northbound.Service, error)

NewService returns a new topo Service

Types

type Event

type Event struct {
	Type   EventType
	Object *topoapi.Object
}

Event is a store event for a object

type EventType

type EventType string

EventType provides the type for a object event

const (
	// EventNone is no event
	EventNone EventType = ""
	// EventInserted is inserted
	EventInserted EventType = "inserted"
	// EventUpdated is updated
	EventUpdated EventType = "updated"
	// EventRemoved is removed
	EventRemoved EventType = "removed"
)

type Server

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

Server implements the gRPC service for administrative facilities.

func (*Server) Delete added in v0.6.11

func (s *Server) Delete(ctx context.Context, request *topoapi.DeleteRequest) (*topoapi.DeleteResponse, error)

Delete ...

func (*Server) Get added in v0.6.11

func (s *Server) Get(ctx context.Context, request *topoapi.GetRequest) (*topoapi.GetResponse, error)

Get :

func (*Server) List

func (s *Server) List(request *topoapi.ListRequest, server topoapi.Topo_ListServer) error

List ..

func (*Server) Load

func (s *Server) Load(id topo.ID) (*topo.Object, error)

Load ...

func (*Server) Set added in v0.6.11

func (s *Server) Set(ctx context.Context, request *topoapi.SetRequest) (*topoapi.SetResponse, error)

Set :

func (*Server) Stream

func (s *Server) Stream(server topoapi.Topo_SubscribeServer, ch chan *Event) error

Stream ...

func (*Server) Subscribe

func (s *Server) Subscribe(request *topoapi.SubscribeRequest, server topoapi.Topo_SubscribeServer) error

Subscribe ...

func (*Server) ValidateObject added in v0.6.11

func (s *Server) ValidateObject(object *topoapi.Object) error

ValidateObject validates the given object

type Service

type Service struct {
	northbound.Service
	// contains filtered or unexported fields
}

Service is a Service implementation for administration.

func (Service) Register

func (s Service) Register(r *grpc.Server)

Register registers the Service with the gRPC server.

type Store

type Store interface {
	io.Closer

	// Load loads a object from the store
	Load(objectID topoapi.ID) (*topoapi.Object, error)

	// Store stores a object in the store
	Store(*topoapi.Object) error

	// Delete deletes a object from the store
	Delete(topoapi.ID) error

	// List streams objects to the given channel
	List(chan<- *topoapi.Object) error

	// Watch streams object events to the given channel
	Watch(chan<- *Event, ...WatchOption) error
}

Store stores topology information

func NewAtomixStore

func NewAtomixStore() (Store, error)

NewAtomixStore returns a new persistent Store

func NewLocalStore

func NewLocalStore() (Store, error)

NewLocalStore returns a new local object store

type WatchOption

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

WatchOption is a configuration option for Watch calls

func WithReplay

func WithReplay() WatchOption

WithReplay returns a WatchOption that replays past changes

Jump to

Keyboard shortcuts

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