Documentation
¶
Overview ¶
sessions v0.0.1 48681273e3b0249c5feb593b9af1b59dc6a14869 -- Code generated by webrpc-gen@v0.22.1 with golang generator. DO NOT EDIT.
webrpc-gen -schema=sessions.ridl -target=golang -pkg=proto -client -out=./clients/sessions.gen.go
Index ¶
- Constants
- Variables
- func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)
- func MethodCtx(ctx context.Context) (method, bool)
- func MethodNameFromContext(ctx context.Context) string
- func RequestFromContext(ctx context.Context) *http.Request
- func ServiceNameFromContext(ctx context.Context) string
- func WebRPCSchemaHash() string
- func WebRPCSchemaVersion() string
- func WebRPCVersion() string
- func WebrpcMethods() map[string]method
- func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)
- type ArweaveBundleInfo
- type ArweaveInfo
- type ArweavePendingInfo
- type ArweaveSenderInfo
- type ArweaveStatus
- type ConfigUpdate
- type Context
- type HTTPClient
- type Info
- type RecorderInfo
- type RuntimeStatus
- type Sessions
- type SessionsClient
- type Signature
- type SignatureType
- type SignerSignature
- type Transaction
- type TransactionBundle
- type WebRPCError
- type WebrpcGenVersions
Constants ¶
View Source
const SessionsPathPrefix = "/rpc/Sessions/"
View Source
const WebrpcHeader = "Webrpc"
View Source
const WebrpcHeaderValue = "webrpc@v0.22.1;gen-golang@v0.17.0;sessions@v0.0.1"
Variables ¶
View Source
var ( HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} HTTPRequestCtxKey = &contextKey{"HTTPRequest"} ServiceNameCtxKey = &contextKey{"ServiceName"} MethodNameCtxKey = &contextKey{"MethodName"} )
View Source
var ( ErrWebrpcEndpoint = WebRPCError{Code: 0, Name: "WebrpcEndpoint", Message: "endpoint error", HTTPStatus: 400} ErrWebrpcRequestFailed = WebRPCError{Code: -1, Name: "WebrpcRequestFailed", Message: "request failed", HTTPStatus: 400} ErrWebrpcBadRoute = WebRPCError{Code: -2, Name: "WebrpcBadRoute", Message: "bad route", HTTPStatus: 404} ErrWebrpcBadMethod = WebRPCError{Code: -3, Name: "WebrpcBadMethod", Message: "bad method", HTTPStatus: 405} ErrWebrpcBadRequest = WebRPCError{Code: -4, Name: "WebrpcBadRequest", Message: "bad request", HTTPStatus: 400} ErrWebrpcBadResponse = WebRPCError{Code: -5, Name: "WebrpcBadResponse", Message: "bad response", HTTPStatus: 500} ErrWebrpcServerPanic = WebRPCError{Code: -6, Name: "WebrpcServerPanic", Message: "server panic", HTTPStatus: 500} ErrWebrpcInternalError = WebRPCError{Code: -7, Name: "WebrpcInternalError", Message: "internal error", HTTPStatus: 500} ErrWebrpcClientDisconnected = WebRPCError{Code: -8, Name: "WebrpcClientDisconnected", Message: "client disconnected", HTTPStatus: 400} ErrWebrpcStreamLost = WebRPCError{Code: -9, Name: "WebrpcStreamLost", Message: "stream lost", HTTPStatus: 400} ErrWebrpcStreamFinished = WebRPCError{Code: -10, Name: "WebrpcStreamFinished", Message: "stream finished", HTTPStatus: 200} )
Webrpc errors
View Source
var ( ErrInvalidArgument = WebRPCError{Code: 1, Name: "InvalidArgument", Message: "invalid argument", HTTPStatus: 400} ErrNotFound = WebRPCError{Code: 2, Name: "NotFound", Message: "not found", HTTPStatus: 400} )
Schema errors
View Source
var SignatureType_name = map[int32]string{
0: "EIP712",
1: "EthSign",
2: "EIP1271",
}
View Source
var SignatureType_value = map[string]int32{
"EIP712": 0,
"EthSign": 1,
"EIP1271": 2,
}
View Source
var WebRPCServices = map[string][]string{
"Sessions": {
"Ping",
"Config",
"Wallets",
"DeployHash",
"ConfigUpdates",
"Migrations",
"SaveConfig",
"SaveWallet",
"SaveSignature",
"SaveSignerSignatures",
"SaveSignerSignatures2",
"SaveMigration",
},
}
Functions ¶
func MethodNameFromContext ¶ added in v0.32.0
func RequestFromContext ¶ added in v0.32.0
func ServiceNameFromContext ¶ added in v0.32.0
func WebrpcMethods ¶ added in v0.44.3
func WebrpcMethods() map[string]method
Types ¶
type ArweaveBundleInfo ¶ added in v0.43.4
type ArweaveInfo ¶ added in v0.43.4
type ArweaveInfo struct {
NodeURL string `json:"nodeURL"`
Namespace string `json:"namespace"`
Sender *ArweaveSenderInfo `json:"sender"`
Signer string `json:"signer"`
FlushInterval string `json:"flushInterval"`
BundleDelay string `json:"bundleDelay"`
BundleLimit int `json:"bundleLimit"`
Confirmations int `json:"confirmations"`
LockTTL string `json:"lockTTL"`
Healthy bool `json:"healthy"`
LastFlush *time.Time `json:"lastFlush"`
LastFlushSeconds *uint64 `json:"lastFlushSeconds"`
Bundles uint64 `json:"bundles"`
Pending *ArweavePendingInfo `json:"pending"`
}
type ArweavePendingInfo ¶ added in v0.43.4
type ArweavePendingInfo struct {
Wallets uint64 `json:"wallets"`
Configs uint64 `json:"configs"`
Migrations uint64 `json:"migrations"`
Signatures uint64 `json:"signatures"`
Bundles []*ArweaveBundleInfo `json:"bundles"`
}
type ArweaveSenderInfo ¶ added in v0.43.4
type ArweaveStatus ¶ added in v0.43.4
type ArweaveStatus struct {
NodeURL string `json:"nodeURL"`
Namespace string `json:"namespace"`
Sender string `json:"sender"`
Signer string `json:"signer"`
FlushInterval string `json:"flushInterval"`
BundleDelay string `json:"bundleDelay"`
BundleLimit int `json:"bundleLimit"`
Confirmations int `json:"confirmations"`
LockTTL string `json:"lockTTL"`
Healthy bool `json:"healthy"`
LastFlush *time.Time `json:"lastFlush"`
LastFlushSeconds *uint64 `json:"lastFlushSeconds"`
}
type ConfigUpdate ¶
type Context ¶
type Context struct {
Version int `json:"version"`
Factory prototyp.Hash `json:"factory"`
MainModule prototyp.Hash `json:"mainModule"`
MainModuleUpgradable prototyp.Hash `json:"mainModuleUpgradable"`
GuestModule prototyp.Hash `json:"guestModule"`
WalletCreationCode prototyp.Hash `json:"walletCreationCode"`
}
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.
type Info ¶ added in v0.43.4
type Info struct {
Wallets map[string]uint64 `json:"wallets"`
Configs map[string]uint64 `json:"configs"`
ConfigTrees uint64 `json:"configTrees"`
Migrations map[string]uint64 `json:"migrations"`
Signatures uint64 `json:"signatures"`
Digests uint64 `json:"digests"`
Recorder *RecorderInfo `json:"recorder,omitempty"`
Arweave *ArweaveInfo `json:"arweave,omitempty"`
}
type RecorderInfo ¶ added in v0.43.4
type RuntimeStatus ¶ added in v0.32.0
type Sessions ¶
type Sessions interface {
Ping(ctx context.Context) error
Config(ctx context.Context, imageHash string) (int, interface{}, error)
Wallets(ctx context.Context, signer string, cursor *uint64, limit *uint64) (map[string]*Signature, uint64, error)
DeployHash(ctx context.Context, wallet string) (string, *Context, error)
ConfigUpdates(ctx context.Context, wallet string, fromImageHash string, allUpdates *bool) ([]*ConfigUpdate, error)
Migrations(ctx context.Context, wallet string, fromVersion int, fromImageHash string, chainID *string) (map[string]map[int]map[string]*TransactionBundle, error)
SaveConfig(ctx context.Context, version int, config interface{}) error
SaveWallet(ctx context.Context, version int, deployConfig interface{}) error
SaveSignature(ctx context.Context, wallet string, digest string, chainID string, signature string, toConfig *interface{}, referenceChainID *string) error
SaveSignerSignatures(ctx context.Context, wallet string, digest string, chainID string, signatures []string, toConfig *interface{}) error
SaveSignerSignatures2(ctx context.Context, wallet string, digest string, chainID string, signatures []*SignerSignature, toConfig *interface{}) error
SaveMigration(ctx context.Context, wallet string, fromVersion int, toVersion int, toConfig interface{}, executor string, transactions []*Transaction, nonce string, signature string, chainID *string) error
}
type SessionsClient ¶ added in v0.32.0
type SessionsClient interface {
Ping(ctx context.Context) error
Config(ctx context.Context, imageHash string) (int, interface{}, error)
Wallets(ctx context.Context, signer string, cursor *uint64, limit *uint64) (map[string]*Signature, uint64, error)
DeployHash(ctx context.Context, wallet string) (string, *Context, error)
ConfigUpdates(ctx context.Context, wallet string, fromImageHash string, allUpdates *bool) ([]*ConfigUpdate, error)
Migrations(ctx context.Context, wallet string, fromVersion int, fromImageHash string, chainID *string) (map[string]map[int]map[string]*TransactionBundle, error)
SaveConfig(ctx context.Context, version int, config interface{}) error
SaveWallet(ctx context.Context, version int, deployConfig interface{}) error
SaveSignature(ctx context.Context, wallet string, digest string, chainID string, signature string, toConfig *interface{}, referenceChainID *string) error
SaveSignerSignatures(ctx context.Context, wallet string, digest string, chainID string, signatures []string, toConfig *interface{}) error
SaveSignerSignatures2(ctx context.Context, wallet string, digest string, chainID string, signatures []*SignerSignature, toConfig *interface{}) error
SaveMigration(ctx context.Context, wallet string, fromVersion int, toVersion int, toConfig interface{}, executor string, transactions []*Transaction, nonce string, signature string, chainID *string) error
}
func NewSessionsClient ¶
func NewSessionsClient(addr string, client HTTPClient) SessionsClient
type Signature ¶
type Signature struct {
Digest prototyp.Hash `json:"digest"`
ToImageHash prototyp.HashMaybe `json:"toImageHash,omitempty"`
ChainID prototyp.BigInt `json:"chainID"`
Type SignatureType `json:"type"`
Signature prototyp.Hash `json:"signature"`
ValidOnChain *prototyp.BigInt `json:"validOnChain,omitempty"`
ValidOnBlock *prototyp.BigInt `json:"validOnBlock,omitempty"`
ValidOnBlockHash prototyp.HashMaybe `json:"validOnBlockHash,omitempty"`
}
type SignatureType ¶
type SignatureType int32
const ( SignatureType_EIP712 SignatureType = 0 SignatureType_EthSign SignatureType = 1 SignatureType_EIP1271 SignatureType = 2 )
func (*SignatureType) Is ¶ added in v0.32.0
func (x *SignatureType) Is(values ...SignatureType) bool
func (SignatureType) MarshalText ¶ added in v0.32.0
func (x SignatureType) MarshalText() ([]byte, error)
func (SignatureType) String ¶
func (x SignatureType) String() string
func (*SignatureType) UnmarshalText ¶ added in v0.32.0
func (x *SignatureType) UnmarshalText(b []byte) error
type SignerSignature ¶ added in v0.43.4
type Transaction ¶
type Transaction struct {
To prototyp.Hash `json:"to"`
Value prototyp.BigInt `json:"value,omitempty"`
Data prototyp.HashMaybe `json:"data,omitempty"`
GasLimit prototyp.BigInt `json:"gasLimit,omitempty"`
DelegateCall *bool `json:"delegateCall,omitempty"`
RevertOnError *bool `json:"revertOnError,omitempty"`
}
type TransactionBundle ¶
type WebRPCError ¶ added in v0.32.0
type WebRPCError struct {
Name string `json:"error"`
Code int `json:"code"`
Message string `json:"msg"`
Cause string `json:"cause,omitempty"`
HTTPStatus int `json:"status"`
// contains filtered or unexported fields
}
func ErrorWithCause
deprecated
added in
v0.32.0
func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError
Deprecated: Use .WithCause() method on WebRPCError.
func (WebRPCError) Error ¶ added in v0.32.0
func (e WebRPCError) Error() string
func (WebRPCError) Is ¶ added in v0.32.0
func (e WebRPCError) Is(target error) bool
func (WebRPCError) Unwrap ¶ added in v0.32.0
func (e WebRPCError) Unwrap() error
func (WebRPCError) WithCause ¶ added in v0.32.0
func (e WebRPCError) WithCause(cause error) WebRPCError
func (WebRPCError) WithCausef ¶ added in v0.32.0
func (e WebRPCError) WithCausef(format string, args ...interface{}) WebRPCError
type WebrpcGenVersions ¶ added in v0.44.3
type WebrpcGenVersions struct {
WebrpcGenVersion string
CodeGenName string
CodeGenVersion string
SchemaName string
SchemaVersion string
}
func VersionFromHeader ¶ added in v0.44.3
func VersionFromHeader(h http.Header) (*WebrpcGenVersions, error)
Click to show internal directories.
Click to hide internal directories.