beluga

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DoRequest_Action_name = map[int32]string{
	0: "Off",
	1: "On",
	2: "Cycle",
}
View Source
var DoRequest_Action_value = map[string]int32{
	"Off":   0,
	"On":    1,
	"Cycle": 2,
}
View Source
var StatusResponse_State_name = map[int32]string{
	0: "Unknown",
	1: "Off",
	2: "On",
}
View Source
var StatusResponse_State_value = map[string]int32{
	"Unknown": 0,
	"Off":     1,
	"On":      2,
}
View Source
var Version = "undefined"

Functions

func DoWith

func DoWith(controller string, x *DoRequest) error

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) Do

func (m *Apc) Do(x *DoRequest) error

func (*Apc) Get

func (*Apc) Init

func (a *Apc) Init()

type ApcConfig

type ApcConfig struct {
	Devices map[string]ApcDevice
}

type ApcDevice

type ApcDevice struct {
	Pdu     string
	Outlets []int `yaml:"outlets,flow"`
}

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

BelugaServer is the server API for Beluga service.

type Config

type Config struct {
	Listen      string
	Devices     map[string]DeviceConfig
	Controllers map[string]interface{}
}

func GetConfig

func GetConfig() Config

Retrieve the beluga runtime configuration

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) Descriptor() ([]byte, []int)

func (*DoRequest) GetAction

func (m *DoRequest) GetAction() DoRequest_Action

func (*DoRequest) GetDevice

func (m *DoRequest) GetDevice() string

func (*DoRequest) GetSoft added in v0.1.3

func (m *DoRequest) GetSoft() bool

func (*DoRequest) ProtoMessage

func (*DoRequest) ProtoMessage()

func (*DoRequest) Reset

func (m *DoRequest) Reset()

func (*DoRequest) String

func (m *DoRequest) String() string

func (*DoRequest) XXX_DiscardUnknown

func (m *DoRequest) XXX_DiscardUnknown()

func (*DoRequest) XXX_Marshal

func (m *DoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DoRequest) XXX_Merge

func (m *DoRequest) XXX_Merge(src proto.Message)

func (*DoRequest) XXX_Size

func (m *DoRequest) XXX_Size() int

func (*DoRequest) XXX_Unmarshal

func (m *DoRequest) XXX_Unmarshal(b []byte) error

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) Do added in v0.1.8

func (i *IPMI) Do(do *DoRequest) error

Do implements the beluga set of Do functionality

func (*IPMI) Get added in v0.1.8

Get implements the beluga set of Get requests

func (*IPMI) Init added in v0.1.8

func (i *IPMI) Init()

Init will parse the config and track IPMI devices

type IPMIAddr added in v0.1.8

type IPMIAddr struct {
	IP       string // can be hostname as well
	Username string
	Password string
}

IPMIAddr is how we address the IPMI address

type IPMIConfig added in v0.1.8

type IPMIConfig struct {
	Devices map[string]IPMIAddr
}

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) Descriptor() ([]byte, []int)

func (*ListItem) GetController

func (m *ListItem) GetController() string

func (*ListItem) GetDevice

func (m *ListItem) GetDevice() string

func (*ListItem) ProtoMessage

func (*ListItem) ProtoMessage()

func (*ListItem) Reset

func (m *ListItem) Reset()

func (*ListItem) String

func (m *ListItem) String() string

func (*ListItem) XXX_DiscardUnknown

func (m *ListItem) XXX_DiscardUnknown()

func (*ListItem) XXX_Marshal

func (m *ListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListItem) XXX_Merge

func (m *ListItem) XXX_Merge(src proto.Message)

func (*ListItem) XXX_Size

func (m *ListItem) XXX_Size() int

func (*ListItem) XXX_Unmarshal

func (m *ListItem) XXX_Unmarshal(b []byte) error

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) Do

func (m *Minnow) Do(x *DoRequest) error

func (*Minnow) Get

func (*Minnow) Init

func (m *Minnow) Init()

type MinnowAddr

type MinnowAddr struct {
	Chassis string
	Index   byte
}

type MinnowConfig

type MinnowConfig struct {
	Devices map[string]MinnowAddr
}

type Raven

type Raven struct{}

func (*Raven) Do

func (r *Raven) Do(x *DoRequest) error

func (*Raven) Get

func (*Raven) Init

func (r *Raven) Init()

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) Get added in v0.1.11

func (*UnimplementedBelugaServer) Health added in v0.1.11

func (*UnimplementedBelugaServer) List added in v0.1.11

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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