api

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: LGPL-3.0 Imports: 29 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Request wasn't sent as the task is ended
	ErrorTaskEnded = Error("task ended")

	// Request wasn't sent as there was no active connection
	ErrorNoActiveConnection = Error("no active connection")

	// Request wasn't sent as the request buffer is full
	ErrorFullBuffer = Error("full request buffer")
)

Variables

View Source
var (
	AlarmStatus_name = map[int32]string{
		0: "ON",
		1: "OFF",
	}
	AlarmStatus_value = map[string]int32{
		"ON":  0,
		"OFF": 1,
	}
)

Enum value maps for AlarmStatus.

View Source
var (
	AlarmLevel_name = map[int32]string{
		0: "WARNING",
		1: "EMERGENCY",
		2: "FAILURE",
	}
	AlarmLevel_value = map[string]int32{
		"WARNING":   0,
		"EMERGENCY": 1,
		"FAILURE":   2,
	}
)

Enum value maps for AlarmLevel.

View Source
var DefaultCallOptions []grpc.CallOption
View Source
var DefaultDialOptions []grpc.DialOption
View Source
var DefaultServerOptions []grpc.ServerOption
View Source
var File_olympus_service_proto protoreflect.FileDescriptor
View Source
var Olympus_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "fort.olympus.Olympus",
	HandlerType: (*OlympusServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendAlarm",
			Handler:    _Olympus_SendAlarm_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Climate",
			Handler:       _Olympus_Climate_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "Tracking",
			Handler:       _Olympus_Tracking_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "olympus_service.proto",
}

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

Functions

func ConnectClimate

func ConnectClimate(
	ctx context.Context,
	address string,
	declaration *ClimateDeclaration,
	options ...ConnectionOption) <-chan ConnectionResult[*ClimateUpStream, *ClimateDownStream]

ConnectClimate asynchronously connect via an OlympusClient and starts a Climate stream on a given address, with the given declaration and options.

func ConnectTracking

func ConnectTracking(
	ctx context.Context,
	address string,
	declaration *TrackingDeclaration,
	options ...ConnectionOption) <-chan ConnectionResult[*TrackingUpStream, *TrackingDownStream]

ConnectTracking asynchronously connect via an OlympusClient and starts a Tracking stream on a given address, with the given declaration and options.

func RegisterOlympusServer

func RegisterOlympusServer(s grpc.ServiceRegistrar, srv OlympusServer)

func ServerLoop

func ServerLoop[Up, Down metadated](
	ctx context.Context,
	s ServerStream[Up, Down],
	handler HandleFunc[Up, Down]) error

func WithTelemetry

func WithTelemetry(ctx context.Context, serviceName string) context.Context

Types

type AlarmEvent

type AlarmEvent struct {
	Start time.Time  `json:"start,omitempty"`
	End   *time.Time `json:"end,omitempty"`
}

type AlarmLevel

type AlarmLevel int32
const (
	AlarmLevel_WARNING   AlarmLevel = 0
	AlarmLevel_EMERGENCY AlarmLevel = 1
	AlarmLevel_FAILURE   AlarmLevel = 2
)

func (AlarmLevel) Descriptor

func (AlarmLevel) Descriptor() protoreflect.EnumDescriptor

func (AlarmLevel) Enum

func (x AlarmLevel) Enum() *AlarmLevel

func (AlarmLevel) EnumDescriptor deprecated

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

Deprecated: Use AlarmLevel.Descriptor instead.

func (AlarmLevel) Number

func (x AlarmLevel) Number() protoreflect.EnumNumber

func (AlarmLevel) String

func (x AlarmLevel) String() string

func (AlarmLevel) Type

type AlarmReport

type AlarmReport struct {
	Identification string       `json:"identification,omitempty"`
	Level          AlarmLevel   `json:"level"`
	Events         []AlarmEvent `json:"events"`
	Description    string       `json:"description"`
}

func (*AlarmReport) On

func (r *AlarmReport) On() bool

type AlarmStatus

type AlarmStatus int32
const (
	AlarmStatus_ON  AlarmStatus = 0
	AlarmStatus_OFF AlarmStatus = 1
)

func (AlarmStatus) Descriptor

func (AlarmStatus) Enum

func (x AlarmStatus) Enum() *AlarmStatus

func (AlarmStatus) EnumDescriptor deprecated

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

Deprecated: Use AlarmStatus.Descriptor instead.

func (AlarmStatus) Number

func (x AlarmStatus) Number() protoreflect.EnumNumber

func (AlarmStatus) String

func (x AlarmStatus) String() string

func (AlarmStatus) Type

type AlarmUpdate

type AlarmUpdate struct {
	Identification string               `protobuf:"bytes,1,opt,name=identification,proto3" json:"identification,omitempty"`
	Level          AlarmLevel           `protobuf:"varint,2,opt,name=level,proto3,enum=fort.olympus.AlarmLevel" json:"level,omitempty"`
	Status         AlarmStatus          `protobuf:"varint,3,opt,name=status,proto3,enum=fort.olympus.AlarmStatus" json:"status,omitempty"`
	Time           *timestamp.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
	Description    string               `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*AlarmUpdate) Clone

func (a *AlarmUpdate) Clone() *AlarmUpdate

func (*AlarmUpdate) Descriptor deprecated

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

Deprecated: Use AlarmUpdate.ProtoReflect.Descriptor instead.

func (*AlarmUpdate) GetDescription

func (x *AlarmUpdate) GetDescription() string

func (*AlarmUpdate) GetIdentification

func (x *AlarmUpdate) GetIdentification() string

func (*AlarmUpdate) GetLevel

func (x *AlarmUpdate) GetLevel() AlarmLevel

func (*AlarmUpdate) GetStatus

func (x *AlarmUpdate) GetStatus() AlarmStatus

func (*AlarmUpdate) GetTime

func (x *AlarmUpdate) GetTime() *timestamp.Timestamp

func (*AlarmUpdate) ProtoMessage

func (*AlarmUpdate) ProtoMessage()

func (*AlarmUpdate) ProtoReflect

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

func (*AlarmUpdate) Reset

func (x *AlarmUpdate) Reset()

func (*AlarmUpdate) String

func (x *AlarmUpdate) String() string

type Bounds

type Bounds struct {
	Minimum *float32 `json:"minimum,omitempty"`
	Maximum *float32 `json:"maximum,omitempty"`
}

type ClientTask

type ClientTask[Up, Down metadated] struct {
	// contains filtered or unexported fields
}

A ClientTask is a task that can be used to manage a long-lived connection to an Olympus stream. It will attempt to reconnect automatically to the Olympus server via an OlympusClient. It will sends any connection attempt result on its ClientTask.Confirmations channel. ClientTask.Request and ClientTask.MayRequest can be called to perform an asynchronous request with this task. ClientTask.Run should be explicitely called to perform the task loop in the background.

func NewClimateTask

func NewClimateTask(
	ctx context.Context,
	address string,
	declaration *ClimateDeclaration,
	options ...ConnectionOption) *ClientTask[*ClimateUpStream, *ClimateDownStream]

NewClimateTask returns a ClientTask that connect and call an OlympusClient Climate stream.

func NewTrackingTask

func NewTrackingTask(
	ctx context.Context,
	address string,
	declaration *TrackingDeclaration,
	options ...ConnectionOption) *ClientTask[*TrackingUpStream, *TrackingDownStream]

NewTrackingTask returns a [ClimateTask] that connect and call an OlympusClient Tracking stream.

func (*ClientTask[Up, Down]) Confirmations

func (c *ClientTask[Up, Down]) Confirmations() <-chan ConfirmationResult[Down]

Confirmations returns all connection attempt result to the Olympus stream server.

func (*ClientTask[Up, Down]) Fatal

func (c *ClientTask[Up, Down]) Fatal(err error)

Fatal stops the ClientTask.Run loop with an error that will be propagated to the server. If err is nil, the task will be gracefully terminated instead, as if the task's provided context was cancelled.

func (*ClientTask[Up, Down]) MayRequest

func (c *ClientTask[Up, Down]) MayRequest(m Up) <-chan RequestResult[Down]

MayRequest performs an asynchronous request on the ClientTask, like ClientTask.Request, but discard immediatly the request if there is no active connection to the server.

func (*ClientTask[Up, Down]) Request

func (c *ClientTask[Up, Down]) Request(m Up) <-chan RequestResult[Down]

Request performs an asynchronous request on the ClientTask. If the underlying connection is not active yet, it will buffer the request until a connection is active or the buffer is filled up. In the later request are canceled in FIFO order.

func (*ClientTask[Up, Down]) Run

func (c *ClientTask[Up, Down]) Run() (err error)

Run runs the ClientTask communication loop until either ClientTask.Fatal is called or the provided context is canceled (graceful exit).

type ClimateDeclaration

type ClimateDeclaration struct {
	Host           string               `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Name           string               `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	MinTemperature *float32             `protobuf:"fixed32,3,opt,name=min_temperature,json=minTemperature,proto3,oneof" json:"min_temperature,omitempty"`
	MaxTemperature *float32             `protobuf:"fixed32,4,opt,name=max_temperature,json=maxTemperature,proto3,oneof" json:"max_temperature,omitempty"`
	MinHumidity    *float32             `protobuf:"fixed32,5,opt,name=min_humidity,json=minHumidity,proto3,oneof" json:"min_humidity,omitempty"`
	MaxHumidity    *float32             `protobuf:"fixed32,6,opt,name=max_humidity,json=maxHumidity,proto3,oneof" json:"max_humidity,omitempty"`
	Since          *timestamp.Timestamp `protobuf:"bytes,7,opt,name=since,proto3,oneof" json:"since,omitempty"`
	// contains filtered or unexported fields
}

func (*ClimateDeclaration) Descriptor deprecated

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

Deprecated: Use ClimateDeclaration.ProtoReflect.Descriptor instead.

func (*ClimateDeclaration) GetHost

func (x *ClimateDeclaration) GetHost() string

func (*ClimateDeclaration) GetMaxHumidity

func (x *ClimateDeclaration) GetMaxHumidity() float32

func (*ClimateDeclaration) GetMaxTemperature

func (x *ClimateDeclaration) GetMaxTemperature() float32

func (*ClimateDeclaration) GetMinHumidity

func (x *ClimateDeclaration) GetMinHumidity() float32

func (*ClimateDeclaration) GetMinTemperature

func (x *ClimateDeclaration) GetMinTemperature() float32

func (*ClimateDeclaration) GetName

func (x *ClimateDeclaration) GetName() string

func (*ClimateDeclaration) GetSince

func (x *ClimateDeclaration) GetSince() *timestamp.Timestamp

func (*ClimateDeclaration) ProtoMessage

func (*ClimateDeclaration) ProtoMessage()

func (*ClimateDeclaration) ProtoReflect

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

func (*ClimateDeclaration) Reset

func (x *ClimateDeclaration) Reset()

func (*ClimateDeclaration) String

func (x *ClimateDeclaration) String() string

type ClimateDownStream

type ClimateDownStream struct {
	RegistrationConfirmation *ClimateRegistrationConfirmation `` /* 133-byte string literal not displayed */
	Metadata                 map[string]string                `` /* 158-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ClimateDownStream) Descriptor deprecated

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

Deprecated: Use ClimateDownStream.ProtoReflect.Descriptor instead.

func (*ClimateDownStream) GetMetadata

func (x *ClimateDownStream) GetMetadata() map[string]string

func (*ClimateDownStream) GetRegistrationConfirmation

func (x *ClimateDownStream) GetRegistrationConfirmation() *ClimateRegistrationConfirmation

func (*ClimateDownStream) ProtoMessage

func (*ClimateDownStream) ProtoMessage()

func (*ClimateDownStream) ProtoReflect

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

func (*ClimateDownStream) Reset

func (x *ClimateDownStream) Reset()

func (*ClimateDownStream) String

func (x *ClimateDownStream) String() string

type ClimateRegistrationConfirmation

type ClimateRegistrationConfirmation struct {
	SendBacklogs bool  `protobuf:"varint,1,opt,name=send_backlogs,json=sendBacklogs,proto3" json:"send_backlogs,omitempty"`
	PageSize     int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*ClimateRegistrationConfirmation) Descriptor deprecated

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

Deprecated: Use ClimateRegistrationConfirmation.ProtoReflect.Descriptor instead.

func (*ClimateRegistrationConfirmation) GetPageSize

func (x *ClimateRegistrationConfirmation) GetPageSize() int32

func (*ClimateRegistrationConfirmation) GetSendBacklogs

func (x *ClimateRegistrationConfirmation) GetSendBacklogs() bool

func (*ClimateRegistrationConfirmation) ProtoMessage

func (*ClimateRegistrationConfirmation) ProtoMessage()

func (*ClimateRegistrationConfirmation) ProtoReflect

func (*ClimateRegistrationConfirmation) Reset

func (*ClimateRegistrationConfirmation) String

type ClimateReport

type ClimateReport struct {
	Temperatures []float32            `protobuf:"fixed32,2,rep,packed,name=temperatures,proto3" json:"temperatures,omitempty"`
	Humidity     *float32             `protobuf:"fixed32,3,opt,name=humidity,proto3,oneof" json:"humidity,omitempty"`
	Time         *timestamp.Timestamp `protobuf:"bytes,4,opt,name=time,proto3" json:"time,omitempty"`
	// contains filtered or unexported fields
}

func (*ClimateReport) Descriptor deprecated

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

Deprecated: Use ClimateReport.ProtoReflect.Descriptor instead.

func (*ClimateReport) GetHumidity

func (x *ClimateReport) GetHumidity() float32

func (*ClimateReport) GetTemperatures

func (x *ClimateReport) GetTemperatures() []float32

func (*ClimateReport) GetTime

func (x *ClimateReport) GetTime() *timestamp.Timestamp

func (*ClimateReport) ProtoMessage

func (*ClimateReport) ProtoMessage()

func (*ClimateReport) ProtoReflect

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

func (*ClimateReport) Reset

func (x *ClimateReport) Reset()

func (*ClimateReport) String

func (x *ClimateReport) String() string

type ClimateState

type ClimateState struct {
	Name         string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Temperature  *float32 `protobuf:"fixed32,2,opt,name=temperature,proto3,oneof" json:"temperature,omitempty"`
	Humidity     *float32 `protobuf:"fixed32,3,opt,name=humidity,proto3,oneof" json:"humidity,omitempty"`
	Wind         *float32 `protobuf:"fixed32,4,opt,name=wind,proto3,oneof" json:"wind,omitempty"`
	VisibleLight *float32 `protobuf:"fixed32,5,opt,name=visible_light,json=visibleLight,proto3,oneof" json:"visible_light,omitempty"`
	UvLight      *float32 `protobuf:"fixed32,6,opt,name=uv_light,json=uvLight,proto3,oneof" json:"uv_light,omitempty"`
	// contains filtered or unexported fields
}

func (*ClimateState) Clone

func (a *ClimateState) Clone() *ClimateState

func (*ClimateState) Descriptor deprecated

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

Deprecated: Use ClimateState.ProtoReflect.Descriptor instead.

func (*ClimateState) GetHumidity

func (x *ClimateState) GetHumidity() float32

func (*ClimateState) GetName

func (x *ClimateState) GetName() string

func (*ClimateState) GetTemperature

func (x *ClimateState) GetTemperature() float32

func (*ClimateState) GetUvLight

func (x *ClimateState) GetUvLight() float32

func (*ClimateState) GetVisibleLight

func (x *ClimateState) GetVisibleLight() float32

func (*ClimateState) GetWind

func (x *ClimateState) GetWind() float32

func (*ClimateState) ProtoMessage

func (*ClimateState) ProtoMessage()

func (*ClimateState) ProtoReflect

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

func (*ClimateState) Reset

func (x *ClimateState) Reset()

func (*ClimateState) String

func (x *ClimateState) String() string

type ClimateTarget

type ClimateTarget struct {
	Current    *ClimateState        `protobuf:"bytes,1,opt,name=current,proto3" json:"current,omitempty"`
	CurrentEnd *ClimateState        `protobuf:"bytes,2,opt,name=current_end,json=currentEnd,proto3,oneof" json:"current_end,omitempty"`
	Next       *ClimateState        `protobuf:"bytes,3,opt,name=next,proto3,oneof" json:"next,omitempty"`
	NextEnd    *ClimateState        `protobuf:"bytes,4,opt,name=next_end,json=nextEnd,proto3,oneof" json:"next_end,omitempty"`
	NextTime   *timestamp.Timestamp `protobuf:"bytes,5,opt,name=next_time,json=nextTime,proto3,oneof" json:"next_time,omitempty"`
	// contains filtered or unexported fields
}

func (*ClimateTarget) Descriptor deprecated

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

Deprecated: Use ClimateTarget.ProtoReflect.Descriptor instead.

func (*ClimateTarget) GetCurrent

func (x *ClimateTarget) GetCurrent() *ClimateState

func (*ClimateTarget) GetCurrentEnd

func (x *ClimateTarget) GetCurrentEnd() *ClimateState

func (*ClimateTarget) GetNext

func (x *ClimateTarget) GetNext() *ClimateState

func (*ClimateTarget) GetNextEnd

func (x *ClimateTarget) GetNextEnd() *ClimateState

func (*ClimateTarget) GetNextTime

func (x *ClimateTarget) GetNextTime() *timestamp.Timestamp

func (*ClimateTarget) ProtoMessage

func (*ClimateTarget) ProtoMessage()

func (*ClimateTarget) ProtoReflect

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

func (*ClimateTarget) Reset

func (x *ClimateTarget) Reset()

func (*ClimateTarget) String

func (x *ClimateTarget) String() string

type ClimateTimeSeries

type ClimateTimeSeries struct {
	Units          string        `json:"units,omitempty"`
	Reference      time.Time     `json:"reference,omitempty"`
	Humidity       PointSeries   `json:"humidity,omitempty"`
	Temperature    PointSeries   `json:"temperature,omitempty"`
	TemperatureAux []PointSeries `json:"temperatureAux,omitempty"`
}

type ClimateUpStream

type ClimateUpStream struct {
	Declaration *ClimateDeclaration `protobuf:"bytes,1,opt,name=declaration,proto3,oneof" json:"declaration,omitempty"`
	Reports     []*ClimateReport    `protobuf:"bytes,2,rep,name=reports,proto3" json:"reports,omitempty"`
	Target      *ClimateTarget      `protobuf:"bytes,3,opt,name=target,proto3,oneof" json:"target,omitempty"`
	Alarms      []*AlarmUpdate      `protobuf:"bytes,4,rep,name=alarms,proto3" json:"alarms,omitempty"`
	Backlog     bool                `protobuf:"varint,5,opt,name=backlog,proto3" json:"backlog,omitempty"`
	Metadata    map[string]string   `` /* 158-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ClimateUpStream) Descriptor deprecated

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

Deprecated: Use ClimateUpStream.ProtoReflect.Descriptor instead.

func (*ClimateUpStream) GetAlarms

func (x *ClimateUpStream) GetAlarms() []*AlarmUpdate

func (*ClimateUpStream) GetBacklog

func (x *ClimateUpStream) GetBacklog() bool

func (*ClimateUpStream) GetDeclaration

func (x *ClimateUpStream) GetDeclaration() *ClimateDeclaration

func (*ClimateUpStream) GetMetadata

func (x *ClimateUpStream) GetMetadata() map[string]string

func (*ClimateUpStream) GetReports

func (x *ClimateUpStream) GetReports() []*ClimateReport

func (*ClimateUpStream) GetTarget

func (x *ClimateUpStream) GetTarget() *ClimateTarget

func (*ClimateUpStream) ProtoMessage

func (*ClimateUpStream) ProtoMessage()

func (*ClimateUpStream) ProtoReflect

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

func (*ClimateUpStream) Reset

func (x *ClimateUpStream) Reset()

func (*ClimateUpStream) String

func (x *ClimateUpStream) String() string

type ConfirmationResult

type ConfirmationResult[Down any] struct {
	Confirmation Down
	Error        error
}

ConfirmationResult returns the result of a new connection to an OlympusClient through a ClientTask.

type Connection

type Connection[Up, Down metadated] struct {
	// contains filtered or unexported fields
}

A Connection represents a connection to a long-lived ping-pong stream provided by OlympusClient.

func (*Connection[Up, Down]) Close

func (c *Connection[Up, Down]) Close() (err error)

Close closes the connection, and report any connection error.

func (*Connection[Up, Down]) Confirmation

func (c *Connection[Up, Down]) Confirmation() Down

Comfirmation returns the message of the Olympus server received on declaration.

func (*Connection[Up, Down]) Established

func (c *Connection[Up, Down]) Established() bool

Established returns if the Connection is well established and can be used.

func (*Connection[Up, Down]) Send

func (c *Connection[Up, Down]) Send(m Up) (res Down, err error)

Send sends a message to the Olympus implementation and returns either its response or an error.

type ConnectionOption

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

A ConnectionOption represents an optional parameter to [Connect] or for a ClientTask.

func WithDialOptions

func WithDialOptions(opts ...grpc.DialOption) ConnectionOption

WithDialOptions adds the opts grpc.DialOption to the connection config.

type ConnectionResult

type ConnectionResult[Up, Down metadated] struct {
	Connection *Connection[Up, Down]
	Error      error
}

ConnectionResult holds the result of an attemp to create a connection to an olympus implementation through [Connect]. Either one of the two field will be populated.

type DiskStatus

type DiskStatus struct {
	TotalBytes     int64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`
	FreeBytes      int64 `protobuf:"varint,2,opt,name=free_bytes,json=freeBytes,proto3" json:"free_bytes,omitempty"`
	BytesPerSecond int64 `protobuf:"varint,3,opt,name=bytes_per_second,json=bytesPerSecond,proto3" json:"bytes_per_second,omitempty"`
	// contains filtered or unexported fields
}

func (*DiskStatus) Descriptor deprecated

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

Deprecated: Use DiskStatus.ProtoReflect.Descriptor instead.

func (*DiskStatus) GetBytesPerSecond

func (x *DiskStatus) GetBytesPerSecond() int64

func (*DiskStatus) GetFreeBytes

func (x *DiskStatus) GetFreeBytes() int64

func (*DiskStatus) GetTotalBytes

func (x *DiskStatus) GetTotalBytes() int64

func (*DiskStatus) ProtoMessage

func (*DiskStatus) ProtoMessage()

func (*DiskStatus) ProtoReflect

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

func (*DiskStatus) Reset

func (x *DiskStatus) Reset()

func (*DiskStatus) String

func (x *DiskStatus) String() string

type Error

type Error string

Error that could be returned within a RequestResult.

func (Error) Error

func (e Error) Error() string

Implements error interface.

type HandleFunc

type HandleFunc[Up, Down any] func(context.Context, Up) (Down, error)

type NotificationSettings

type NotificationSettings struct {
	NotifyOnWarning   bool     `json:"notifyOnWarning,omitempty"`
	NotifyNonGraceful bool     `json:"notifyNonGraceful,omitempty"`
	SubscribeToAll    bool     `json:"subscribeToAll,omitempty"`
	Subscriptions     []string `json:"subscriptions,omitempty"`
}

func (NotificationSettings) SubscribedTo

func (s NotificationSettings) SubscribedTo(zone string) bool

type NotificationSettingsUpdate

type NotificationSettingsUpdate struct {
	Endpoint string               `json:"endpoint,omitempty"`
	Settings NotificationSettings `json:"settings,omitempty"`
}

type OlympusClient

type OlympusClient interface {
	Climate(ctx context.Context, opts ...grpc.CallOption) (Olympus_ClimateClient, error)
	Tracking(ctx context.Context, opts ...grpc.CallOption) (Olympus_TrackingClient, error)
	SendAlarm(ctx context.Context, in *AlarmUpdate, opts ...grpc.CallOption) (*empty.Empty, error)
}

OlympusClient is the client API for Olympus 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 NewOlympusClient

func NewOlympusClient(cc grpc.ClientConnInterface) OlympusClient

type OlympusServer

type OlympusServer interface {
	Climate(Olympus_ClimateServer) error
	Tracking(Olympus_TrackingServer) error
	SendAlarm(context.Context, *AlarmUpdate) (*empty.Empty, error)
	// contains filtered or unexported methods
}

OlympusServer is the server API for Olympus service. All implementations must embed UnimplementedOlympusServer for forward compatibility

type Olympus_ClimateClient

type Olympus_ClimateClient interface {
	Send(*ClimateUpStream) error
	Recv() (*ClimateDownStream, error)
	grpc.ClientStream
}

type Olympus_ClimateServer

type Olympus_ClimateServer interface {
	Send(*ClimateDownStream) error
	Recv() (*ClimateUpStream, error)
	grpc.ServerStream
}

type Olympus_TrackingClient

type Olympus_TrackingClient interface {
	Send(*TrackingUpStream) error
	Recv() (*TrackingDownStream, error)
	grpc.ClientStream
}

type Olympus_TrackingServer

type Olympus_TrackingServer interface {
	Send(*TrackingDownStream) error
	Recv() (*TrackingUpStream, error)
	grpc.ServerStream
}

type Point

type Point lttb.Point[float32]

func (Point) MarshalJSON

func (p Point) MarshalJSON() ([]byte, error)

type PointSeries

type PointSeries []lttb.Point[float32]

func (PointSeries) MarshalJSON

func (series PointSeries) MarshalJSON() ([]byte, error)

type RequestResult

type RequestResult[Down any] struct {
	// The response message from the server
	Message Down

	// The potential error. Either a gRPC error, or an Error
	Error error
}

A RequestResult represents the result of a ClientTask.Request or ClientTask.MayRequest.

type ServerStream

type ServerStream[Up, Down metadated] interface {
	Recv() (Up, error)
	Send(Down) error
	Context() context.Context
}

type ServiceEvent

type ServiceEvent struct {
	Start    time.Time  `json:"start,omitempty"`
	End      *time.Time `json:"end,omitempty"`
	Graceful bool       `json:"graceful"`
}

type ServiceLog

type ServiceLog struct {
	Zone   string          `json:"zone,omitempty"`
	Events []*ServiceEvent `json:"events,omitempty"`
}

func (*ServiceLog) Clone

func (l *ServiceLog) Clone() *ServiceLog

func (*ServiceLog) On

func (l *ServiceLog) On() bool

func (*ServiceLog) SetOff

func (l *ServiceLog) SetOff(t time.Time, graceful bool)

func (*ServiceLog) SetOn

func (l *ServiceLog) SetOn(time time.Time)

type StreamInfo

type StreamInfo struct {
	ExperimentName string `json:"experiment_name,omitempty"`
	StreamURL      string `json:"stream_URL,omitempty"`
	ThumbnailURL   string `json:"thumbnail_URL,omitempty"`
}

type TrackingDeclaration

type TrackingDeclaration struct {
	Hostname       string               `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
	StreamServer   string               `protobuf:"bytes,2,opt,name=stream_server,json=streamServer,proto3" json:"stream_server,omitempty"`
	ExperimentName string               `protobuf:"bytes,3,opt,name=experiment_name,json=experimentName,proto3" json:"experiment_name,omitempty"`
	Since          *timestamp.Timestamp `protobuf:"bytes,4,opt,name=since,proto3,oneof" json:"since,omitempty"`
	// contains filtered or unexported fields
}

func (*TrackingDeclaration) Descriptor deprecated

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

Deprecated: Use TrackingDeclaration.ProtoReflect.Descriptor instead.

func (*TrackingDeclaration) GetExperimentName

func (x *TrackingDeclaration) GetExperimentName() string

func (*TrackingDeclaration) GetHostname

func (x *TrackingDeclaration) GetHostname() string

func (*TrackingDeclaration) GetSince

func (x *TrackingDeclaration) GetSince() *timestamp.Timestamp

func (*TrackingDeclaration) GetStreamServer

func (x *TrackingDeclaration) GetStreamServer() string

func (*TrackingDeclaration) ProtoMessage

func (*TrackingDeclaration) ProtoMessage()

func (*TrackingDeclaration) ProtoReflect

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

func (*TrackingDeclaration) Reset

func (x *TrackingDeclaration) Reset()

func (*TrackingDeclaration) String

func (x *TrackingDeclaration) String() string

type TrackingDownStream

type TrackingDownStream struct {
	Metadata map[string]string `` /* 158-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TrackingDownStream) Descriptor deprecated

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

Deprecated: Use TrackingDownStream.ProtoReflect.Descriptor instead.

func (*TrackingDownStream) GetMetadata

func (x *TrackingDownStream) GetMetadata() map[string]string

func (*TrackingDownStream) ProtoMessage

func (*TrackingDownStream) ProtoMessage()

func (*TrackingDownStream) ProtoReflect

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

func (*TrackingDownStream) Reset

func (x *TrackingDownStream) Reset()

func (*TrackingDownStream) String

func (x *TrackingDownStream) String() string

type TrackingInfo

type TrackingInfo struct {
	Since          time.Time   `json:"since,omitempty"`
	TotalBytes     int64       `json:"total_bytes,omitempty"`
	FreeBytes      int64       `json:"free_bytes,omitempty"`
	BytesPerSecond int64       `json:"bytes_per_second,omitempty"`
	Stream         *StreamInfo `json:"stream,omitempty"`
}

func (*TrackingInfo) Clone

func (i *TrackingInfo) Clone() *TrackingInfo

type TrackingUpStream

type TrackingUpStream struct {
	Declaration *TrackingDeclaration `protobuf:"bytes,1,opt,name=declaration,proto3,oneof" json:"declaration,omitempty"`
	Alarms      []*AlarmUpdate       `protobuf:"bytes,2,rep,name=alarms,proto3" json:"alarms,omitempty"`
	DiskStatus  *DiskStatus          `protobuf:"bytes,3,opt,name=disk_status,json=diskStatus,proto3,oneof" json:"disk_status,omitempty"`
	Metadata    map[string]string    `` /* 158-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TrackingUpStream) Descriptor deprecated

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

Deprecated: Use TrackingUpStream.ProtoReflect.Descriptor instead.

func (*TrackingUpStream) GetAlarms

func (x *TrackingUpStream) GetAlarms() []*AlarmUpdate

func (*TrackingUpStream) GetDeclaration

func (x *TrackingUpStream) GetDeclaration() *TrackingDeclaration

func (*TrackingUpStream) GetDiskStatus

func (x *TrackingUpStream) GetDiskStatus() *DiskStatus

func (*TrackingUpStream) GetMetadata

func (x *TrackingUpStream) GetMetadata() map[string]string

func (*TrackingUpStream) ProtoMessage

func (*TrackingUpStream) ProtoMessage()

func (*TrackingUpStream) ProtoReflect

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

func (*TrackingUpStream) Reset

func (x *TrackingUpStream) Reset()

func (*TrackingUpStream) String

func (x *TrackingUpStream) String() string

type UnimplementedOlympusServer

type UnimplementedOlympusServer struct {
}

UnimplementedOlympusServer must be embedded to have forward compatible implementations.

func (UnimplementedOlympusServer) Climate

func (UnimplementedOlympusServer) SendAlarm

func (UnimplementedOlympusServer) Tracking

type UnsafeOlympusServer

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

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

type ZoneClimateReport

type ZoneClimateReport struct {
	Since             time.Time     `json:"since,omitempty"`
	Temperature       *float32      `json:"temperature,omitempty"`
	Humidity          *float32      `json:"humidity,omitempty"`
	TemperatureBounds Bounds        `json:"temperature_bounds,omitempty"`
	HumidityBounds    Bounds        `json:"humidity_bounds,omitempty"`
	Current           *ClimateState `json:"current,omitempty,omitempty"`
	CurrentEnd        *ClimateState `json:"current_end,omitempty,omitempty"`
	Next              *ClimateState `json:"next,omitempty"`
	NextEnd           *ClimateState `json:"next_end,omitempty"`
	NextTime          *time.Time    `json:"next_time,omitempty"`
}

func (*ZoneClimateReport) Clone

func (*ZoneClimateReport) String added in v0.5.7

func (r *ZoneClimateReport) String() string

type ZoneReport

type ZoneReport struct {
	Host     string             `json:"host,omitempty"`
	Name     string             `json:"name,omitempty"`
	Climate  *ZoneClimateReport `json:"climate,omitempty"`
	Tracking *TrackingInfo      `json:"tracking,omitempty"`
	Alarms   []AlarmReport      `json:"alarms,omitempty"`
}

func (*ZoneReport) String added in v0.5.7

func (r *ZoneReport) String() string

type ZoneReportSummary

type ZoneReportSummary struct {
	Host              string             `json:"host,omitempty"`
	Name              string             `json:"name,omitempty"`
	Climate           *ZoneClimateReport `json:"climate,omitempty"`
	Tracking          *TrackingInfo      `json:"tracking,omitempty"`
	ActiveWarnings    int                `json:"active_warnings,omitempty"`
	ActiveEmergencies int                `json:"active_emergencies,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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