vcservice

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReconnectSleep determines the length of time to wait between reconnect attempts to dProxy
	ReconnectSleep = time.Second * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachedStream

type AttachedStream struct {
	EventsCh chan *protos.VCEvent
}

type Client

type Client struct {
	*Config
	Client protos.VCServiceClient
	Conn   *grpc.ClientConn

	EventsCh             chan *protos.VCEvent
	AttachedStreams      map[string]*AttachedStream
	AttachedStreamsMutex *sync.RWMutex
	// contains filtered or unexported fields
}

func (*Client) AttachStream

func (c *Client) AttachStream(id string) *AttachedStream

AttachStream adds a vc-service event listener to the AttachedStreams map which will receive a copy of all VCEvent messages

func (*Client) DetachStream

func (c *Client) DetachStream(id string)

DetachStream removes a vc-service event listener from AttachedStreams map

func (*Client) Start

func (c *Client) Start()

type Config

type Config struct {
	EtcdService      etcd.IEtcd
	ServerOptions    *opts.ServerOptions
	PersistentConfig *config.Config
}

type IVCService

type IVCService interface {
	AttachStream(id string) *AttachedStream
	DetachStream(id string)
}

func New

func New(cfg *Config) (IVCService, error)

New validates CLI options and returns a new Client struct

Jump to

Keyboard shortcuts

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