Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultPort is the port that the RPC server will listen on. DefaultPort uint16 = 44045 // DefaultTimeout is the time the server will spend waiting for a response from other threads. DefaultTimeout = time.Second )
Variables ¶
View Source
var ( // ErrTimeout is an error that is given if the RPC server isn't able to respond in time. ErrTimeout = errors.New("timed out waiting for internal response") )
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { // Command is a command that comes from an RPC client. Command proto.DaemonCommand // Context is a context used to cancel downstream events. It should be set with a timeout. Context context.Context // ResponseCh is a channel to send a response down. The response may simply be nil, indicating // success. An error sent down this channel will likely be sent to the client (i3x3ctl). ResponseCh chan<- error }
Message is a message container that provides the structure to have more of a request / response cycle. Once the message has been processed, a response can be issued by passing the result (an error, or nil) to the response channel.
func NewMessage ¶
NewMessage creates a new RPC message, and returns a channel that a response should be passed to.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the GRPC server used to listen to commands to control i3x3. At it's core, it is what propagates messages throughout the application.
func NewService ¶
NewService creates a new i3x3 RPC server.
func (*Service) HandleCommand ¶
func (s *Service) HandleCommand(ctx context.Context, cmd *proto.DaemonCommand) (*proto.DaemonCommandResponse, error)
HandleCommand routes a command through the application so that it may be handled appropriately by other
Click to show internal directories.
Click to hide internal directories.