Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterBotServer(s grpc.ServiceRegistrar, srv BotServer)
- type BotBody
- type BotClient
- type BotHeader
- func (*BotHeader) Descriptor() ([]byte, []int)deprecated
- func (x *BotHeader) GetArgs() []string
- func (x *BotHeader) GetEnv() map[string]string
- func (x *BotHeader) GetHash() []byte
- func (x *BotHeader) GetSize() uint32
- func (*BotHeader) ProtoMessage()
- func (x *BotHeader) ProtoReflect() protoreflect.Message
- func (x *BotHeader) Reset()
- func (x *BotHeader) String() string
- type BotIn
- type BotIn_Hash
- type BotIn_Stdin
- type BotOut
- func (*BotOut) Descriptor() ([]byte, []int)deprecated
- func (x *BotOut) GetExit() string
- func (x *BotOut) GetKeepAlive() *BotOut
- func (x *BotOut) GetKeypairPubkey() []byte
- func (x *BotOut) GetOut() isBotOut_Out
- func (x *BotOut) GetStatus() *StatusTime
- func (x *BotOut) GetStderr() []byte
- func (x *BotOut) GetStdout() []byte
- func (*BotOut) ProtoMessage()
- func (x *BotOut) ProtoReflect() protoreflect.Message
- func (x *BotOut) Reset()
- func (x *BotOut) String() string
- type BotOut_Exit
- type BotOut_KeepAlive
- type BotOut_KeypairPubkey
- type BotOut_Status
- type BotOut_Stderr
- type BotOut_Stdout
- type BotServer
- type BotStatus
- type BotUploadRequest
- func (*BotUploadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BotUploadRequest) GetBody() *BotBody
- func (x *BotUploadRequest) GetHeader() *BotHeader
- func (x *BotUploadRequest) GetPayload() isBotUploadRequest_Payload
- func (*BotUploadRequest) ProtoMessage()
- func (x *BotUploadRequest) ProtoReflect() protoreflect.Message
- func (x *BotUploadRequest) Reset()
- func (x *BotUploadRequest) String() string
- type BotUploadRequest_Body
- type BotUploadRequest_Header
- type BotUploadResponse
- func (*BotUploadResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BotUploadResponse) GetOut() *BotOut
- func (x *BotUploadResponse) GetResponse() isBotUploadResponse_Response
- func (x *BotUploadResponse) GetResult() *BotStatus
- func (*BotUploadResponse) ProtoMessage()
- func (x *BotUploadResponse) ProtoReflect() protoreflect.Message
- func (x *BotUploadResponse) Reset()
- func (x *BotUploadResponse) String() string
- type BotUploadResponse_Out
- type BotUploadResponse_Result
- type Bot_RunClient
- type Bot_RunServer
- type Bot_UploadClient
- type Bot_UploadServer
- type Empty
- type Status
- type StatusResponse
- type StatusTime
- type UnimplementedBotServer
- type UnsafeBotServer
Constants ¶
const ( Bot_Upload_FullMethodName = "/bot.Bot/Upload" Bot_GetStatus_FullMethodName = "/bot.Bot/GetStatus" Bot_Run_FullMethodName = "/bot.Bot/Run" )
Variables ¶
var ( Status_name = map[int32]string{ 0: "Compiling", 1: "Frozen", 2: "Running", } Status_value = map[string]int32{ "Compiling": 0, "Frozen": 1, "Running": 2, } )
Enum value maps for Status.
var Bot_ServiceDesc = grpc.ServiceDesc{ ServiceName: "bot.Bot", HandlerType: (*BotServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetStatus", Handler: _Bot_GetStatus_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Upload", Handler: _Bot_Upload_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Run", Handler: _Bot_Run_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "bot.proto", }
Bot_ServiceDesc is the grpc.ServiceDesc for Bot service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_bot_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBotServer ¶
func RegisterBotServer(s grpc.ServiceRegistrar, srv BotServer)
Types ¶
type BotBody ¶
type BotBody struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*BotBody) Descriptor
deprecated
func (*BotBody) ProtoMessage ¶
func (*BotBody) ProtoMessage()
func (*BotBody) ProtoReflect ¶
func (x *BotBody) ProtoReflect() protoreflect.Message
type BotClient ¶
type BotClient interface {
// Upload a bot. If more than N bots exist, the oldest one will be overwritten and deleted.
Upload(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[BotUploadRequest, BotUploadResponse], error)
// Get a list of currently uploaded bots. There is a limit of N.
GetStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*StatusResponse, error)
// The bot must have already been uploaded. The Bot is frozen upon disconnect.
Run(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[BotIn, BotOut], error)
}
BotClient is the client API for Bot 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 NewBotClient ¶
func NewBotClient(cc grpc.ClientConnInterface) BotClient
type BotHeader ¶
type BotHeader struct {
// this is a sha256 sum of the wasm body.
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
// make the size as 0 when there is no bot being stored in the validator.
Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
Env map[string]string `` /* 133-byte string literal not displayed */
Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"`
// contains filtered or unexported fields
}
func (*BotHeader) Descriptor
deprecated
func (*BotHeader) ProtoMessage ¶
func (*BotHeader) ProtoMessage()
func (*BotHeader) ProtoReflect ¶
func (x *BotHeader) ProtoReflect() protoreflect.Message
type BotIn ¶
type BotIn struct {
// Types that are valid to be assigned to In:
//
// *BotIn_Hash
// *BotIn_Stdin
In isBotIn_In `protobuf_oneof:"in"`
// contains filtered or unexported fields
}
func (*BotIn) Descriptor
deprecated
func (*BotIn) ProtoMessage ¶
func (*BotIn) ProtoMessage()
func (*BotIn) ProtoReflect ¶
func (x *BotIn) ProtoReflect() protoreflect.Message
type BotIn_Hash ¶
type BotIn_Hash struct {
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3,oneof"`
}
type BotIn_Stdin ¶
type BotIn_Stdin struct {
Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3,oneof"`
}
type BotOut ¶
type BotOut struct {
// Types that are valid to be assigned to Out:
//
// *BotOut_Stdout
// *BotOut_Stderr
// *BotOut_KeypairPubkey
// *BotOut_Exit
// *BotOut_Status
// *BotOut_KeepAlive
Out isBotOut_Out `protobuf_oneof:"out"`
// contains filtered or unexported fields
}
func (*BotOut) Descriptor
deprecated
func (*BotOut) GetKeepAlive ¶
func (*BotOut) GetKeypairPubkey ¶
func (*BotOut) GetStatus ¶
func (x *BotOut) GetStatus() *StatusTime
func (*BotOut) ProtoMessage ¶
func (*BotOut) ProtoMessage()
func (*BotOut) ProtoReflect ¶
func (x *BotOut) ProtoReflect() protoreflect.Message
type BotOut_Exit ¶
type BotOut_Exit struct {
Exit string `protobuf:"bytes,4,opt,name=exit,proto3,oneof"`
}
type BotOut_KeepAlive ¶
type BotOut_KeepAlive struct {
KeepAlive *BotOut `protobuf:"bytes,6,opt,name=keep_alive,json=keepAlive,proto3,oneof"`
}
type BotOut_KeypairPubkey ¶
type BotOut_KeypairPubkey struct {
// a private key with this public key has been generated by the wasm bot
KeypairPubkey []byte `protobuf:"bytes,3,opt,name=keypair_pubkey,json=keypairPubkey,proto3,oneof"`
}
type BotOut_Status ¶
type BotOut_Status struct {
Status *StatusTime `protobuf:"bytes,5,opt,name=status,proto3,oneof"`
}
type BotOut_Stderr ¶
type BotOut_Stderr struct {
Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3,oneof"`
}
type BotOut_Stdout ¶
type BotOut_Stdout struct {
Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3,oneof"`
}
type BotServer ¶
type BotServer interface {
// Upload a bot. If more than N bots exist, the oldest one will be overwritten and deleted.
Upload(grpc.BidiStreamingServer[BotUploadRequest, BotUploadResponse]) error
// Get a list of currently uploaded bots. There is a limit of N.
GetStatus(context.Context, *Empty) (*StatusResponse, error)
// The bot must have already been uploaded. The Bot is frozen upon disconnect.
Run(grpc.BidiStreamingServer[BotIn, BotOut]) error
// contains filtered or unexported methods
}
BotServer is the server API for Bot service. All implementations must embed UnimplementedBotServer for forward compatibility.
type BotStatus ¶
type BotStatus struct {
Header *BotHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
Status *StatusTime `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
// contains filtered or unexported fields
}
func (*BotStatus) Descriptor
deprecated
func (*BotStatus) GetStatus ¶
func (x *BotStatus) GetStatus() *StatusTime
func (*BotStatus) ProtoMessage ¶
func (*BotStatus) ProtoMessage()
func (*BotStatus) ProtoReflect ¶
func (x *BotStatus) ProtoReflect() protoreflect.Message
type BotUploadRequest ¶
type BotUploadRequest struct {
// Types that are valid to be assigned to Payload:
//
// *BotUploadRequest_Header
// *BotUploadRequest_Body
Payload isBotUploadRequest_Payload `protobuf_oneof:"payload"`
// contains filtered or unexported fields
}
func (*BotUploadRequest) Descriptor
deprecated
func (*BotUploadRequest) Descriptor() ([]byte, []int)
Deprecated: Use BotUploadRequest.ProtoReflect.Descriptor instead.
func (*BotUploadRequest) GetBody ¶
func (x *BotUploadRequest) GetBody() *BotBody
func (*BotUploadRequest) GetHeader ¶
func (x *BotUploadRequest) GetHeader() *BotHeader
func (*BotUploadRequest) GetPayload ¶
func (x *BotUploadRequest) GetPayload() isBotUploadRequest_Payload
func (*BotUploadRequest) ProtoMessage ¶
func (*BotUploadRequest) ProtoMessage()
func (*BotUploadRequest) ProtoReflect ¶
func (x *BotUploadRequest) ProtoReflect() protoreflect.Message
func (*BotUploadRequest) Reset ¶
func (x *BotUploadRequest) Reset()
func (*BotUploadRequest) String ¶
func (x *BotUploadRequest) String() string
type BotUploadRequest_Body ¶
type BotUploadRequest_Body struct {
Body *BotBody `protobuf:"bytes,2,opt,name=body,proto3,oneof"`
}
type BotUploadRequest_Header ¶
type BotUploadRequest_Header struct {
Header *BotHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}
type BotUploadResponse ¶
type BotUploadResponse struct {
// Types that are valid to be assigned to Response:
//
// *BotUploadResponse_Out
// *BotUploadResponse_Result
Response isBotUploadResponse_Response `protobuf_oneof:"response"`
// contains filtered or unexported fields
}
func (*BotUploadResponse) Descriptor
deprecated
func (*BotUploadResponse) Descriptor() ([]byte, []int)
Deprecated: Use BotUploadResponse.ProtoReflect.Descriptor instead.
func (*BotUploadResponse) GetOut ¶
func (x *BotUploadResponse) GetOut() *BotOut
func (*BotUploadResponse) GetResponse ¶
func (x *BotUploadResponse) GetResponse() isBotUploadResponse_Response
func (*BotUploadResponse) GetResult ¶
func (x *BotUploadResponse) GetResult() *BotStatus
func (*BotUploadResponse) ProtoMessage ¶
func (*BotUploadResponse) ProtoMessage()
func (*BotUploadResponse) ProtoReflect ¶
func (x *BotUploadResponse) ProtoReflect() protoreflect.Message
func (*BotUploadResponse) Reset ¶
func (x *BotUploadResponse) Reset()
func (*BotUploadResponse) String ¶
func (x *BotUploadResponse) String() string
type BotUploadResponse_Out ¶
type BotUploadResponse_Out struct {
Out *BotOut `protobuf:"bytes,1,opt,name=out,proto3,oneof"`
}
type BotUploadResponse_Result ¶
type BotUploadResponse_Result struct {
Result *BotStatus `protobuf:"bytes,2,opt,name=result,proto3,oneof"`
}
type Bot_RunClient ¶
type Bot_RunClient = grpc.BidiStreamingClient[BotIn, BotOut]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Bot_RunServer ¶
type Bot_RunServer = grpc.BidiStreamingServer[BotIn, BotOut]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Bot_UploadClient ¶
type Bot_UploadClient = grpc.BidiStreamingClient[BotUploadRequest, BotUploadResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Bot_UploadServer ¶
type Bot_UploadServer = grpc.BidiStreamingServer[BotUploadRequest, BotUploadResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StatusResponse ¶
type StatusResponse struct {
List []*BotStatus `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
// contains filtered or unexported fields
}
func (*StatusResponse) Descriptor
deprecated
func (*StatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) GetList ¶
func (x *StatusResponse) GetList() []*BotStatus
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) ProtoReflect ¶
func (x *StatusResponse) ProtoReflect() protoreflect.Message
func (*StatusResponse) Reset ¶
func (x *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (x *StatusResponse) String() string
type StatusTime ¶
type StatusTime struct {
Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=bot.Status" json:"status,omitempty"`
Time int64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
// contains filtered or unexported fields
}
func (*StatusTime) Descriptor
deprecated
func (*StatusTime) Descriptor() ([]byte, []int)
Deprecated: Use StatusTime.ProtoReflect.Descriptor instead.
func (*StatusTime) GetStatus ¶
func (x *StatusTime) GetStatus() Status
func (*StatusTime) GetTime ¶
func (x *StatusTime) GetTime() int64
func (*StatusTime) ProtoMessage ¶
func (*StatusTime) ProtoMessage()
func (*StatusTime) ProtoReflect ¶
func (x *StatusTime) ProtoReflect() protoreflect.Message
func (*StatusTime) Reset ¶
func (x *StatusTime) Reset()
func (*StatusTime) String ¶
func (x *StatusTime) String() string
type UnimplementedBotServer ¶
type UnimplementedBotServer struct{}
UnimplementedBotServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedBotServer) GetStatus ¶
func (UnimplementedBotServer) GetStatus(context.Context, *Empty) (*StatusResponse, error)
func (UnimplementedBotServer) Run ¶
func (UnimplementedBotServer) Run(grpc.BidiStreamingServer[BotIn, BotOut]) error
func (UnimplementedBotServer) Upload ¶
func (UnimplementedBotServer) Upload(grpc.BidiStreamingServer[BotUploadRequest, BotUploadResponse]) error
type UnsafeBotServer ¶
type UnsafeBotServer interface {
// contains filtered or unexported methods
}
UnsafeBotServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BotServer will result in compilation errors.