Documentation
¶
Overview ¶
Package starlingfoundries_operator_server is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v5.8.0.
It is generated from these files:
rpc/server/service.proto
Index ¶
- Constants
- Variables
- func WriteError(resp http.ResponseWriter, err error)
- type ByteArray
- func (*ByteArray) Descriptor() ([]byte, []int)
- func (m *ByteArray) GetData() []byte
- func (*ByteArray) ProtoMessage()
- func (m *ByteArray) Reset()
- func (m *ByteArray) String() string
- func (m *ByteArray) XXX_DiscardUnknown()
- func (m *ByteArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ByteArray) XXX_Merge(src proto.Message)
- func (m *ByteArray) XXX_Size() int
- func (m *ByteArray) XXX_Unmarshal(b []byte) error
- type CheckTransaction
- func (*CheckTransaction) Descriptor() ([]byte, []int)
- func (m *CheckTransaction) GetAmount() *ByteArray
- func (m *CheckTransaction) GetFee() *ByteArray
- func (m *CheckTransaction) GetNonce() uint64
- func (m *CheckTransaction) GetOperatorAddr() []byte
- func (m *CheckTransaction) GetSenderpubkey() *ByteArray
- func (m *CheckTransaction) GetSignature() *ByteArray
- func (m *CheckTransaction) GetToaddr() []byte
- func (m *CheckTransaction) GetVersion() uint32
- func (*CheckTransaction) ProtoMessage()
- func (m *CheckTransaction) Reset()
- func (m *CheckTransaction) String() string
- func (m *CheckTransaction) XXX_DiscardUnknown()
- func (m *CheckTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CheckTransaction) XXX_Merge(src proto.Message)
- func (m *CheckTransaction) XXX_Size() int
- func (m *CheckTransaction) XXX_Unmarshal(b []byte) error
- type Client
- func (*Client) Descriptor() ([]byte, []int)
- func (m *Client) GetKey() *ByteArray
- func (*Client) ProtoMessage()
- func (m *Client) Reset()
- func (m *Client) String() string
- func (m *Client) XXX_DiscardUnknown()
- func (m *Client) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Client) XXX_Merge(src proto.Message)
- func (m *Client) XXX_Size() int
- func (m *Client) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (m *Empty) GetPubkey() *ByteArray
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type FeeResp
- func (*FeeResp) Descriptor() ([]byte, []int)
- func (m *FeeResp) GetFee() *ByteArray
- func (*FeeResp) ProtoMessage()
- func (m *FeeResp) Reset()
- func (m *FeeResp) String() string
- func (m *FeeResp) XXX_DiscardUnknown()
- func (m *FeeResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FeeResp) XXX_Merge(src proto.Message)
- func (m *FeeResp) XXX_Size() int
- func (m *FeeResp) XXX_Unmarshal(b []byte) error
- type HTTPClient
- type Operator
- type OperatorTargetResp
- func (*OperatorTargetResp) Descriptor() ([]byte, []int)
- func (m *OperatorTargetResp) GetContractAddr() []byte
- func (*OperatorTargetResp) ProtoMessage()
- func (m *OperatorTargetResp) Reset()
- func (m *OperatorTargetResp) String() string
- func (m *OperatorTargetResp) XXX_DiscardUnknown()
- func (m *OperatorTargetResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *OperatorTargetResp) XXX_Merge(src proto.Message)
- func (m *OperatorTargetResp) XXX_Size() int
- func (m *OperatorTargetResp) XXX_Unmarshal(b []byte) error
- type QueueID
- func (*QueueID) Descriptor() ([]byte, []int)
- func (m *QueueID) GetQueueID() uint32
- func (*QueueID) ProtoMessage()
- func (m *QueueID) Reset()
- func (m *QueueID) String() string
- func (m *QueueID) XXX_DiscardUnknown()
- func (m *QueueID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueueID) XXX_Merge(src proto.Message)
- func (m *QueueID) XXX_Size() int
- func (m *QueueID) XXX_Unmarshal(b []byte) error
- type StatusResp
- func (*StatusResp) Descriptor() ([]byte, []int)
- func (m *StatusResp) GetNonce() uint64
- func (m *StatusResp) GetSenderPkey() *ByteArray
- func (m *StatusResp) GetStatus() StatusResp_Status
- func (m *StatusResp) GetTranid() []byte
- func (*StatusResp) ProtoMessage()
- func (m *StatusResp) Reset()
- func (m *StatusResp) String() string
- func (m *StatusResp) XXX_DiscardUnknown()
- func (m *StatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StatusResp) XXX_Merge(src proto.Message)
- func (m *StatusResp) XXX_Size() int
- func (m *StatusResp) XXX_Unmarshal(b []byte) error
- type StatusResp_Status
- type TwirpServer
Constants ¶
const OperatorPathPrefix = "/twirp/starlingfoundries.operator.server.Operator/"
OperatorPathPrefix is used for all URL paths on a twirp Operator server. Requests are always: POST OperatorPathPrefix/method It can be used in an HTTP mux to route twirp requests along with non-twirp requests on other routes.
Variables ¶
var StatusResp_Status_name = map[int32]string{
0: "UNDEFINED",
1: "RECIEVED",
2: "PROCESSED",
3: "REJECTED",
}
var StatusResp_Status_value = map[string]int32{
"UNDEFINED": 0,
"RECIEVED": 1,
"PROCESSED": 2,
"REJECTED": 3,
}
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 ByteArray ¶
type ByteArray struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ByteArray) Descriptor ¶
func (*ByteArray) ProtoMessage ¶
func (*ByteArray) ProtoMessage()
func (*ByteArray) XXX_DiscardUnknown ¶
func (m *ByteArray) XXX_DiscardUnknown()
func (*ByteArray) XXX_Marshal ¶
func (*ByteArray) XXX_Unmarshal ¶
type CheckTransaction ¶
type CheckTransaction struct { Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` Senderpubkey *ByteArray `protobuf:"bytes,2,opt,name=senderpubkey,proto3" json:"senderpubkey,omitempty"` Toaddr []byte `protobuf:"bytes,3,opt,name=toaddr,proto3" json:"toaddr,omitempty"` Amount *ByteArray `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` Fee *ByteArray `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee,omitempty"` OperatorAddr []byte `protobuf:"bytes,6,opt,name=operatorAddr,proto3" json:"operatorAddr,omitempty"` //this nonce is account-specific within the scilla contract. The encapsulating transaction will have a nonce from the operator's wallet. Nonce uint64 `protobuf:"varint,7,opt,name=nonce,proto3" json:"nonce,omitempty"` Signature *ByteArray `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
this object is injected straight into the code field of the encapsulating transaction
func (*CheckTransaction) Descriptor ¶
func (*CheckTransaction) Descriptor() ([]byte, []int)
func (*CheckTransaction) GetAmount ¶
func (m *CheckTransaction) GetAmount() *ByteArray
func (*CheckTransaction) GetFee ¶
func (m *CheckTransaction) GetFee() *ByteArray
func (*CheckTransaction) GetNonce ¶
func (m *CheckTransaction) GetNonce() uint64
func (*CheckTransaction) GetOperatorAddr ¶
func (m *CheckTransaction) GetOperatorAddr() []byte
func (*CheckTransaction) GetSenderpubkey ¶
func (m *CheckTransaction) GetSenderpubkey() *ByteArray
func (*CheckTransaction) GetSignature ¶
func (m *CheckTransaction) GetSignature() *ByteArray
func (*CheckTransaction) GetToaddr ¶
func (m *CheckTransaction) GetToaddr() []byte
func (*CheckTransaction) GetVersion ¶
func (m *CheckTransaction) GetVersion() uint32
func (*CheckTransaction) ProtoMessage ¶
func (*CheckTransaction) ProtoMessage()
func (*CheckTransaction) Reset ¶
func (m *CheckTransaction) Reset()
func (*CheckTransaction) String ¶
func (m *CheckTransaction) String() string
func (*CheckTransaction) XXX_DiscardUnknown ¶
func (m *CheckTransaction) XXX_DiscardUnknown()
func (*CheckTransaction) XXX_Marshal ¶
func (m *CheckTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CheckTransaction) XXX_Merge ¶
func (m *CheckTransaction) XXX_Merge(src proto.Message)
func (*CheckTransaction) XXX_Size ¶
func (m *CheckTransaction) XXX_Size() int
func (*CheckTransaction) XXX_Unmarshal ¶
func (m *CheckTransaction) XXX_Unmarshal(b []byte) error
type Client ¶
type Client struct { Key *ByteArray `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Client) Descriptor ¶
func (*Client) ProtoMessage ¶
func (*Client) ProtoMessage()
func (*Client) XXX_DiscardUnknown ¶
func (m *Client) XXX_DiscardUnknown()
func (*Client) XXX_Marshal ¶
func (*Client) XXX_Unmarshal ¶
type Empty ¶
type Empty struct { Pubkey *ByteArray `protobuf:"bytes,1,opt,name=pubkey,proto3" json:"pubkey,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Empty only requires the calling user's pubkey
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type FeeResp ¶
type FeeResp struct { Fee *ByteArray `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FeeResp) Descriptor ¶
func (*FeeResp) ProtoMessage ¶
func (*FeeResp) ProtoMessage()
func (*FeeResp) XXX_DiscardUnknown ¶
func (m *FeeResp) XXX_DiscardUnknown()
func (*FeeResp) XXX_Marshal ¶
func (*FeeResp) XXX_Unmarshal ¶
type HTTPClient ¶
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 Operator ¶
type Operator interface { // sends the signed transaction from the client to the operator. SendCheck(context.Context, *CheckTransaction) (*QueueID, error) // retrieves the transaction information from the perspective of the operator Status(context.Context, *QueueID) (*StatusResp, error) // rpc RevokeOperator(Empty) returns (StatusResp); // Gets the status of the last transaction sent by this user to this operator GetLastTransaction(context.Context, *Client) (*StatusResp, error) OperatorTarget(context.Context, *Empty) (*OperatorTargetResp, error) GetMinFee(context.Context, *Empty) (*FeeResp, error) }
============================================================================ Primitives ============================================================================
func NewOperatorJSONClient ¶
func NewOperatorJSONClient(addr string, client HTTPClient) Operator
NewOperatorJSONClient creates a JSON client that implements the Operator interface. It communicates using JSON and can be configured with a custom HTTPClient.
func NewOperatorProtobufClient ¶
func NewOperatorProtobufClient(addr string, client HTTPClient) Operator
NewOperatorProtobufClient creates a Protobuf client that implements the Operator interface. It communicates using Protobuf and can be configured with a custom HTTPClient.
type OperatorTargetResp ¶
type OperatorTargetResp struct { ContractAddr []byte `protobuf:"bytes,1,opt,name=contractAddr,proto3" json:"contractAddr,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*OperatorTargetResp) Descriptor ¶
func (*OperatorTargetResp) Descriptor() ([]byte, []int)
func (*OperatorTargetResp) GetContractAddr ¶
func (m *OperatorTargetResp) GetContractAddr() []byte
func (*OperatorTargetResp) ProtoMessage ¶
func (*OperatorTargetResp) ProtoMessage()
func (*OperatorTargetResp) Reset ¶
func (m *OperatorTargetResp) Reset()
func (*OperatorTargetResp) String ¶
func (m *OperatorTargetResp) String() string
func (*OperatorTargetResp) XXX_DiscardUnknown ¶
func (m *OperatorTargetResp) XXX_DiscardUnknown()
func (*OperatorTargetResp) XXX_Marshal ¶
func (m *OperatorTargetResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*OperatorTargetResp) XXX_Merge ¶
func (m *OperatorTargetResp) XXX_Merge(src proto.Message)
func (*OperatorTargetResp) XXX_Size ¶
func (m *OperatorTargetResp) XXX_Size() int
func (*OperatorTargetResp) XXX_Unmarshal ¶
func (m *OperatorTargetResp) XXX_Unmarshal(b []byte) error
type QueueID ¶
type QueueID struct { QueueID uint32 `protobuf:"varint,1,opt,name=queueID,proto3" json:"queueID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*QueueID) Descriptor ¶
func (*QueueID) GetQueueID ¶
func (*QueueID) ProtoMessage ¶
func (*QueueID) ProtoMessage()
func (*QueueID) XXX_DiscardUnknown ¶
func (m *QueueID) XXX_DiscardUnknown()
func (*QueueID) XXX_Marshal ¶
func (*QueueID) XXX_Unmarshal ¶
type StatusResp ¶
type StatusResp struct { SenderPkey *ByteArray `protobuf:"bytes,1,opt,name=sender_pkey,json=senderPkey,proto3" json:"sender_pkey,omitempty"` //tranid should be the chain-addressable transaction id for use in ex: viewblock.io Tranid []byte `protobuf:"bytes,2,opt,name=tranid,proto3" json:"tranid,omitempty"` Status StatusResp_Status `protobuf:"varint,3,opt,name=status,proto3,enum=starlingfoundries.operator.server.StatusResp_Status" json:"status,omitempty"` Nonce uint64 `protobuf:"varint,4,opt,name=nonce,proto3" json:"nonce,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*StatusResp) Descriptor ¶
func (*StatusResp) Descriptor() ([]byte, []int)
func (*StatusResp) GetNonce ¶
func (m *StatusResp) GetNonce() uint64
func (*StatusResp) GetSenderPkey ¶
func (m *StatusResp) GetSenderPkey() *ByteArray
func (*StatusResp) GetStatus ¶
func (m *StatusResp) GetStatus() StatusResp_Status
func (*StatusResp) GetTranid ¶
func (m *StatusResp) GetTranid() []byte
func (*StatusResp) ProtoMessage ¶
func (*StatusResp) ProtoMessage()
func (*StatusResp) Reset ¶
func (m *StatusResp) Reset()
func (*StatusResp) String ¶
func (m *StatusResp) String() string
func (*StatusResp) XXX_DiscardUnknown ¶
func (m *StatusResp) XXX_DiscardUnknown()
func (*StatusResp) XXX_Marshal ¶
func (m *StatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StatusResp) XXX_Merge ¶
func (m *StatusResp) XXX_Merge(src proto.Message)
func (*StatusResp) XXX_Size ¶
func (m *StatusResp) XXX_Size() int
func (*StatusResp) XXX_Unmarshal ¶
func (m *StatusResp) XXX_Unmarshal(b []byte) error
type StatusResp_Status ¶
type StatusResp_Status int32
const ( StatusResp_UNDEFINED StatusResp_Status = 0 StatusResp_RECIEVED StatusResp_Status = 1 StatusResp_PROCESSED StatusResp_Status = 2 StatusResp_REJECTED StatusResp_Status = 3 )
func (StatusResp_Status) EnumDescriptor ¶
func (StatusResp_Status) EnumDescriptor() ([]byte, []int)
func (StatusResp_Status) String ¶
func (x StatusResp_Status) String() string
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 // github.com/golang/protobuf/protoc-gen-go/descriptor.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 // alongside non-twirp requests on one HTTP listener. 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 NewOperatorServer ¶
func NewOperatorServer(svc Operator, hooks *twirp.ServerHooks) TwirpServer