towertalk

package module
v0.0.0-...-76feada Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const BADGECLASS_GAUGE = 0
View Source
const BADGECLASS_LABEL = 2
View Source
const BADGECLASS_LIGHT = 1
View Source
const BADGECLASS_NIL = -1
View Source
const VALUECLASS_INT = 0
View Source
const VALUECLASS_NIL = -1
View Source
const VALUECLASS_STR = 1

Variables

View Source
var File_extension_proto protoreflect.FileDescriptor
View Source
var Tower_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Tower",
	HandlerType: (*TowerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterExtension",
			Handler:    _Tower_RegisterExtension_Handler,
		},
		{
			MethodName: "RegisterState",
			Handler:    _Tower_RegisterState_Handler,
		},
		{
			MethodName: "PushValue",
			Handler:    _Tower_PushValue_Handler,
		},
		{
			MethodName: "PullValue",
			Handler:    _Tower_PullValue_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "extension.proto",
}

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

Functions

func RegisterTowerServer

func RegisterTowerServer(s grpc.ServiceRegistrar, srv TowerServer)

Types

type Badge

type Badge struct {
	Class int32 `json:"class"`
	Min   int32 `json:"min"`
	Max   int32 `json:"max"`
}

func NilBadge

func NilBadge() *Badge

type Error

type Error struct {
	Error   bool   `json:"error"`
	Message string `json:"message"`
}

type Extension

type Extension struct {
	Id          string            `json:"id"`
	Description string            `json:"description"`
	States      map[string]*State `json:"states"`
}

func NewExtension

func NewExtension(id string, description string) *Extension

type PullValueRequest

type PullValueRequest struct {

	// mapping
	ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
	StateId     string `protobuf:"bytes,2,opt,name=state_id,json=stateId,proto3" json:"state_id,omitempty"`
	// contains filtered or unexported fields
}

func (*PullValueRequest) Descriptor deprecated

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

Deprecated: Use PullValueRequest.ProtoReflect.Descriptor instead.

func (*PullValueRequest) GetExtensionId

func (x *PullValueRequest) GetExtensionId() string

func (*PullValueRequest) GetStateId

func (x *PullValueRequest) GetStateId() string

func (*PullValueRequest) ProtoMessage

func (*PullValueRequest) ProtoMessage()

func (*PullValueRequest) ProtoReflect

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

func (*PullValueRequest) Reset

func (x *PullValueRequest) Reset()

func (*PullValueRequest) String

func (x *PullValueRequest) String() string

type PullValueResponse

type PullValueResponse struct {

	// payload
	Class    int32  `protobuf:"varint,1,opt,name=class,proto3" json:"class,omitempty"`
	IntValue int32  `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3" json:"int_value,omitempty"`
	StrValue string `protobuf:"bytes,3,opt,name=str_value,json=strValue,proto3" json:"str_value,omitempty"`
	// contains filtered or unexported fields
}

func (*PullValueResponse) Descriptor deprecated

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

Deprecated: Use PullValueResponse.ProtoReflect.Descriptor instead.

func (*PullValueResponse) GetClass

func (x *PullValueResponse) GetClass() int32

func (*PullValueResponse) GetIntValue

func (x *PullValueResponse) GetIntValue() int32

func (*PullValueResponse) GetStrValue

func (x *PullValueResponse) GetStrValue() string

func (*PullValueResponse) ProtoMessage

func (*PullValueResponse) ProtoMessage()

func (*PullValueResponse) ProtoReflect

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

func (*PullValueResponse) Reset

func (x *PullValueResponse) Reset()

func (*PullValueResponse) String

func (x *PullValueResponse) String() string

type PushValueRequest

type PushValueRequest struct {

	// mapping
	ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
	StateId     string `protobuf:"bytes,2,opt,name=state_id,json=stateId,proto3" json:"state_id,omitempty"`
	// payload
	Class    int32  `protobuf:"varint,3,opt,name=class,proto3" json:"class,omitempty"`
	IntValue int32  `protobuf:"varint,4,opt,name=int_value,json=intValue,proto3" json:"int_value,omitempty"`
	StrValue string `protobuf:"bytes,5,opt,name=str_value,json=strValue,proto3" json:"str_value,omitempty"`
	// contains filtered or unexported fields
}

func (*PushValueRequest) Descriptor deprecated

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

Deprecated: Use PushValueRequest.ProtoReflect.Descriptor instead.

func (*PushValueRequest) GetClass

func (x *PushValueRequest) GetClass() int32

func (*PushValueRequest) GetExtensionId

func (x *PushValueRequest) GetExtensionId() string

func (*PushValueRequest) GetIntValue

func (x *PushValueRequest) GetIntValue() int32

func (*PushValueRequest) GetStateId

func (x *PushValueRequest) GetStateId() string

func (*PushValueRequest) GetStrValue

func (x *PushValueRequest) GetStrValue() string

func (*PushValueRequest) ProtoMessage

func (*PushValueRequest) ProtoMessage()

func (*PushValueRequest) ProtoReflect

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

func (*PushValueRequest) Reset

func (x *PushValueRequest) Reset()

func (*PushValueRequest) String

func (x *PushValueRequest) String() string

type PushValueResponse

type PushValueResponse struct {
	Error   bool   `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*PushValueResponse) Descriptor deprecated

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

Deprecated: Use PushValueResponse.ProtoReflect.Descriptor instead.

func (*PushValueResponse) GetError

func (x *PushValueResponse) GetError() bool

func (*PushValueResponse) GetMessage

func (x *PushValueResponse) GetMessage() string

func (*PushValueResponse) ProtoMessage

func (*PushValueResponse) ProtoMessage()

func (*PushValueResponse) ProtoReflect

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

func (*PushValueResponse) Reset

func (x *PushValueResponse) Reset()

func (*PushValueResponse) String

func (x *PushValueResponse) String() string

type RegisterExtensionRequest

type RegisterExtensionRequest struct {

	// mapping
	ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
	// payload
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterExtensionRequest) Descriptor deprecated

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

Deprecated: Use RegisterExtensionRequest.ProtoReflect.Descriptor instead.

func (*RegisterExtensionRequest) GetDescription

func (x *RegisterExtensionRequest) GetDescription() string

func (*RegisterExtensionRequest) GetExtensionId

func (x *RegisterExtensionRequest) GetExtensionId() string

func (*RegisterExtensionRequest) ProtoMessage

func (*RegisterExtensionRequest) ProtoMessage()

func (*RegisterExtensionRequest) ProtoReflect

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

func (*RegisterExtensionRequest) Reset

func (x *RegisterExtensionRequest) Reset()

func (*RegisterExtensionRequest) String

func (x *RegisterExtensionRequest) String() string

type RegisterExtensionResponse

type RegisterExtensionResponse struct {
	Error   bool   `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterExtensionResponse) Descriptor deprecated

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

Deprecated: Use RegisterExtensionResponse.ProtoReflect.Descriptor instead.

func (*RegisterExtensionResponse) GetError

func (x *RegisterExtensionResponse) GetError() bool

func (*RegisterExtensionResponse) GetMessage

func (x *RegisterExtensionResponse) GetMessage() string

func (*RegisterExtensionResponse) ProtoMessage

func (*RegisterExtensionResponse) ProtoMessage()

func (*RegisterExtensionResponse) ProtoReflect

func (*RegisterExtensionResponse) Reset

func (x *RegisterExtensionResponse) Reset()

func (*RegisterExtensionResponse) String

func (x *RegisterExtensionResponse) String() string

type RegisterStateRequest

type RegisterStateRequest struct {

	// mapping
	ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
	StateId     string `protobuf:"bytes,2,opt,name=state_id,json=stateId,proto3" json:"state_id,omitempty"`
	// payload
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Class       int32  `protobuf:"varint,4,opt,name=class,proto3" json:"class,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterStateRequest) Descriptor deprecated

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

Deprecated: Use RegisterStateRequest.ProtoReflect.Descriptor instead.

func (*RegisterStateRequest) GetClass

func (x *RegisterStateRequest) GetClass() int32

func (*RegisterStateRequest) GetDescription

func (x *RegisterStateRequest) GetDescription() string

func (*RegisterStateRequest) GetExtensionId

func (x *RegisterStateRequest) GetExtensionId() string

func (*RegisterStateRequest) GetStateId

func (x *RegisterStateRequest) GetStateId() string

func (*RegisterStateRequest) ProtoMessage

func (*RegisterStateRequest) ProtoMessage()

func (*RegisterStateRequest) ProtoReflect

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

func (*RegisterStateRequest) Reset

func (x *RegisterStateRequest) Reset()

func (*RegisterStateRequest) String

func (x *RegisterStateRequest) String() string

type RegisterStateResponse

type RegisterStateResponse struct {
	Error   bool   `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterStateResponse) Descriptor deprecated

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

Deprecated: Use RegisterStateResponse.ProtoReflect.Descriptor instead.

func (*RegisterStateResponse) GetError

func (x *RegisterStateResponse) GetError() bool

func (*RegisterStateResponse) GetMessage

func (x *RegisterStateResponse) GetMessage() string

func (*RegisterStateResponse) ProtoMessage

func (*RegisterStateResponse) ProtoMessage()

func (*RegisterStateResponse) ProtoReflect

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

func (*RegisterStateResponse) Reset

func (x *RegisterStateResponse) Reset()

func (*RegisterStateResponse) String

func (x *RegisterStateResponse) String() string

type Result

type Result struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Result) Descriptor deprecated

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

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetMessage

func (x *Result) GetMessage() string

func (*Result) GetSuccess

func (x *Result) GetSuccess() bool

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) ProtoReflect

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

func (*Result) Reset

func (x *Result) Reset()

func (*Result) String

func (x *Result) String() string

type State

type State struct {
	Id          string `json:"id"`
	Description string `json:"description"`
	Class       int32  `json:"class"`
	Value       *Value `json:"value"`
	Badge       *Badge `json:"badge"`
}

func NewState

func NewState(id string, description string, class int32) *State

type TowerClient

type TowerClient interface {
	RegisterExtension(ctx context.Context, in *RegisterExtensionRequest, opts ...grpc.CallOption) (*RegisterExtensionResponse, error)
	RegisterState(ctx context.Context, in *RegisterStateRequest, opts ...grpc.CallOption) (*RegisterStateResponse, error)
	PushValue(ctx context.Context, in *PushValueRequest, opts ...grpc.CallOption) (*PushValueResponse, error)
	PullValue(ctx context.Context, in *PullValueRequest, opts ...grpc.CallOption) (*PullValueResponse, error)
}

TowerClient is the client API for Tower 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 NewTowerClient

func NewTowerClient(cc grpc.ClientConnInterface) TowerClient

type TowerServer

type TowerServer interface {
	RegisterExtension(context.Context, *RegisterExtensionRequest) (*RegisterExtensionResponse, error)
	RegisterState(context.Context, *RegisterStateRequest) (*RegisterStateResponse, error)
	PushValue(context.Context, *PushValueRequest) (*PushValueResponse, error)
	PullValue(context.Context, *PullValueRequest) (*PullValueResponse, error)
	// contains filtered or unexported methods
}

TowerServer is the server API for Tower service. All implementations must embed UnimplementedTowerServer for forward compatibility

type UnimplementedTowerServer

type UnimplementedTowerServer struct {
}

UnimplementedTowerServer must be embedded to have forward compatible implementations.

func (UnimplementedTowerServer) PullValue

func (UnimplementedTowerServer) PushValue

func (UnimplementedTowerServer) RegisterState

type UnsafeTowerServer

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

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

type Value

type Value struct {
	Class    int32  `json:"class"`
	IntValue int32  `json:"int_value"`
	StrValue string `json:"str_value"`
}

func NilValue

func NilValue() *Value

func ValueFromInterface

func ValueFromInterface(value interface{}) (*Value, error)

Jump to

Keyboard shortcuts

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