Documentation ¶
Overview ¶
sequence-dapp-signing-server v0.4.0 127eca8a4e204625345db5ab95e4c446487f86d4 -- Code generated by webrpc-gen@v0.11.x-dev with golang generator. DO NOT EDIT.
webrpc-gen -schema=dapp_signing_server.ridl -target=golang -pkg=proto -server -client -out=./dapp_signing_server.gen.go
Index ¶
- Constants
- Variables
- func HTTPRequestHeaders(ctx context.Context) (http.Header, bool)
- func RespondWithError(w http.ResponseWriter, err error)
- func WebRPCSchemaHash() string
- func WebRPCSchemaVersion() string
- func WebRPCVersion() string
- func WithHTTPRequestHeaders(ctx context.Context, h http.Header) (context.Context, error)
- type HTTPClient
- type RuntimeStatus
- type SignRequest
- type SigningService
- type Version
- type WalletConfig
- type WalletSigner
- type WebRPCError
- type WebRPCServer
Constants ¶
View Source
const SigningServicePathPrefix = "/rpc/SigningService/"
Variables ¶
View Source
var ( // For Client HTTPClientRequestHeadersCtxKey = &contextKey{"HTTPClientRequestHeaders"} // For Server HTTPResponseWriterCtxKey = &contextKey{"HTTPResponseWriter"} 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: 0} 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} )
Webrpc errors
View Source
var WebRPCServices = map[string][]string{
"SigningService": {
"Ping",
"Version",
"RuntimeStatus",
"GetSignerConfig",
"Sign",
"SignWith",
},
}
Functions ¶
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, err error)
Types ¶
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 RuntimeStatus ¶
type SignRequest ¶
type SigningService ¶
type SigningService interface { Ping(ctx context.Context) (bool, error) Version(ctx context.Context) (*Version, error) RuntimeStatus(ctx context.Context) (*RuntimeStatus, error) GetSignerConfig(ctx context.Context, signer string) (*WalletConfig, error) Sign(ctx context.Context, request *SignRequest) (string, error) SignWith(ctx context.Context, signer string, request *SignRequest) (string, error) }
func NewSigningServiceClient ¶
func NewSigningServiceClient(addr string, client HTTPClient) SigningService
type WalletConfig ¶
type WalletSigner ¶
type WebRPCError ¶
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 ¶
func ErrorWithCause(rpcErr WebRPCError, cause error) WebRPCError
func (WebRPCError) Error ¶
func (e WebRPCError) Error() string
func (WebRPCError) Is ¶
func (e WebRPCError) Is(target error) bool
func (WebRPCError) Unwrap ¶
func (e WebRPCError) Unwrap() error
type WebRPCServer ¶
func NewSigningServiceServer ¶
func NewSigningServiceServer(svc SigningService) WebRPCServer
Click to show internal directories.
Click to hide internal directories.