starlingfoundries_operator_server

package
v0.0.0-...-4fc5c05 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 15 Imported by: 0

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

View Source
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

View Source
var StatusResp_Status_name = map[int32]string{
	0: "UNDEFINED",
	1: "RECIEVED",
	2: "PROCESSED",
	3: "REJECTED",
}
View Source
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) Descriptor() ([]byte, []int)

func (*ByteArray) GetData

func (m *ByteArray) GetData() []byte

func (*ByteArray) ProtoMessage

func (*ByteArray) ProtoMessage()

func (*ByteArray) Reset

func (m *ByteArray) Reset()

func (*ByteArray) String

func (m *ByteArray) String() string

func (*ByteArray) XXX_DiscardUnknown

func (m *ByteArray) XXX_DiscardUnknown()

func (*ByteArray) XXX_Marshal

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

func (*ByteArray) XXX_Merge

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

func (*ByteArray) XXX_Size

func (m *ByteArray) XXX_Size() int

func (*ByteArray) XXX_Unmarshal

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

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

func (*Client) GetKey

func (m *Client) GetKey() *ByteArray

func (*Client) ProtoMessage

func (*Client) ProtoMessage()

func (*Client) Reset

func (m *Client) Reset()

func (*Client) String

func (m *Client) String() string

func (*Client) XXX_DiscardUnknown

func (m *Client) XXX_DiscardUnknown()

func (*Client) XXX_Marshal

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

func (*Client) XXX_Merge

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

func (*Client) XXX_Size

func (m *Client) XXX_Size() int

func (*Client) XXX_Unmarshal

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

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

func (*Empty) GetPubkey

func (m *Empty) GetPubkey() *ByteArray

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

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

func (*FeeResp) GetFee

func (m *FeeResp) GetFee() *ByteArray

func (*FeeResp) ProtoMessage

func (*FeeResp) ProtoMessage()

func (*FeeResp) Reset

func (m *FeeResp) Reset()

func (*FeeResp) String

func (m *FeeResp) String() string

func (*FeeResp) XXX_DiscardUnknown

func (m *FeeResp) XXX_DiscardUnknown()

func (*FeeResp) XXX_Marshal

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

func (*FeeResp) XXX_Merge

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

func (*FeeResp) XXX_Size

func (m *FeeResp) XXX_Size() int

func (*FeeResp) XXX_Unmarshal

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

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

func (*QueueID) GetQueueID

func (m *QueueID) GetQueueID() uint32

func (*QueueID) ProtoMessage

func (*QueueID) ProtoMessage()

func (*QueueID) Reset

func (m *QueueID) Reset()

func (*QueueID) String

func (m *QueueID) String() string

func (*QueueID) XXX_DiscardUnknown

func (m *QueueID) XXX_DiscardUnknown()

func (*QueueID) XXX_Marshal

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

func (*QueueID) XXX_Merge

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

func (*QueueID) XXX_Size

func (m *QueueID) XXX_Size() int

func (*QueueID) XXX_Unmarshal

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

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

Jump to

Keyboard shortcuts

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