avoid

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientOnline        = iota
	ClientOffline       = iota
	ClientDisconnecting = iota
	ClientDisconnected  = iota
	ClientMigrating     = iota
	ClientConnected     = iota
)
View Source
const (
	AvoidClient_Action_FullMethodName      = "/avoid.client.AvoidClient/Action"
	AvoidClient_HealthCheck_FullMethodName = "/avoid.client.AvoidClient/HealthCheck"
)
View Source
const (
	AvoidManager_ListConnections_FullMethodName = "/avoid.manager.AvoidManager/ListConnections"
	AvoidManager_GetStats_FullMethodName        = "/avoid.manager.AvoidManager/GetStats"
	AvoidManager_Action_FullMethodName          = "/avoid.manager.AvoidManager/Action"
)
View Source
const (
	AvoidRelay_Register_FullMethodName    = "/avoid.client.AvoidRelay/Register"
	AvoidRelay_HealthCheck_FullMethodName = "/avoid.client.AvoidRelay/HealthCheck"
)
View Source
const (
	NoError      = iota
	Unspecified  = iota
	ErrNotFound  = iota
	TxnFailedNum = iota
	ConnFailed   = iota
)

Variables

View Source
var (
	DefaultAvoidManagerPort = 55554
	DefaultAvoidRelayPort   = 55555
	DefaultAvoidClientPort  = 55556
	DefaultAvoidConfigPath  = "/etc/avoid/avoid.conf"
)
View Source
var (
	ActionMessage_ConnType_name = map[int32]string{
		0: "NONE",
		1: "LIGHTHOUSE",
		2: "ENDPOINT",
		3: "RADIO",
		4: "NETWORK",
		5: "RELAY",
	}
	ActionMessage_ConnType_value = map[string]int32{
		"NONE":       0,
		"LIGHTHOUSE": 1,
		"ENDPOINT":   2,
		"RADIO":      3,
		"NETWORK":    4,
		"RELAY":      5,
	}
)

Enum value maps for ActionMessage_ConnType.

View Source
var (
	ActionMessage_Action_name = map[int32]string{
		0: "UNDEFINED",
		1: "MIGRATE",
		2: "DISCONNECT",
		3: "APPEND",
		4: "PRUNE",
		5: "FLUSH",
		6: "STATISTICS",
	}
	ActionMessage_Action_value = map[string]int32{
		"UNDEFINED":  0,
		"MIGRATE":    1,
		"DISCONNECT": 2,
		"APPEND":     3,
		"PRUNE":      4,
		"FLUSH":      5,
		"STATISTICS": 6,
	}
)

Enum value maps for ActionMessage_Action.

View Source
var (
	RunnerPrefix       = "/runners"
	PendingPrefix      = "/pending"
	ActionPrefix       = "/actionrequest"
	ConnPrefix         = "/connections"
	FailPrefix         = "/failed"
	RegistrationPrefix = "/registration"

	MaxFailCount = 3
)
View Source
var (
	ObjNotFound  = &ObjectError{Code: ErrNotFound, Message: "Object not Found"}
	TxnFailed    = &ObjectError{Code: TxnFailedNum, Message: "Transaction Failed"}
	ClientFailed = &ObjectError{Code: ConnFailed, Message: "Transaction Failed"}
)
View Source
var AvoidClient_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "avoid.client.AvoidClient",
	HandlerType: (*AvoidClientServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Action",
			Handler:    _AvoidClient_Action_Handler,
		},
		{
			MethodName: "HealthCheck",
			Handler:    _AvoidClient_HealthCheck_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "avoid/client.proto",
}

AvoidClient_ServiceDesc is the grpc.ServiceDesc for AvoidClient service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var AvoidManager_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "avoid.manager.AvoidManager",
	HandlerType: (*AvoidManagerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListConnections",
			Handler:    _AvoidManager_ListConnections_Handler,
		},
		{
			MethodName: "GetStats",
			Handler:    _AvoidManager_GetStats_Handler,
		},
		{
			MethodName: "Action",
			Handler:    _AvoidManager_Action_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "avoid/manager.proto",
}

AvoidManager_ServiceDesc is the grpc.ServiceDesc for AvoidManager service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var AvoidRelay_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "avoid.client.AvoidRelay",
	HandlerType: (*AvoidRelayServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _AvoidRelay_Register_Handler,
		},
		{
			MethodName: "HealthCheck",
			Handler:    _AvoidRelay_HealthCheck_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "avoid/relay.proto",
}

AvoidRelay_ServiceDesc is the grpc.ServiceDesc for AvoidRelay service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_avoid_client_proto protoreflect.FileDescriptor
View Source
var File_avoid_manager_proto protoreflect.FileDescriptor
View Source
var File_avoid_messages_proto protoreflect.FileDescriptor
View Source
var File_avoid_relay_proto protoreflect.FileDescriptor
View Source
var (
	MaxMessageSize = 1024 * 1024 * 4
)

Functions

func Delete

func Delete(obj stor.Object) error

Delete deletes an object from the datastore.

func DeleteObjects

func DeleteObjects(objs []stor.Object) error

DeleteObjects deletes a set of objects from the datastore.

func Error

func Error(message string) error

Error creates an error, and logs it righteously

func ErrorE

func ErrorE(message string, err error) error

ErrorE encapsulates err in a structured log and return an abstracted high-level error with message as the payload

func ErrorEF

func ErrorEF(message string, err error, fields log.Fields) error

ErrorEF encapsulates fields and err in a structured log and return an abstracted high-level error with message as the payload

func ErrorF

func ErrorF(message string, fields log.Fields) error

ErrorF encapsulates fields in a structured log and return an abstracted high-level error with message as the payload

func FromJSON

func FromJSON(o stor.Object, b []byte)

FromJSON reads reads on object from byte array encoded json. If the object is a protobuf, then protobuf is used instead.

func RUC

func RUC(o stor.Object, update func(o stor.Object)) error

RUC performs a read-update-commit on the provided object using the specified update function.

func ReadNew

func ReadNew(obj stor.Object) error

ReadNew reads an object form the datastore, and does not throw an error if the object is not found.

func ReadRevision

func ReadRevision(obj stor.Object) (revision int64, err error)

ReadRevision reads an object, and returns the clientv3 key revision for that object

func ReadStandard

func ReadStandard(obj stor.Object) error

func ReadWait

func ReadWait(obj stor.Object, timer *ReadTimer) error

ReadWait attempts to read an object repeatedly until a timeout threshold is reached defined by timer. If timer is nil the defaults of 30 seconds with a retry period of 250 milliseconds is applied

func ReadWaitObjects

func ReadWaitObjects(objs []stor.Object, timer *ReadTimer) error

ReadWaitObjects is readwait for many objects we check that the number of reads is equal to the number of objects (which is what ErrNotFound was doing anyway

func RegisterAvoidClientServer

func RegisterAvoidClientServer(s grpc.ServiceRegistrar, srv AvoidClientServer)

func RegisterAvoidManagerServer

func RegisterAvoidManagerServer(s grpc.ServiceRegistrar, srv AvoidManagerServer)

func RegisterAvoidRelayServer

func RegisterAvoidRelayServer(s grpc.ServiceRegistrar, srv AvoidRelayServer)

func RunObjectTx

func RunObjectTx(otx ObjectTx) error

RunObjectTx runs an object transaction.

func RunObjectTxPrefix

func RunObjectTxPrefix(puts []stor.Object, deletePrefix string) error

RunObjectTxPrefix a bastaradization of RunObjectTx, making it so put is still object array, but delete is a prefix for the txn

func SetConfig

func SetConfig(cfg *EtcdConfig) error

func ToJSON

func ToJSON(o stor.Object) string

ToJSON marshals an object to JSON form. If the object is a protobuf, protobuf is used instead.

func Touch

func Touch(obj stor.Object) error

Touch update the key, but not value in data store

func TouchObjects

func TouchObjects(objs []stor.Object) error

TouchObjects updates multiple keys

func Warn

func Warn(message string)

Warn acts like Error, but doesnt return anything

func WarnE

func WarnE(message string, err error)

WarnE includes an error message which is treated as not

func WarnEF

func WarnEF(message string, err error, fields log.Fields)

WarnF includes an encapsulated field to the warning message

func WarnF

func WarnF(message string, fields log.Fields)

WarnF includes an encapsulated field to the warning message

func WithAvoidClient

func WithAvoidClient(endpoint string, tlsCfg *stor.TLSConfig, f func(AvoidClientClient) error) error

func WithAvoidManager

func WithAvoidManager(endpoint string, tlsCfg *stor.TLSConfig, f func(AvoidManagerClient) error) error

func WithAvoidRelay

func WithAvoidRelay(endpoint string, tlsCfg *stor.TLSConfig, f func(AvoidRelayClient) error) error

func Write

func Write(obj stor.Object, opts ...clientv3.OpOption) error

Write persists an object to the datastore.

Types

type ActionMessage

type ActionMessage struct {
	Connection ActionMessage_ConnType `protobuf:"varint,1,opt,name=connection,proto3,enum=avoid.messages.ActionMessage_ConnType" json:"connection,omitempty"`
	Action     ActionMessage_Action   `protobuf:"varint,2,opt,name=action,proto3,enum=avoid.messages.ActionMessage_Action" json:"action,omitempty"`
	Uuid       string                 `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Version    int64                  `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionMessage) Descriptor deprecated

func (*ActionMessage) Descriptor() ([]byte, []int)

Deprecated: Use ActionMessage.ProtoReflect.Descriptor instead.

func (*ActionMessage) GetAction

func (x *ActionMessage) GetAction() ActionMessage_Action

func (*ActionMessage) GetConnection

func (x *ActionMessage) GetConnection() ActionMessage_ConnType

func (*ActionMessage) GetUuid

func (x *ActionMessage) GetUuid() string

func (*ActionMessage) GetVersion

func (x *ActionMessage) GetVersion() int64

func (*ActionMessage) ProtoMessage

func (*ActionMessage) ProtoMessage()

func (*ActionMessage) ProtoReflect

func (x *ActionMessage) ProtoReflect() protoreflect.Message

func (*ActionMessage) Reset

func (x *ActionMessage) Reset()

func (*ActionMessage) String

func (x *ActionMessage) String() string

type ActionMessage_Action

type ActionMessage_Action int32
const (
	ActionMessage_UNDEFINED  ActionMessage_Action = 0
	ActionMessage_MIGRATE    ActionMessage_Action = 1
	ActionMessage_DISCONNECT ActionMessage_Action = 2
	ActionMessage_APPEND     ActionMessage_Action = 3
	ActionMessage_PRUNE      ActionMessage_Action = 4
	ActionMessage_FLUSH      ActionMessage_Action = 5
	ActionMessage_STATISTICS ActionMessage_Action = 6
)

func (ActionMessage_Action) Descriptor

func (ActionMessage_Action) Enum

func (ActionMessage_Action) EnumDescriptor deprecated

func (ActionMessage_Action) EnumDescriptor() ([]byte, []int)

Deprecated: Use ActionMessage_Action.Descriptor instead.

func (ActionMessage_Action) Number

func (ActionMessage_Action) String

func (x ActionMessage_Action) String() string

func (ActionMessage_Action) Type

type ActionMessage_ConnType

type ActionMessage_ConnType int32
const (
	ActionMessage_NONE       ActionMessage_ConnType = 0
	ActionMessage_LIGHTHOUSE ActionMessage_ConnType = 1
	ActionMessage_ENDPOINT   ActionMessage_ConnType = 2
	ActionMessage_RADIO      ActionMessage_ConnType = 3
	ActionMessage_NETWORK    ActionMessage_ConnType = 4
	ActionMessage_RELAY      ActionMessage_ConnType = 5
)

func (ActionMessage_ConnType) Descriptor

func (ActionMessage_ConnType) Enum

func (ActionMessage_ConnType) EnumDescriptor deprecated

func (ActionMessage_ConnType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ActionMessage_ConnType.Descriptor instead.

func (ActionMessage_ConnType) Number

func (ActionMessage_ConnType) String

func (x ActionMessage_ConnType) String() string

func (ActionMessage_ConnType) Type

type ActionRequest

type ActionRequest struct {
	Identifier string         `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // endpoint identifier
	Action     *ActionMessage `protobuf:"bytes,2,opt,name=Action,proto3" json:"Action,omitempty"`
	Values     []string       `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"`
	Token      string         `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"`      // used for client
	Version    int64          `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` // for versioning updates
	Uuid       string         `protobuf:"bytes,6,opt,name=uuid,proto3" json:"uuid,omitempty"`        // for tracking requests
	// contains filtered or unexported fields
}

func (*ActionRequest) Descriptor deprecated

func (*ActionRequest) Descriptor() ([]byte, []int)

Deprecated: Use ActionRequest.ProtoReflect.Descriptor instead.

func (*ActionRequest) GetAction

func (x *ActionRequest) GetAction() *ActionMessage

func (*ActionRequest) GetIdentifier

func (x *ActionRequest) GetIdentifier() string

func (*ActionRequest) GetToken

func (x *ActionRequest) GetToken() string

func (*ActionRequest) GetUuid

func (x *ActionRequest) GetUuid() string

func (*ActionRequest) GetValues

func (x *ActionRequest) GetValues() []string

func (*ActionRequest) GetVersion

func (x *ActionRequest) GetVersion() int64

func (*ActionRequest) Key

func (x *ActionRequest) Key() string

TODO: guard rails before calling Key()

func (*ActionRequest) ProtoMessage

func (*ActionRequest) ProtoMessage()

func (*ActionRequest) ProtoReflect

func (x *ActionRequest) ProtoReflect() protoreflect.Message

func (*ActionRequest) Reset

func (x *ActionRequest) Reset()

func (*ActionRequest) SetVersion

func (x *ActionRequest) SetVersion(v int64)

func (*ActionRequest) String

func (x *ActionRequest) String() string

func (*ActionRequest) Value

func (x *ActionRequest) Value() interface{}

type AlertConfig

type AlertConfig struct {
	Address  string
	Port     int
	Username string
	Password string
	Type     string
}

type Avoid

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

TODO: Make this all atomics

func NewAvoidFromConfig

func NewAvoidFromConfig(l *log.Logger, c *config.C) *Avoid

func (*Avoid) GetBackups

func (av *Avoid) GetBackups() []*Endpoint

func (*Avoid) GetCertificate

func (av *Avoid) GetCertificate() string

func (*Avoid) GetClient

func (av *Avoid) GetClient() bool

func (*Avoid) GetIdentity

func (av *Avoid) GetIdentity() string

func (*Avoid) GetKey

func (av *Avoid) GetKey() string

func (*Avoid) GetManager

func (av *Avoid) GetManager() bool

func (*Avoid) GetPrimary

func (av *Avoid) GetPrimary() *Endpoint

type AvoidClientClient

type AvoidClientClient interface {
	Action(ctx context.Context, in *ActionRequest, opts ...grpc.CallOption) (*ConnectionInfo, error)
	HealthCheck(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthReply, error)
}

AvoidClientClient is the client API for AvoidClient service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

From Actioneer or Handler TO UE The assumption is this service is specific to UE endpoints and incorporates the actions required to be taken by the avoid service.

type AvoidClientServer

type AvoidClientServer interface {
	Action(context.Context, *ActionRequest) (*ConnectionInfo, error)
	HealthCheck(context.Context, *HealthRequest) (*HealthReply, error)
	// contains filtered or unexported methods
}

AvoidClientServer is the server API for AvoidClient service. All implementations must embed UnimplementedAvoidClientServer for forward compatibility

From Actioneer or Handler TO UE The assumption is this service is specific to UE endpoints and incorporates the actions required to be taken by the avoid service.

type AvoidManagerClient

type AvoidManagerClient interface {
	ListConnections(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error)
	GetStats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*ConnectionInfo, error)
	Action(ctx context.Context, in *ActionRequest, opts ...grpc.CallOption) (*ConnectionInfo, error)
}

AvoidManagerClient is the client API for AvoidManager service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type AvoidManagerServer

type AvoidManagerServer interface {
	ListConnections(context.Context, *ListRequest) (*ListReply, error)
	GetStats(context.Context, *StatsRequest) (*ConnectionInfo, error)
	Action(context.Context, *ActionRequest) (*ConnectionInfo, error)
	// contains filtered or unexported methods
}

AvoidManagerServer is the server API for AvoidManager service. All implementations must embed UnimplementedAvoidManagerServer for forward compatibility

type AvoidRelayClient

type AvoidRelayClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterReply, error)
	HealthCheck(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthReply, error)
}

AvoidRelayClient is the client API for AvoidRelay service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAvoidRelayClient

func NewAvoidRelayClient(cc grpc.ClientConnInterface) AvoidRelayClient

type AvoidRelayServer

type AvoidRelayServer interface {
	Register(context.Context, *RegisterRequest) (*RegisterReply, error)
	HealthCheck(context.Context, *HealthRequest) (*HealthReply, error)
	// contains filtered or unexported methods
}

AvoidRelayServer is the server API for AvoidRelay service. All implementations must embed UnimplementedAvoidRelayServer for forward compatibility

type ClientServiceConfig

type ClientServiceConfig struct {
	EPS      []*Endpoint `yaml:eps",omitempty"`
	Identity string      `yaml:identity",omitempty"`
}

https://pulwar.isi.edu/sabres/orchestrator/-/blob/main/pkg/config.go

type ConnectionInfo

type ConnectionInfo struct {
	Uuid     string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Version  int64  `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	Name     string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	Ran      string `protobuf:"bytes,4,opt,name=ran,proto3" json:"ran,omitempty"`
	Path     string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`
	Endpoint string `protobuf:"bytes,6,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	Network  string `protobuf:"bytes,7,opt,name=network,proto3" json:"network,omitempty"`
	Relay    string `protobuf:"bytes,8,opt,name=relay,proto3" json:"relay,omitempty"`
	User     string `protobuf:"bytes,9,opt,name=user,proto3" json:"user,omitempty"`
	Duration int64  `protobuf:"varint,10,opt,name=duration,proto3" json:"duration,omitempty"`
	Lastseen int64  `protobuf:"varint,11,opt,name=lastseen,proto3" json:"lastseen,omitempty"`
	Download int64  `protobuf:"varint,12,opt,name=download,proto3" json:"download,omitempty"`
	Upload   int64  `protobuf:"varint,13,opt,name=upload,proto3" json:"upload,omitempty"`
	Error    bool   `protobuf:"varint,14,opt,name=error,proto3" json:"error,omitempty"`
	ErrMsg   string `protobuf:"bytes,15,opt,name=errMsg,proto3" json:"errMsg,omitempty"`
	// contains filtered or unexported fields
}

func (*ConnectionInfo) Descriptor deprecated

func (*ConnectionInfo) Descriptor() ([]byte, []int)

Deprecated: Use ConnectionInfo.ProtoReflect.Descriptor instead.

func (*ConnectionInfo) GetDownload

func (x *ConnectionInfo) GetDownload() int64

func (*ConnectionInfo) GetDuration

func (x *ConnectionInfo) GetDuration() int64

func (*ConnectionInfo) GetEndpoint

func (x *ConnectionInfo) GetEndpoint() string

func (*ConnectionInfo) GetErrMsg

func (x *ConnectionInfo) GetErrMsg() string

func (*ConnectionInfo) GetError

func (x *ConnectionInfo) GetError() bool

func (*ConnectionInfo) GetLastseen

func (x *ConnectionInfo) GetLastseen() int64

func (*ConnectionInfo) GetName

func (x *ConnectionInfo) GetName() string

func (*ConnectionInfo) GetNetwork

func (x *ConnectionInfo) GetNetwork() string

func (*ConnectionInfo) GetPath

func (x *ConnectionInfo) GetPath() string

func (*ConnectionInfo) GetRan

func (x *ConnectionInfo) GetRan() string

func (*ConnectionInfo) GetRelay

func (x *ConnectionInfo) GetRelay() string

func (*ConnectionInfo) GetUpload

func (x *ConnectionInfo) GetUpload() int64

func (*ConnectionInfo) GetUser

func (x *ConnectionInfo) GetUser() string

func (*ConnectionInfo) GetUuid

func (x *ConnectionInfo) GetUuid() string

func (*ConnectionInfo) GetVersion

func (x *ConnectionInfo) GetVersion() int64

func (*ConnectionInfo) Key

func (x *ConnectionInfo) Key() string

func (*ConnectionInfo) ProtoMessage

func (*ConnectionInfo) ProtoMessage()

func (*ConnectionInfo) ProtoReflect

func (x *ConnectionInfo) ProtoReflect() protoreflect.Message

func (*ConnectionInfo) Reset

func (x *ConnectionInfo) Reset()

func (*ConnectionInfo) SetVersion

func (x *ConnectionInfo) SetVersion(v int64)

func (*ConnectionInfo) String

func (x *ConnectionInfo) String() string

func (*ConnectionInfo) Value

func (x *ConnectionInfo) Value() interface{}

type Endpoint

type Endpoint struct {
	Address string          `yaml:address",omitempty"` // Address and Port should be on VPN for traffic to go over VPN
	Port    int             `yaml:port",omitempty"`    // Address and Port should be on VPN for traffic to go over VPN
	TLS     *stor.TLSConfig `yaml:tls",omitempty"`
	Timeout int             `yaml:timeout",omitempty"`
	Primary bool            `yaml:primary",omitempty"`
}

func (*Endpoint) GetCert

func (ep *Endpoint) GetCert() string

func (*Endpoint) GetKey

func (ep *Endpoint) GetKey() string

func (*Endpoint) ToAddr

func (ep *Endpoint) ToAddr() string

Endpoint returns the endpoint string of a service config.

type EtcdConfig

type EtcdConfig struct {
	Address string
	Port    int
	TLS     *stor.TLSConfig
	Quantum time.Duration
	Timeout time.Duration
}

func GetEtcdConfig

func GetEtcdConfig(cfg *ServicesConfig) (*EtcdConfig, error)

GetEtcdConfig sets the global etcd configuration settings

type HealthReply

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

func (*HealthReply) Descriptor deprecated

func (*HealthReply) Descriptor() ([]byte, []int)

Deprecated: Use HealthReply.ProtoReflect.Descriptor instead.

func (*HealthReply) ProtoMessage

func (*HealthReply) ProtoMessage()

func (*HealthReply) ProtoReflect

func (x *HealthReply) ProtoReflect() protoreflect.Message

func (*HealthReply) Reset

func (x *HealthReply) Reset()

func (*HealthReply) String

func (x *HealthReply) String() string

type HealthRequest

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

func (*HealthRequest) Descriptor deprecated

func (*HealthRequest) Descriptor() ([]byte, []int)

Deprecated: Use HealthRequest.ProtoReflect.Descriptor instead.

func (*HealthRequest) ProtoMessage

func (*HealthRequest) ProtoMessage()

func (*HealthRequest) ProtoReflect

func (x *HealthRequest) ProtoReflect() protoreflect.Message

func (*HealthRequest) Reset

func (x *HealthRequest) Reset()

func (*HealthRequest) String

func (x *HealthRequest) String() string

type ListReply

type ListReply struct {
	Info []*ConnectionInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"`
	// contains filtered or unexported fields
}

func (*ListReply) Descriptor deprecated

func (*ListReply) Descriptor() ([]byte, []int)

Deprecated: Use ListReply.ProtoReflect.Descriptor instead.

func (*ListReply) GetInfo

func (x *ListReply) GetInfo() []*ConnectionInfo

func (*ListReply) ProtoMessage

func (*ListReply) ProtoMessage()

func (*ListReply) ProtoReflect

func (x *ListReply) ProtoReflect() protoreflect.Message

func (*ListReply) Reset

func (x *ListReply) Reset()

func (*ListReply) String

func (x *ListReply) String() string

type ListRequest

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

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ManagerServiceConfig

type ManagerServiceConfig struct {
	EP *Endpoint `yaml:ep",omitempty"`
}

type ObjectError

type ObjectError struct {
	Code    int
	Message string
}

func Read

func Read(obj stor.Object) *ObjectError

Read reads an object from the datastore

func ReadObjects

func ReadObjects(objs []stor.Object) (int, *ObjectError)

ReadObjects reads a set of objects from the datastore in a one-shot transaction.

func WriteObjects

func WriteObjects(objs []stor.Object, fresh bool, opts ...clientv3.OpOption) *ObjectError

WriteObjects writes objects to the datastore in a single shot transaction. If fresh is true, then all objects must be the most recent version, or the write will fail.

func (*ObjectError) Error

func (e *ObjectError) Error() string

func (*ObjectError) ToError

func (e *ObjectError) ToError() error

type ObjectTx

type ObjectTx struct {
	Put    []stor.Object
	Delete []stor.Object
}

ObjectTx encapsulates a set of put and delete operations into a single transaction.

type Pending

type Pending struct {
	ActionKey string // action key pointer
	Version   int64  // for stor to manage
	Owner     string // owner
	ErrCount  int    // failures
}

func (*Pending) GetVersion

func (x *Pending) GetVersion() int64

func (*Pending) Key

func (x *Pending) Key() string

func (*Pending) SetVersion

func (x *Pending) SetVersion(v int64)

func (*Pending) Value

func (x *Pending) Value() interface{}

type ReadTimer

type ReadTimer struct {
	Period  time.Duration
	Timeout time.Duration
}

ReadTimer tracks timing information about a read.

type RegisterReply

type RegisterReply struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterReply) Descriptor deprecated

func (*RegisterReply) Descriptor() ([]byte, []int)

Deprecated: Use RegisterReply.ProtoReflect.Descriptor instead.

func (*RegisterReply) GetToken

func (x *RegisterReply) GetToken() string

func (*RegisterReply) ProtoMessage

func (*RegisterReply) ProtoMessage()

func (*RegisterReply) ProtoReflect

func (x *RegisterReply) ProtoReflect() protoreflect.Message

func (*RegisterReply) Reset

func (x *RegisterReply) Reset()

func (*RegisterReply) String

func (x *RegisterReply) String() string

type RegisterRequest

type RegisterRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`  // self identified name
	Ip   string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`      // ip of the client
	Port int64  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` // port of the client service
	Cert string `protobuf:"bytes,4,opt,name=cert,proto3" json:"cert,omitempty"`  // certificate of the client service
	Dns  string `protobuf:"bytes,5,opt,name=dns,proto3" json:"dns,omitempty"`    // dns name instead of ip // TODO if this matters
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

func (*RegisterRequest) Descriptor() ([]byte, []int)

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetCert

func (x *RegisterRequest) GetCert() string

func (*RegisterRequest) GetDns

func (x *RegisterRequest) GetDns() string

func (*RegisterRequest) GetIp

func (x *RegisterRequest) GetIp() string

func (*RegisterRequest) GetName

func (x *RegisterRequest) GetName() string

func (*RegisterRequest) GetPort

func (x *RegisterRequest) GetPort() int64

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

func (x *RegisterRequest) ProtoReflect() protoreflect.Message

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type Registration

type Registration struct {
	UE          string
	EP          string
	Token       string
	IP          string
	DNS         string
	Certificate string
	Port        int64
	Version     int64
}

TODO: TOTP

func (*Registration) GetVersion

func (x *Registration) GetVersion() int64

func (*Registration) Key

func (x *Registration) Key() string

func (*Registration) SetVersion

func (x *Registration) SetVersion(v int64)

func (*Registration) Value

func (x *Registration) Value() interface{}

type ServiceConfig

type ServiceConfig struct {
	Address string
	Port    int
	TLS     *stor.TLSConfig
}

ServiceConfig encapsulates information for communicating with services.

func (*ServiceConfig) Endpoint

func (s *ServiceConfig) Endpoint() string

Endpoint returns the endpoint string of a service config.

type ServicesConfig

type ServicesConfig struct {
	Client  *ClientServiceConfig  `yaml:client",omitempty"`
	Manager *ManagerServiceConfig `yaml:manager",omitempty"`
	Etcd    *EtcdConfig           `yaml:etcd",omitempty"`
}

ServicesConfig encapsulates information for communicating with services.

func LoadConfig

func LoadConfig(configPath string) (*ServicesConfig, error)

type StatsRequest

type StatsRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*StatsRequest) Descriptor deprecated

func (*StatsRequest) Descriptor() ([]byte, []int)

Deprecated: Use StatsRequest.ProtoReflect.Descriptor instead.

func (*StatsRequest) GetName

func (x *StatsRequest) GetName() string

func (*StatsRequest) ProtoMessage

func (*StatsRequest) ProtoMessage()

func (*StatsRequest) ProtoReflect

func (x *StatsRequest) ProtoReflect() protoreflect.Message

func (*StatsRequest) Reset

func (x *StatsRequest) Reset()

func (*StatsRequest) String

func (x *StatsRequest) String() string

type UnimplementedAvoidClientServer

type UnimplementedAvoidClientServer struct {
}

UnimplementedAvoidClientServer must be embedded to have forward compatible implementations.

func (UnimplementedAvoidClientServer) Action

func (UnimplementedAvoidClientServer) HealthCheck

type UnimplementedAvoidManagerServer

type UnimplementedAvoidManagerServer struct {
}

UnimplementedAvoidManagerServer must be embedded to have forward compatible implementations.

func (UnimplementedAvoidManagerServer) Action

func (UnimplementedAvoidManagerServer) GetStats

func (UnimplementedAvoidManagerServer) ListConnections

type UnimplementedAvoidRelayServer

type UnimplementedAvoidRelayServer struct {
}

UnimplementedAvoidRelayServer must be embedded to have forward compatible implementations.

func (UnimplementedAvoidRelayServer) HealthCheck

func (UnimplementedAvoidRelayServer) Register

type UnsafeAvoidClientServer

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

UnsafeAvoidClientServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AvoidClientServer will result in compilation errors.

type UnsafeAvoidManagerServer

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

UnsafeAvoidManagerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AvoidManagerServer will result in compilation errors.

type UnsafeAvoidRelayServer

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

UnsafeAvoidRelayServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AvoidRelayServer will result in compilation errors.

Directories

Path Synopsis
cli
services

Jump to

Keyboard shortcuts

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