chassis

package
v0.0.0-...-e937963 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const ChassisControlPathPrefix = "/twirp/github.com.bsdlp.chassiscontrol.ChassisControl/"

ChassisControlPathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var (
	ChassisControlCommand_name = map[int32]string{
		0: "OFF",
		1: "ON",
		2: "CYCLE",
		3: "RESET",
		4: "DIAGNOSTIC_INTERRUPT",
		5: "SOFT_POWER_OFF",
	}
	ChassisControlCommand_value = map[string]int32{
		"OFF":                  0,
		"ON":                   1,
		"CYCLE":                2,
		"RESET":                3,
		"DIAGNOSTIC_INTERRUPT": 4,
		"SOFT_POWER_OFF":       5,
	}
)

Enum value maps for ChassisControlCommand.

View Source
var File_rpc_chassis_rpc_proto protoreflect.FileDescriptor

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type ChassisControl

type ChassisControl interface {
	GetChassisStatus(context.Context, *GetChassisStatusRequest) (*GetChassisStatusResponse, error)

	IssueChassisControlCommand(context.Context, *ChassisControlRequest) (*ChassisControlResponse, error)
}

func NewChassisControlJSONClient

func NewChassisControlJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ChassisControl

NewChassisControlJSONClient creates a JSON client that implements the ChassisControl interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewChassisControlProtobufClient

func NewChassisControlProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) ChassisControl

NewChassisControlProtobufClient creates a Protobuf client that implements the ChassisControl interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type ChassisControlCommand

type ChassisControlCommand int32
const (
	ChassisControlCommand_OFF                  ChassisControlCommand = 0
	ChassisControlCommand_ON                   ChassisControlCommand = 1
	ChassisControlCommand_CYCLE                ChassisControlCommand = 2
	ChassisControlCommand_RESET                ChassisControlCommand = 3
	ChassisControlCommand_DIAGNOSTIC_INTERRUPT ChassisControlCommand = 4
	ChassisControlCommand_SOFT_POWER_OFF       ChassisControlCommand = 5
)

func (ChassisControlCommand) Descriptor

func (ChassisControlCommand) Enum

func (ChassisControlCommand) EnumDescriptor deprecated

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

Deprecated: Use ChassisControlCommand.Descriptor instead.

func (ChassisControlCommand) Number

func (ChassisControlCommand) String

func (x ChassisControlCommand) String() string

func (ChassisControlCommand) Type

type ChassisControlRequest

type ChassisControlRequest struct {
	Target                string                `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
	ChassisControlCommand ChassisControlCommand `` /* 186-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ChassisControlRequest) Descriptor deprecated

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

Deprecated: Use ChassisControlRequest.ProtoReflect.Descriptor instead.

func (*ChassisControlRequest) GetChassisControlCommand

func (x *ChassisControlRequest) GetChassisControlCommand() ChassisControlCommand

func (*ChassisControlRequest) GetTarget

func (x *ChassisControlRequest) GetTarget() string

func (*ChassisControlRequest) ProtoMessage

func (*ChassisControlRequest) ProtoMessage()

func (*ChassisControlRequest) ProtoReflect

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

func (*ChassisControlRequest) Reset

func (x *ChassisControlRequest) Reset()

func (*ChassisControlRequest) String

func (x *ChassisControlRequest) String() string

type ChassisControlResponse

type ChassisControlResponse struct {
	Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
	Error  string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ChassisControlResponse) Descriptor deprecated

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

Deprecated: Use ChassisControlResponse.ProtoReflect.Descriptor instead.

func (*ChassisControlResponse) GetError

func (x *ChassisControlResponse) GetError() string

func (*ChassisControlResponse) GetTarget

func (x *ChassisControlResponse) GetTarget() string

func (*ChassisControlResponse) ProtoMessage

func (*ChassisControlResponse) ProtoMessage()

func (*ChassisControlResponse) ProtoReflect

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

func (*ChassisControlResponse) Reset

func (x *ChassisControlResponse) Reset()

func (*ChassisControlResponse) String

func (x *ChassisControlResponse) String() string

type GetChassisStatusRequest

type GetChassisStatusRequest struct {
	Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
	// contains filtered or unexported fields
}

func (*GetChassisStatusRequest) Descriptor deprecated

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

Deprecated: Use GetChassisStatusRequest.ProtoReflect.Descriptor instead.

func (*GetChassisStatusRequest) GetTarget

func (x *GetChassisStatusRequest) GetTarget() string

func (*GetChassisStatusRequest) ProtoMessage

func (*GetChassisStatusRequest) ProtoMessage()

func (*GetChassisStatusRequest) ProtoReflect

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

func (*GetChassisStatusRequest) Reset

func (x *GetChassisStatusRequest) Reset()

func (*GetChassisStatusRequest) String

func (x *GetChassisStatusRequest) String() string

type GetChassisStatusResponse

type GetChassisStatusResponse struct {
	Target                     string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
	PowerControlFault          bool   `protobuf:"varint,2,opt,name=power_control_fault,json=powerControlFault,proto3" json:"power_control_fault,omitempty"`
	PowerFault                 bool   `protobuf:"varint,3,opt,name=power_fault,json=powerFault,proto3" json:"power_fault,omitempty"`
	Interlock                  bool   `protobuf:"varint,4,opt,name=interlock,proto3" json:"interlock,omitempty"`
	PowerOverload              bool   `protobuf:"varint,5,opt,name=power_overload,json=powerOverload,proto3" json:"power_overload,omitempty"`
	PoweredOn                  bool   `protobuf:"varint,6,opt,name=powered_on,json=poweredOn,proto3" json:"powered_on,omitempty"`
	PoweredOnByIpmi            bool   `protobuf:"varint,7,opt,name=powered_on_by_ipmi,json=poweredOnByIpmi,proto3" json:"powered_on_by_ipmi,omitempty"`
	LastPowerDownFault         bool   `protobuf:"varint,8,opt,name=last_power_down_fault,json=lastPowerDownFault,proto3" json:"last_power_down_fault,omitempty"`
	LastPowerDownInterlock     bool   `` /* 132-byte string literal not displayed */
	LastPowerDownOverload      bool   `` /* 130-byte string literal not displayed */
	LastPowerDownSupplyFailure bool   `` /* 147-byte string literal not displayed */
	ResetButtonDisabled        bool   `protobuf:"varint,12,opt,name=reset_button_disabled,json=resetButtonDisabled,proto3" json:"reset_button_disabled,omitempty"`
	PowerOffButtonDisabled     bool   `` /* 133-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetChassisStatusResponse) Descriptor deprecated

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

Deprecated: Use GetChassisStatusResponse.ProtoReflect.Descriptor instead.

func (*GetChassisStatusResponse) GetInterlock

func (x *GetChassisStatusResponse) GetInterlock() bool

func (*GetChassisStatusResponse) GetLastPowerDownFault

func (x *GetChassisStatusResponse) GetLastPowerDownFault() bool

func (*GetChassisStatusResponse) GetLastPowerDownInterlock

func (x *GetChassisStatusResponse) GetLastPowerDownInterlock() bool

func (*GetChassisStatusResponse) GetLastPowerDownOverload

func (x *GetChassisStatusResponse) GetLastPowerDownOverload() bool

func (*GetChassisStatusResponse) GetLastPowerDownSupplyFailure

func (x *GetChassisStatusResponse) GetLastPowerDownSupplyFailure() bool

func (*GetChassisStatusResponse) GetPowerControlFault

func (x *GetChassisStatusResponse) GetPowerControlFault() bool

func (*GetChassisStatusResponse) GetPowerFault

func (x *GetChassisStatusResponse) GetPowerFault() bool

func (*GetChassisStatusResponse) GetPowerOffButtonDisabled

func (x *GetChassisStatusResponse) GetPowerOffButtonDisabled() bool

func (*GetChassisStatusResponse) GetPowerOverload

func (x *GetChassisStatusResponse) GetPowerOverload() bool

func (*GetChassisStatusResponse) GetPoweredOn

func (x *GetChassisStatusResponse) GetPoweredOn() bool

func (*GetChassisStatusResponse) GetPoweredOnByIpmi

func (x *GetChassisStatusResponse) GetPoweredOnByIpmi() bool

func (*GetChassisStatusResponse) GetResetButtonDisabled

func (x *GetChassisStatusResponse) GetResetButtonDisabled() bool

func (*GetChassisStatusResponse) GetTarget

func (x *GetChassisStatusResponse) GetTarget() string

func (*GetChassisStatusResponse) ProtoMessage

func (*GetChassisStatusResponse) ProtoMessage()

func (*GetChassisStatusResponse) ProtoReflect

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

func (*GetChassisStatusResponse) Reset

func (x *GetChassisStatusResponse) Reset()

func (*GetChassisStatusResponse) String

func (x *GetChassisStatusResponse) String() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type TwirpServer

type TwirpServer interface {
	http.Handler

	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)

	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string

	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route Twirp requests.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewChassisControlServer

func NewChassisControlServer(svc ChassisControl, opts ...interface{}) TwirpServer

NewChassisControlServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

Jump to

Keyboard shortcuts

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