Documentation
¶
Index ¶
- Variables
- func DoWith(controller string, x *DoRequest) error
- func RegisterBelugaServer(s *grpc.Server, srv BelugaServer)
- func ServerInit()
- type Apc
- type ApcConfig
- type ApcDevice
- type BelugaClient
- type BelugaServer
- type Config
- type Controller
- type DeviceConfig
- type DoRequest
- func (*DoRequest) Descriptor() ([]byte, []int)
- func (m *DoRequest) GetAction() DoRequest_Action
- func (m *DoRequest) GetDevice() string
- func (m *DoRequest) GetSoft() bool
- func (*DoRequest) ProtoMessage()
- func (m *DoRequest) Reset()
- func (m *DoRequest) String() string
- func (m *DoRequest) XXX_DiscardUnknown()
- func (m *DoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DoRequest) XXX_Merge(src proto.Message)
- func (m *DoRequest) XXX_Size() int
- func (m *DoRequest) XXX_Unmarshal(b []byte) error
- type DoRequest_Action
- type DoResponse
- func (*DoResponse) Descriptor() ([]byte, []int)
- func (*DoResponse) ProtoMessage()
- func (m *DoResponse) Reset()
- func (m *DoResponse) String() string
- func (m *DoResponse) XXX_DiscardUnknown()
- func (m *DoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DoResponse) XXX_Merge(src proto.Message)
- func (m *DoResponse) XXX_Size() int
- func (m *DoResponse) XXX_Unmarshal(b []byte) error
- type HealthRequest
- func (*HealthRequest) Descriptor() ([]byte, []int)
- func (*HealthRequest) ProtoMessage()
- func (m *HealthRequest) Reset()
- func (m *HealthRequest) String() string
- func (m *HealthRequest) XXX_DiscardUnknown()
- func (m *HealthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HealthRequest) XXX_Merge(src proto.Message)
- func (m *HealthRequest) XXX_Size() int
- func (m *HealthRequest) XXX_Unmarshal(b []byte) error
- type HealthResponse
- func (*HealthResponse) Descriptor() ([]byte, []int)
- func (*HealthResponse) ProtoMessage()
- func (m *HealthResponse) Reset()
- func (m *HealthResponse) String() string
- func (m *HealthResponse) XXX_DiscardUnknown()
- func (m *HealthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HealthResponse) XXX_Merge(src proto.Message)
- func (m *HealthResponse) XXX_Size() int
- func (m *HealthResponse) XXX_Unmarshal(b []byte) error
- type IPMI
- type IPMIAddr
- type IPMIConfig
- type ListItem
- func (*ListItem) Descriptor() ([]byte, []int)
- func (m *ListItem) GetController() string
- func (m *ListItem) GetDevice() string
- func (*ListItem) ProtoMessage()
- func (m *ListItem) Reset()
- func (m *ListItem) String() string
- func (m *ListItem) XXX_DiscardUnknown()
- func (m *ListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListItem) XXX_Merge(src proto.Message)
- func (m *ListItem) XXX_Size() int
- func (m *ListItem) XXX_Unmarshal(b []byte) error
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)
- func (*ListRequest) ProtoMessage()
- func (m *ListRequest) Reset()
- func (m *ListRequest) String() string
- func (m *ListRequest) XXX_DiscardUnknown()
- func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListRequest) XXX_Merge(src proto.Message)
- func (m *ListRequest) XXX_Size() int
- func (m *ListRequest) XXX_Unmarshal(b []byte) error
- type ListResponse
- func (*ListResponse) Descriptor() ([]byte, []int)
- func (m *ListResponse) GetDevices() []*ListItem
- func (*ListResponse) ProtoMessage()
- func (m *ListResponse) Reset()
- func (m *ListResponse) String() string
- func (m *ListResponse) XXX_DiscardUnknown()
- func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListResponse) XXX_Merge(src proto.Message)
- func (m *ListResponse) XXX_Size() int
- func (m *ListResponse) XXX_Unmarshal(b []byte) error
- type Minnow
- type MinnowAddr
- type MinnowConfig
- type Raven
- type RavenConfig
- type StatusRequest
- func (*StatusRequest) Descriptor() ([]byte, []int)
- func (m *StatusRequest) GetDevice() string
- func (*StatusRequest) ProtoMessage()
- func (m *StatusRequest) Reset()
- func (m *StatusRequest) String() string
- func (m *StatusRequest) XXX_DiscardUnknown()
- func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StatusRequest) XXX_Merge(src proto.Message)
- func (m *StatusRequest) XXX_Size() int
- func (m *StatusRequest) XXX_Unmarshal(b []byte) error
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)
- func (m *StatusResponse) GetState() StatusResponse_State
- func (*StatusResponse) ProtoMessage()
- func (m *StatusResponse) Reset()
- func (m *StatusResponse) String() string
- func (m *StatusResponse) XXX_DiscardUnknown()
- func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StatusResponse) XXX_Merge(src proto.Message)
- func (m *StatusResponse) XXX_Size() int
- func (m *StatusResponse) XXX_Unmarshal(b []byte) error
- type StatusResponse_State
- type UnimplementedBelugaServer
- func (*UnimplementedBelugaServer) Do(ctx context.Context, req *DoRequest) (*DoResponse, error)
- func (*UnimplementedBelugaServer) Get(ctx context.Context, req *StatusRequest) (*StatusResponse, error)
- func (*UnimplementedBelugaServer) Health(ctx context.Context, req *HealthRequest) (*HealthResponse, error)
- func (*UnimplementedBelugaServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error)
Constants ¶
This section is empty.
Variables ¶
var DoRequest_Action_name = map[int32]string{
0: "Off",
1: "On",
2: "Cycle",
}
var DoRequest_Action_value = map[string]int32{
"Off": 0,
"On": 1,
"Cycle": 2,
}
var StatusResponse_State_name = map[int32]string{
0: "Unknown",
1: "Off",
2: "On",
}
var StatusResponse_State_value = map[string]int32{
"Unknown": 0,
"Off": 1,
"On": 2,
}
var Version = "undefined"
Functions ¶
func DoWith ¶
DoWith does the specified request with the provided controller name. The controller is looked up in the plugin table. If it is not found an error is returned. Otherwise the error condition of the underlying plugin is returned.
func RegisterBelugaServer ¶
func RegisterBelugaServer(s *grpc.Server, srv BelugaServer)
func ServerInit ¶
func ServerInit()
Types ¶
type Apc ¶
type Apc struct{}
func (*Apc) Get ¶
func (r *Apc) Get(x *StatusRequest) (StatusResponse_State, error)
type BelugaClient ¶
type BelugaClient interface { Do(ctx context.Context, in *DoRequest, opts ...grpc.CallOption) (*DoResponse, error) Get(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) }
BelugaClient is the client API for Beluga service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBelugaClient ¶
func NewBelugaClient(cc grpc.ClientConnInterface) BelugaClient
type BelugaServer ¶
type BelugaServer interface { Do(context.Context, *DoRequest) (*DoResponse, error) Get(context.Context, *StatusRequest) (*StatusResponse, error) List(context.Context, *ListRequest) (*ListResponse, error) Health(context.Context, *HealthRequest) (*HealthResponse, error) }
BelugaServer is the server API for Beluga service.
type Config ¶
type Config struct { Listen string Devices map[string]DeviceConfig Controllers map[string]interface{} }
type Controller ¶
type Controller interface { Init() Do(*DoRequest) error Get(*StatusRequest) (StatusResponse_State, error) }
type DeviceConfig ¶
type DeviceConfig struct {
Controller string
}
type DoRequest ¶
type DoRequest struct { Action DoRequest_Action `protobuf:"varint,1,opt,name=action,proto3,enum=beluga.DoRequest_Action" json:"action,omitempty"` Device string `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"` // //Soft power functions typically correspond to ACPI-like //functionality. While they are gentler on devices than raw power functions //they may not always succeed if a device is in a bricked state. This is a //modifier to the action. Soft bool `protobuf:"varint,3,opt,name=soft,proto3" json:"soft,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DoRequest) Descriptor ¶
func (*DoRequest) GetAction ¶
func (m *DoRequest) GetAction() DoRequest_Action
func (*DoRequest) ProtoMessage ¶
func (*DoRequest) ProtoMessage()
func (*DoRequest) XXX_DiscardUnknown ¶
func (m *DoRequest) XXX_DiscardUnknown()
func (*DoRequest) XXX_Marshal ¶
func (*DoRequest) XXX_Unmarshal ¶
type DoRequest_Action ¶
type DoRequest_Action int32
const ( DoRequest_Off DoRequest_Action = 0 DoRequest_On DoRequest_Action = 1 DoRequest_Cycle DoRequest_Action = 2 )
func (DoRequest_Action) EnumDescriptor ¶
func (DoRequest_Action) EnumDescriptor() ([]byte, []int)
func (DoRequest_Action) String ¶
func (x DoRequest_Action) String() string
type DoResponse ¶
type DoResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DoResponse) Descriptor ¶
func (*DoResponse) Descriptor() ([]byte, []int)
func (*DoResponse) ProtoMessage ¶
func (*DoResponse) ProtoMessage()
func (*DoResponse) Reset ¶
func (m *DoResponse) Reset()
func (*DoResponse) String ¶
func (m *DoResponse) String() string
func (*DoResponse) XXX_DiscardUnknown ¶
func (m *DoResponse) XXX_DiscardUnknown()
func (*DoResponse) XXX_Marshal ¶
func (m *DoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DoResponse) XXX_Merge ¶
func (m *DoResponse) XXX_Merge(src proto.Message)
func (*DoResponse) XXX_Size ¶
func (m *DoResponse) XXX_Size() int
func (*DoResponse) XXX_Unmarshal ¶
func (m *DoResponse) XXX_Unmarshal(b []byte) error
type HealthRequest ¶
type HealthRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HealthRequest) Descriptor ¶
func (*HealthRequest) Descriptor() ([]byte, []int)
func (*HealthRequest) ProtoMessage ¶
func (*HealthRequest) ProtoMessage()
func (*HealthRequest) Reset ¶
func (m *HealthRequest) Reset()
func (*HealthRequest) String ¶
func (m *HealthRequest) String() string
func (*HealthRequest) XXX_DiscardUnknown ¶
func (m *HealthRequest) XXX_DiscardUnknown()
func (*HealthRequest) XXX_Marshal ¶
func (m *HealthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HealthRequest) XXX_Merge ¶
func (m *HealthRequest) XXX_Merge(src proto.Message)
func (*HealthRequest) XXX_Size ¶
func (m *HealthRequest) XXX_Size() int
func (*HealthRequest) XXX_Unmarshal ¶
func (m *HealthRequest) XXX_Unmarshal(b []byte) error
type HealthResponse ¶
type HealthResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HealthResponse) Descriptor ¶
func (*HealthResponse) Descriptor() ([]byte, []int)
func (*HealthResponse) ProtoMessage ¶
func (*HealthResponse) ProtoMessage()
func (*HealthResponse) Reset ¶
func (m *HealthResponse) Reset()
func (*HealthResponse) String ¶
func (m *HealthResponse) String() string
func (*HealthResponse) XXX_DiscardUnknown ¶
func (m *HealthResponse) XXX_DiscardUnknown()
func (*HealthResponse) XXX_Marshal ¶
func (m *HealthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HealthResponse) XXX_Merge ¶
func (m *HealthResponse) XXX_Merge(src proto.Message)
func (*HealthResponse) XXX_Size ¶
func (m *HealthResponse) XXX_Size() int
func (*HealthResponse) XXX_Unmarshal ¶
func (m *HealthResponse) XXX_Unmarshal(b []byte) error
type IPMI ¶ added in v0.1.8
type IPMI struct { }
IPMI struct implementing the interface
func (*IPMI) Get ¶ added in v0.1.8
func (i *IPMI) Get(sr *StatusRequest) (StatusResponse_State, error)
Get implements the beluga set of Get requests
type IPMIConfig ¶ added in v0.1.8
IPMIConfig is a map of device name to settings
type ListItem ¶
type ListItem struct { Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ListItem) Descriptor ¶
func (*ListItem) GetController ¶
func (*ListItem) ProtoMessage ¶
func (*ListItem) ProtoMessage()
func (*ListItem) XXX_DiscardUnknown ¶
func (m *ListItem) XXX_DiscardUnknown()
func (*ListItem) XXX_Marshal ¶
func (*ListItem) XXX_Unmarshal ¶
type ListRequest ¶
type ListRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ListRequest) Descriptor ¶
func (*ListRequest) Descriptor() ([]byte, []int)
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) Reset ¶
func (m *ListRequest) Reset()
func (*ListRequest) String ¶
func (m *ListRequest) String() string
func (*ListRequest) XXX_DiscardUnknown ¶
func (m *ListRequest) XXX_DiscardUnknown()
func (*ListRequest) XXX_Marshal ¶
func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListRequest) XXX_Merge ¶
func (m *ListRequest) XXX_Merge(src proto.Message)
func (*ListRequest) XXX_Size ¶
func (m *ListRequest) XXX_Size() int
func (*ListRequest) XXX_Unmarshal ¶
func (m *ListRequest) XXX_Unmarshal(b []byte) error
type ListResponse ¶
type ListResponse struct { Devices []*ListItem `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ListResponse) Descriptor ¶
func (*ListResponse) Descriptor() ([]byte, []int)
func (*ListResponse) GetDevices ¶
func (m *ListResponse) GetDevices() []*ListItem
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) Reset ¶
func (m *ListResponse) Reset()
func (*ListResponse) String ¶
func (m *ListResponse) String() string
func (*ListResponse) XXX_DiscardUnknown ¶
func (m *ListResponse) XXX_DiscardUnknown()
func (*ListResponse) XXX_Marshal ¶
func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListResponse) XXX_Merge ¶
func (m *ListResponse) XXX_Merge(src proto.Message)
func (*ListResponse) XXX_Size ¶
func (m *ListResponse) XXX_Size() int
func (*ListResponse) XXX_Unmarshal ¶
func (m *ListResponse) XXX_Unmarshal(b []byte) error
type Minnow ¶
type Minnow struct {
// contains filtered or unexported fields
}
func (*Minnow) Get ¶
func (m *Minnow) Get(x *StatusRequest) (StatusResponse_State, error)
type MinnowAddr ¶
type MinnowConfig ¶
type MinnowConfig struct {
Devices map[string]MinnowAddr
}
type Raven ¶
type Raven struct{}
func (*Raven) Get ¶
func (r *Raven) Get(x *StatusRequest) (StatusResponse_State, error)
type RavenConfig ¶
type RavenConfig struct {
Topodir string
}
type StatusRequest ¶
type StatusRequest struct { Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StatusRequest) Descriptor ¶
func (*StatusRequest) Descriptor() ([]byte, []int)
func (*StatusRequest) GetDevice ¶
func (m *StatusRequest) GetDevice() string
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) Reset ¶
func (m *StatusRequest) Reset()
func (*StatusRequest) String ¶
func (m *StatusRequest) String() string
func (*StatusRequest) XXX_DiscardUnknown ¶
func (m *StatusRequest) XXX_DiscardUnknown()
func (*StatusRequest) XXX_Marshal ¶
func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StatusRequest) XXX_Merge ¶
func (m *StatusRequest) XXX_Merge(src proto.Message)
func (*StatusRequest) XXX_Size ¶
func (m *StatusRequest) XXX_Size() int
func (*StatusRequest) XXX_Unmarshal ¶
func (m *StatusRequest) XXX_Unmarshal(b []byte) error
type StatusResponse ¶
type StatusResponse struct { State StatusResponse_State `protobuf:"varint,1,opt,name=state,proto3,enum=beluga.StatusResponse_State" json:"state,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StatusResponse) Descriptor ¶
func (*StatusResponse) Descriptor() ([]byte, []int)
func (*StatusResponse) GetState ¶
func (m *StatusResponse) GetState() StatusResponse_State
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) Reset ¶
func (m *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (m *StatusResponse) String() string
func (*StatusResponse) XXX_DiscardUnknown ¶
func (m *StatusResponse) XXX_DiscardUnknown()
func (*StatusResponse) XXX_Marshal ¶
func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StatusResponse) XXX_Merge ¶
func (m *StatusResponse) XXX_Merge(src proto.Message)
func (*StatusResponse) XXX_Size ¶
func (m *StatusResponse) XXX_Size() int
func (*StatusResponse) XXX_Unmarshal ¶
func (m *StatusResponse) XXX_Unmarshal(b []byte) error
type StatusResponse_State ¶
type StatusResponse_State int32
const ( StatusResponse_Unknown StatusResponse_State = 0 StatusResponse_Off StatusResponse_State = 1 StatusResponse_On StatusResponse_State = 2 )
func GetFrom ¶
func GetFrom(controller string, x *StatusRequest) (StatusResponse_State, error)
func (StatusResponse_State) EnumDescriptor ¶
func (StatusResponse_State) EnumDescriptor() ([]byte, []int)
func (StatusResponse_State) String ¶
func (x StatusResponse_State) String() string
type UnimplementedBelugaServer ¶ added in v0.1.11
type UnimplementedBelugaServer struct { }
UnimplementedBelugaServer can be embedded to have forward compatible implementations.
func (*UnimplementedBelugaServer) Do ¶ added in v0.1.11
func (*UnimplementedBelugaServer) Do(ctx context.Context, req *DoRequest) (*DoResponse, error)
func (*UnimplementedBelugaServer) Get ¶ added in v0.1.11
func (*UnimplementedBelugaServer) Get(ctx context.Context, req *StatusRequest) (*StatusResponse, error)
func (*UnimplementedBelugaServer) Health ¶ added in v0.1.11
func (*UnimplementedBelugaServer) Health(ctx context.Context, req *HealthRequest) (*HealthResponse, error)
func (*UnimplementedBelugaServer) List ¶ added in v0.1.11
func (*UnimplementedBelugaServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error)