chiltrix

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

Project protocol buffers

To regenerate the .pb.go file, run this from the root of the project:

protoc -I=proto/chiltrix \
  --go_opt=paths=source_relative \
  --go_out=proto/chiltrix \
  --go-grpc_opt=paths=source_relative \
  --go-grpc_out=proto/chiltrix \
  proto/chiltrix/chiltrix.proto
protoc -I=proto/controller -I=.   --go_opt=paths=source_relative   --go_out=proto/controller --go-grpc_opt=paths=source_relative   --go-grpc_out=proto/controller   proto/controller/controller.proto
protoc -I=proto/command_queue   --go_opt=paths=source_relative   --go_out=proto/command_queue   --go-grpc_opt=paths=source_relative   --go-grpc_out=proto/command_queue   proto/command_queue/command_queue.proto

Prerequisites

sudo apt install protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_chiltrix_proto protoreflect.FileDescriptor
View Source
var Historian_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "chiltrix.Historian",
	HandlerType: (*HistorianServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "QueryStream",
			Handler:       _Historian_QueryStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "chiltrix.proto",
}

Historian_ServiceDesc is the grpc.ServiceDesc for Historian 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 ReadWriteService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "chiltrix.ReadWriteService",
	HandlerType: (*ReadWriteServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SetParameter",
			Handler:    _ReadWriteService_SetParameter_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "chiltrix.proto",
}

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

Functions

func RegisterHistorianServer

func RegisterHistorianServer(s grpc.ServiceRegistrar, srv HistorianServer)

func RegisterReadWriteServiceServer added in v0.0.3

func RegisterReadWriteServiceServer(s grpc.ServiceRegistrar, srv ReadWriteServiceServer)

Types

type HistorianClient

type HistorianClient interface {
	// Provides a value for each key request
	QueryStream(ctx context.Context, in *QueryStreamRequest, opts ...grpc.CallOption) (Historian_QueryStreamClient, error)
}

HistorianClient is the client API for Historian 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 NewHistorianClient

func NewHistorianClient(cc grpc.ClientConnInterface) HistorianClient

type HistorianServer

type HistorianServer interface {
	// Provides a value for each key request
	QueryStream(*QueryStreamRequest, Historian_QueryStreamServer) error
	// contains filtered or unexported methods
}

HistorianServer is the server API for Historian service. All implementations must embed UnimplementedHistorianServer for forward compatibility

type Historian_QueryStreamClient

type Historian_QueryStreamClient interface {
	Recv() (*QueryStreamResponse, error)
	grpc.ClientStream
}

type Historian_QueryStreamServer

type Historian_QueryStreamServer interface {
	Send(*QueryStreamResponse) error
	grpc.ServerStream
}

type QueryStreamRequest

type QueryStreamRequest struct {

	// start_time and end_time specify a time range to be queried. Either or both values
	// may be omitted.
	StartTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime   *timestamp.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	// contains filtered or unexported fields
}

QueryStreamRequest specifies a request for heatpump states.

func (*QueryStreamRequest) Descriptor deprecated

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

Deprecated: Use QueryStreamRequest.ProtoReflect.Descriptor instead.

func (*QueryStreamRequest) GetEndTime

func (x *QueryStreamRequest) GetEndTime() *timestamp.Timestamp

func (*QueryStreamRequest) GetStartTime

func (x *QueryStreamRequest) GetStartTime() *timestamp.Timestamp

func (*QueryStreamRequest) ProtoMessage

func (*QueryStreamRequest) ProtoMessage()

func (*QueryStreamRequest) ProtoReflect added in v0.0.3

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

func (*QueryStreamRequest) Reset

func (x *QueryStreamRequest) Reset()

func (*QueryStreamRequest) String

func (x *QueryStreamRequest) String() string

type QueryStreamResponse

type QueryStreamResponse struct {
	State *State `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

QueryStreamResponse is an element in the returned stream for the QueryStream RPC.

func (*QueryStreamResponse) Descriptor deprecated

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

Deprecated: Use QueryStreamResponse.ProtoReflect.Descriptor instead.

func (*QueryStreamResponse) GetState

func (x *QueryStreamResponse) GetState() *State

func (*QueryStreamResponse) ProtoMessage

func (*QueryStreamResponse) ProtoMessage()

func (*QueryStreamResponse) ProtoReflect added in v0.0.3

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

func (*QueryStreamResponse) Reset

func (x *QueryStreamResponse) Reset()

func (*QueryStreamResponse) String

func (x *QueryStreamResponse) String() string

type ReadWriteServiceClient added in v0.0.3

type ReadWriteServiceClient interface {
	// Change a parameter.
	SetParameter(ctx context.Context, in *SetParameterRequest, opts ...grpc.CallOption) (*SetParameterResponse, error)
}

ReadWriteServiceClient is the client API for ReadWriteService 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 NewReadWriteServiceClient added in v0.0.3

func NewReadWriteServiceClient(cc grpc.ClientConnInterface) ReadWriteServiceClient

type ReadWriteServiceServer added in v0.0.3

type ReadWriteServiceServer interface {
	// Change a parameter.
	SetParameter(context.Context, *SetParameterRequest) (*SetParameterResponse, error)
	// contains filtered or unexported methods
}

ReadWriteServiceServer is the server API for ReadWriteService service. All implementations must embed UnimplementedReadWriteServiceServer for forward compatibility

type RegisterSnapshot

type RegisterSnapshot struct {

	// The CX34 only supports holding registers, which are 16 bit values.
	// Protobuf only supports 32-bit values, otherwise we would use uint16.
	HoldingRegisterValues map[uint32]uint32 `` /* 216-byte string literal not displayed */
	// contains filtered or unexported fields
}

Snapshot holds the values of all of the heat pump modbus registers for archival purposes.

func (*RegisterSnapshot) Descriptor deprecated

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

Deprecated: Use RegisterSnapshot.ProtoReflect.Descriptor instead.

func (*RegisterSnapshot) GetHoldingRegisterValues

func (x *RegisterSnapshot) GetHoldingRegisterValues() map[uint32]uint32

func (*RegisterSnapshot) ProtoMessage

func (*RegisterSnapshot) ProtoMessage()

func (*RegisterSnapshot) ProtoReflect added in v0.0.3

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

func (*RegisterSnapshot) Reset

func (x *RegisterSnapshot) Reset()

func (*RegisterSnapshot) String

func (x *RegisterSnapshot) String() string

type RegisterValue added in v0.0.3

type RegisterValue struct {
	Register uint32 `protobuf:"varint,1,opt,name=register,proto3" json:"register,omitempty"`
	Value    uint32 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterValue) Descriptor deprecated added in v0.0.3

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

Deprecated: Use RegisterValue.ProtoReflect.Descriptor instead.

func (*RegisterValue) GetRegister added in v0.0.3

func (x *RegisterValue) GetRegister() uint32

func (*RegisterValue) GetValue added in v0.0.3

func (x *RegisterValue) GetValue() uint32

func (*RegisterValue) ProtoMessage added in v0.0.3

func (*RegisterValue) ProtoMessage()

func (*RegisterValue) ProtoReflect added in v0.0.3

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

func (*RegisterValue) Reset added in v0.0.3

func (x *RegisterValue) Reset()

func (*RegisterValue) String added in v0.0.3

func (x *RegisterValue) String() string

type SetParameterRequest added in v0.0.3

type SetParameterRequest struct {

	// If specifies, updates the target heating mode temperature.
	TargetHeatingModeTemperature *Temperature `` /* 149-byte string literal not displayed */
	// Any other register.
	RegisterValue *RegisterValue `protobuf:"bytes,2,opt,name=register_value,json=registerValue,proto3" json:"register_value,omitempty"`
	// contains filtered or unexported fields
}

func (*SetParameterRequest) Descriptor deprecated added in v0.0.3

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

Deprecated: Use SetParameterRequest.ProtoReflect.Descriptor instead.

func (*SetParameterRequest) GetRegisterValue added in v0.0.3

func (x *SetParameterRequest) GetRegisterValue() *RegisterValue

func (*SetParameterRequest) GetTargetHeatingModeTemperature added in v0.0.3

func (x *SetParameterRequest) GetTargetHeatingModeTemperature() *Temperature

func (*SetParameterRequest) ProtoMessage added in v0.0.3

func (*SetParameterRequest) ProtoMessage()

func (*SetParameterRequest) ProtoReflect added in v0.0.3

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

func (*SetParameterRequest) Reset added in v0.0.3

func (x *SetParameterRequest) Reset()

func (*SetParameterRequest) String added in v0.0.3

func (x *SetParameterRequest) String() string

type SetParameterResponse added in v0.0.3

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

func (*SetParameterResponse) Descriptor deprecated added in v0.0.3

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

Deprecated: Use SetParameterResponse.ProtoReflect.Descriptor instead.

func (*SetParameterResponse) ProtoMessage added in v0.0.3

func (*SetParameterResponse) ProtoMessage()

func (*SetParameterResponse) ProtoReflect added in v0.0.3

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

func (*SetParameterResponse) Reset added in v0.0.3

func (x *SetParameterResponse) Reset()

func (*SetParameterResponse) String added in v0.0.3

func (x *SetParameterResponse) String() string

type State

type State struct {

	// Collection time.
	CollectionTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=collection_time,json=collectionTime,proto3" json:"collection_time,omitempty"`
	// Modbus register values.
	RegisterValues *RegisterSnapshot `protobuf:"bytes,2,opt,name=register_values,json=registerValues,proto3" json:"register_values,omitempty"`
	// contains filtered or unexported fields
}

State captures the state of the heat pump at a given instant for archival purposes.

func (*State) Descriptor deprecated

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

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetCollectionTime

func (x *State) GetCollectionTime() *timestamp.Timestamp

func (*State) GetRegisterValues

func (x *State) GetRegisterValues() *RegisterSnapshot

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect added in v0.0.3

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

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type StateDiff

type StateDiff struct {

	// Collection time, always specified.
	CollectionTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=collection_time,json=collectionTime,proto3" json:"collection_time,omitempty"`
	// Modbus register values.
	UpdatedValues *RegisterSnapshot `protobuf:"bytes,2,opt,name=updated_values,json=updatedValues,proto3" json:"updated_values,omitempty"`
	// Registers that are not present in the new map.
	DeletedRegisters []uint32 `protobuf:"varint,3,rep,packed,name=deleted_registers,json=deletedRegisters,proto3" json:"deleted_registers,omitempty"`
	// contains filtered or unexported fields
}

StateDiff is a difference between two states.

func (*StateDiff) Descriptor deprecated

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

Deprecated: Use StateDiff.ProtoReflect.Descriptor instead.

func (*StateDiff) GetCollectionTime

func (x *StateDiff) GetCollectionTime() *timestamp.Timestamp

func (*StateDiff) GetDeletedRegisters

func (x *StateDiff) GetDeletedRegisters() []uint32

func (*StateDiff) GetUpdatedValues

func (x *StateDiff) GetUpdatedValues() *RegisterSnapshot

func (*StateDiff) ProtoMessage

func (*StateDiff) ProtoMessage()

func (*StateDiff) ProtoReflect added in v0.0.3

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

func (*StateDiff) Reset

func (x *StateDiff) Reset()

func (*StateDiff) String

func (x *StateDiff) String() string

type StateSequence

type StateSequence struct {

	// A series of StateDiff objects. The first object
	Diffs []*StateDiff `protobuf:"bytes,1,rep,name=diffs,proto3" json:"diffs,omitempty"`
	// contains filtered or unexported fields
}

StateSequence captures a series of state values. They are encoded differentially.

func (*StateSequence) Descriptor deprecated

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

Deprecated: Use StateSequence.ProtoReflect.Descriptor instead.

func (*StateSequence) GetDiffs

func (x *StateSequence) GetDiffs() []*StateDiff

func (*StateSequence) ProtoMessage

func (*StateSequence) ProtoMessage()

func (*StateSequence) ProtoReflect added in v0.0.3

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

func (*StateSequence) Reset

func (x *StateSequence) Reset()

func (*StateSequence) String

func (x *StateSequence) String() string

type Temperature added in v0.0.3

type Temperature struct {
	DegreesCelcius float64 `protobuf:"fixed64,1,opt,name=degrees_celcius,json=degreesCelcius,proto3" json:"degrees_celcius,omitempty"`
	// contains filtered or unexported fields
}

func (*Temperature) Descriptor deprecated added in v0.0.3

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

Deprecated: Use Temperature.ProtoReflect.Descriptor instead.

func (*Temperature) GetDegreesCelcius added in v0.0.3

func (x *Temperature) GetDegreesCelcius() float64

func (*Temperature) ProtoMessage added in v0.0.3

func (*Temperature) ProtoMessage()

func (*Temperature) ProtoReflect added in v0.0.3

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

func (*Temperature) Reset added in v0.0.3

func (x *Temperature) Reset()

func (*Temperature) String added in v0.0.3

func (x *Temperature) String() string

type UnimplementedHistorianServer

type UnimplementedHistorianServer struct {
}

UnimplementedHistorianServer must be embedded to have forward compatible implementations.

func (UnimplementedHistorianServer) QueryStream

type UnimplementedReadWriteServiceServer added in v0.0.3

type UnimplementedReadWriteServiceServer struct {
}

UnimplementedReadWriteServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedReadWriteServiceServer) SetParameter added in v0.0.3

type UnsafeHistorianServer

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

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

type UnsafeReadWriteServiceServer added in v0.0.3

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

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

Jump to

Keyboard shortcuts

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