Documentation ¶
Index ¶
- Constants
- Variables
- func Delete(obj stor.Object) error
- func DeleteObjects(objs []stor.Object) error
- func Error(message string) error
- func ErrorE(message string, err error) error
- func ErrorEF(message string, err error, fields log.Fields) error
- func ErrorF(message string, fields log.Fields) error
- func FromJSON(o stor.Object, b []byte)
- func RUC(o stor.Object, update func(o stor.Object)) error
- func ReadNew(obj stor.Object) error
- func ReadRevision(obj stor.Object) (revision int64, err error)
- func ReadStandard(obj stor.Object) error
- func ReadWait(obj stor.Object, timer *ReadTimer) error
- func ReadWaitObjects(objs []stor.Object, timer *ReadTimer) error
- func RegisterAvoidClientServer(s grpc.ServiceRegistrar, srv AvoidClientServer)
- func RegisterAvoidManagerServer(s grpc.ServiceRegistrar, srv AvoidManagerServer)
- func RegisterAvoidRelayServer(s grpc.ServiceRegistrar, srv AvoidRelayServer)
- func RunObjectTx(otx ObjectTx) error
- func RunObjectTxPrefix(puts []stor.Object, deletePrefix string) error
- func SetConfig(cfg *EtcdConfig) error
- func ToJSON(o stor.Object) string
- func Touch(obj stor.Object) error
- func TouchObjects(objs []stor.Object) error
- func Warn(message string)
- func WarnE(message string, err error)
- func WarnEF(message string, err error, fields log.Fields)
- func WarnF(message string, fields log.Fields)
- func WithAvoidClient(endpoint string, tlsCfg *stor.TLSConfig, f func(AvoidClientClient) error) error
- func WithAvoidManager(endpoint string, tlsCfg *stor.TLSConfig, f func(AvoidManagerClient) error) error
- func WithAvoidRelay(ourIP, endpoint string, tlsCfg *stor.TLSConfig, f func(AvoidRelayClient) error) error
- func Write(obj stor.Object, opts ...clientv3.OpOption) error
- type ActionMessage
- func (*ActionMessage) Descriptor() ([]byte, []int)deprecated
- func (x *ActionMessage) GetAction() ActionMessage_Action
- func (x *ActionMessage) GetConnection() ActionMessage_ConnType
- func (x *ActionMessage) GetUuid() string
- func (x *ActionMessage) GetVersion() int64
- func (*ActionMessage) ProtoMessage()
- func (x *ActionMessage) ProtoReflect() protoreflect.Message
- func (x *ActionMessage) Reset()
- func (x *ActionMessage) String() string
- type ActionMessage_Action
- func (ActionMessage_Action) Descriptor() protoreflect.EnumDescriptor
- func (x ActionMessage_Action) Enum() *ActionMessage_Action
- func (ActionMessage_Action) EnumDescriptor() ([]byte, []int)deprecated
- func (x ActionMessage_Action) Number() protoreflect.EnumNumber
- func (x ActionMessage_Action) String() string
- func (ActionMessage_Action) Type() protoreflect.EnumType
- type ActionMessage_ConnType
- func (ActionMessage_ConnType) Descriptor() protoreflect.EnumDescriptor
- func (x ActionMessage_ConnType) Enum() *ActionMessage_ConnType
- func (ActionMessage_ConnType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ActionMessage_ConnType) Number() protoreflect.EnumNumber
- func (x ActionMessage_ConnType) String() string
- func (ActionMessage_ConnType) Type() protoreflect.EnumType
- type ActionRequest
- func (*ActionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ActionRequest) GetAction() *ActionMessage
- func (x *ActionRequest) GetIdentifier() string
- func (x *ActionRequest) GetToken() string
- func (x *ActionRequest) GetUuid() string
- func (x *ActionRequest) GetValues() []string
- func (x *ActionRequest) GetVersion() int64
- func (x *ActionRequest) Key() string
- func (*ActionRequest) ProtoMessage()
- func (x *ActionRequest) ProtoReflect() protoreflect.Message
- func (x *ActionRequest) Reset()
- func (x *ActionRequest) SetVersion(v int64)
- func (x *ActionRequest) String() string
- func (x *ActionRequest) Value() interface{}
- type AlertConfig
- type Avoid
- type AvoidClientClient
- type AvoidClientServer
- type AvoidManagerClient
- type AvoidManagerServer
- type AvoidRelayClient
- type AvoidRelayServer
- type ClientServiceConfig
- type ConnectionInfo
- func (*ConnectionInfo) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectionInfo) GetDownload() int64
- func (x *ConnectionInfo) GetDuration() int64
- func (x *ConnectionInfo) GetEndpoint() string
- func (x *ConnectionInfo) GetErrMsg() string
- func (x *ConnectionInfo) GetError() bool
- func (x *ConnectionInfo) GetLastseen() int64
- func (x *ConnectionInfo) GetName() string
- func (x *ConnectionInfo) GetNetwork() string
- func (x *ConnectionInfo) GetPath() string
- func (x *ConnectionInfo) GetRan() string
- func (x *ConnectionInfo) GetRelay() string
- func (x *ConnectionInfo) GetUpload() int64
- func (x *ConnectionInfo) GetUser() string
- func (x *ConnectionInfo) GetUuid() string
- func (x *ConnectionInfo) GetVersion() int64
- func (x *ConnectionInfo) Key() string
- func (*ConnectionInfo) ProtoMessage()
- func (x *ConnectionInfo) ProtoReflect() protoreflect.Message
- func (x *ConnectionInfo) Reset()
- func (x *ConnectionInfo) SetVersion(v int64)
- func (x *ConnectionInfo) String() string
- func (x *ConnectionInfo) Value() interface{}
- type Endpoint
- type EtcdConfig
- type HealthReply
- type HealthRequest
- type ListReply
- type ListRequest
- type ManagerServiceConfig
- type ObjectError
- type ObjectTx
- type Pending
- type ReadTimer
- type RegisterReply
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetCert() string
- func (x *RegisterRequest) GetDns() string
- func (x *RegisterRequest) GetIp() string
- func (x *RegisterRequest) GetName() string
- func (x *RegisterRequest) GetPort() int64
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type Registration
- type ServiceConfig
- type ServicesConfig
- type StatsRequest
- type UnimplementedAvoidClientServer
- type UnimplementedAvoidManagerServer
- func (UnimplementedAvoidManagerServer) Action(context.Context, *ActionRequest) (*ConnectionInfo, error)
- func (UnimplementedAvoidManagerServer) GetStats(context.Context, *StatsRequest) (*ConnectionInfo, error)
- func (UnimplementedAvoidManagerServer) ListConnections(context.Context, *ListRequest) (*ListReply, error)
- type UnimplementedAvoidRelayServer
- type UnsafeAvoidClientServer
- type UnsafeAvoidManagerServer
- type UnsafeAvoidRelayServer
Constants ¶
const ( ClientOnline = iota ClientOffline = iota ClientDisconnecting = iota ClientDisconnected = iota ClientMigrating = iota ClientConnected = iota )
const ( AvoidClient_Action_FullMethodName = "/avoid.client.AvoidClient/Action" AvoidClient_HealthCheck_FullMethodName = "/avoid.client.AvoidClient/HealthCheck" )
const ( AvoidManager_ListConnections_FullMethodName = "/avoid.manager.AvoidManager/ListConnections" AvoidManager_GetStats_FullMethodName = "/avoid.manager.AvoidManager/GetStats" AvoidManager_Action_FullMethodName = "/avoid.manager.AvoidManager/Action" )
const ( AvoidRelay_Register_FullMethodName = "/avoid.client.AvoidRelay/Register" AvoidRelay_HealthCheck_FullMethodName = "/avoid.client.AvoidRelay/HealthCheck" )
Variables ¶
var ( DefaultAvoidManagerPort = 55554 DefaultAvoidRelayPort = 55555 DefaultAvoidClientPort = 55556 DefaultAvoidConfigPath = "/etc/avoid/avoid.conf" )
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.
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.
var ( RunnerPrefix = "/runners" PendingPrefix = "/pending" ActionPrefix = "/actionrequest" ConnPrefix = "/connections" FailPrefix = "/failed" RegistrationPrefix = "/registration" MaxFailCount = 3 )
var ( ObjNotFound = &ObjectError{Code: ErrNotFound, Message: "Object not Found"} TxnFailed = &ObjectError{Code: TxnFailedNum, Message: "Transaction Failed"} ClientFailed = &ObjectError{Code: ConnFailed, Message: "Transaction Failed"} )
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)
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)
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)
var File_avoid_client_proto protoreflect.FileDescriptor
var File_avoid_manager_proto protoreflect.FileDescriptor
var File_avoid_messages_proto protoreflect.FileDescriptor
var File_avoid_relay_proto protoreflect.FileDescriptor
var (
MaxMessageSize = 1024 * 1024 * 4
)
Functions ¶
func DeleteObjects ¶
DeleteObjects deletes a set of objects from the datastore.
func ErrorE ¶
ErrorE encapsulates err in a structured log and return an abstracted high-level error with message as the payload
func ErrorEF ¶
ErrorEF encapsulates fields and err in a structured log and return an abstracted high-level error with message as the payload
func ErrorF ¶
ErrorF encapsulates fields in a structured log and return an abstracted high-level error with message as the payload
func FromJSON ¶
FromJSON reads reads on object from byte array encoded json. If the object is a protobuf, then protobuf is used instead.
func RUC ¶
RUC performs a read-update-commit on the provided object using the specified update function.
func ReadNew ¶
ReadNew reads an object form the datastore, and does not throw an error if the object is not found.
func ReadRevision ¶
ReadRevision reads an object, and returns the clientv3 key revision for that object
func ReadStandard ¶
func ReadWait ¶
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 ¶
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 RunObjectTxPrefix ¶
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 ¶
ToJSON marshals an object to JSON form. If the object is a protobuf, protobuf is used instead.
func WithAvoidClient ¶
func WithAvoidManager ¶
func WithAvoidRelay ¶
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) Descriptor() protoreflect.EnumDescriptor
func (ActionMessage_Action) Enum ¶
func (x ActionMessage_Action) Enum() *ActionMessage_Action
func (ActionMessage_Action) EnumDescriptor
deprecated
func (ActionMessage_Action) EnumDescriptor() ([]byte, []int)
Deprecated: Use ActionMessage_Action.Descriptor instead.
func (ActionMessage_Action) Number ¶
func (x ActionMessage_Action) Number() protoreflect.EnumNumber
func (ActionMessage_Action) String ¶
func (x ActionMessage_Action) String() string
func (ActionMessage_Action) Type ¶
func (ActionMessage_Action) Type() protoreflect.EnumType
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) Descriptor() protoreflect.EnumDescriptor
func (ActionMessage_ConnType) Enum ¶
func (x ActionMessage_ConnType) Enum() *ActionMessage_ConnType
func (ActionMessage_ConnType) EnumDescriptor
deprecated
func (ActionMessage_ConnType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ActionMessage_ConnType.Descriptor instead.
func (ActionMessage_ConnType) Number ¶
func (x ActionMessage_ConnType) Number() protoreflect.EnumNumber
func (ActionMessage_ConnType) String ¶
func (x ActionMessage_ConnType) String() string
func (ActionMessage_ConnType) Type ¶
func (ActionMessage_ConnType) Type() protoreflect.EnumType
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 Avoid ¶
type Avoid struct {
// contains filtered or unexported fields
}
TODO: Make this all atomics
func (*Avoid) GetBackups ¶
func (*Avoid) GetCertificate ¶
func (*Avoid) GetIdentity ¶
func (*Avoid) GetManager ¶
func (*Avoid) GetPrimary ¶
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.
func NewAvoidClientClient ¶
func NewAvoidClientClient(cc grpc.ClientConnInterface) AvoidClientClient
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.
func NewAvoidManagerClient ¶
func NewAvoidManagerClient(cc grpc.ClientConnInterface) AvoidManagerClient
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"` }
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) GetInfo ¶
func (x *ListReply) GetInfo() []*ConnectionInfo
func (*ListReply) ProtoMessage ¶
func (*ListReply) ProtoMessage()
func (*ListReply) ProtoReflect ¶
func (x *ListReply) ProtoReflect() protoreflect.Message
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 ¶
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 ¶
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 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 (*Pending) SetVersion ¶
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 ¶
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.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAvoidClientServer) Action ¶
func (UnimplementedAvoidClientServer) Action(context.Context, *ActionRequest) (*ConnectionInfo, error)
func (UnimplementedAvoidClientServer) HealthCheck ¶
func (UnimplementedAvoidClientServer) HealthCheck(context.Context, *HealthRequest) (*HealthReply, error)
type UnimplementedAvoidManagerServer ¶
type UnimplementedAvoidManagerServer struct{}
UnimplementedAvoidManagerServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAvoidManagerServer) Action ¶
func (UnimplementedAvoidManagerServer) Action(context.Context, *ActionRequest) (*ConnectionInfo, error)
func (UnimplementedAvoidManagerServer) GetStats ¶
func (UnimplementedAvoidManagerServer) GetStats(context.Context, *StatsRequest) (*ConnectionInfo, error)
func (UnimplementedAvoidManagerServer) ListConnections ¶
func (UnimplementedAvoidManagerServer) ListConnections(context.Context, *ListRequest) (*ListReply, error)
type UnimplementedAvoidRelayServer ¶
type UnimplementedAvoidRelayServer struct{}
UnimplementedAvoidRelayServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAvoidRelayServer) HealthCheck ¶
func (UnimplementedAvoidRelayServer) HealthCheck(context.Context, *HealthRequest) (*HealthReply, error)
func (UnimplementedAvoidRelayServer) Register ¶
func (UnimplementedAvoidRelayServer) Register(context.Context, *RegisterRequest) (*RegisterReply, error)
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.