server

package
v0.0.1-beta6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Health

type Health interface {
	Ready() bool
}

Health interface for a service that had a ready func

type Logging

type Logging struct {
	Logger *log.Logger
}

Logging is a logrus-enabled logging middleware

func (*Logging) Handler

func (l *Logging) Handler(h http.Handler) http.Handler

Handler wraps provided http.Handler with middleware

type ResponseStatusWriter

type ResponseStatusWriter interface {
	http.ResponseWriter
	Status() int
}

ResponseStatusWriter wraps http.ResponseWriter to save HTTP status code

func NewResponseStatusWriter

func NewResponseStatusWriter(w http.ResponseWriter) ResponseStatusWriter

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server struct containing the information necessary to run a tezos remote signers

func NewServer

func NewServer(signatory Signer, config *config.ServerConfig, logger log.FieldLogger) *Server

NewServer create a new server struct

func (*Server) GetKey

func (server *Server) GetKey(w http.ResponseWriter, r *http.Request)

GetKey s the HTTP request handler that get the public key from a public key hash

func (*Server) Serve

func (server *Server) Serve() error

Serve start the server and register route

func (*Server) Shutdown

func (server *Server) Shutdown(ctx context.Context) error

Shutdown the server

func (*Server) Sign

func (server *Server) Sign(w http.ResponseWriter, r *http.Request)

Sign is the HTTP request handler that signs operations

type Signer

type Signer interface {
	Sign(ctx context.Context, keyHash string, message []byte) (string, error)
	GetPublicKey(ctx context.Context, keyHash string) (string, error)
}

Signer interface representing a Signer

type UtilityServer

type UtilityServer struct {
	// contains filtered or unexported fields
}

UtilityServer struct containing the information necessary to run a utility endpoints

func NewUtilityServer

func NewUtilityServer(config *config.ServerConfig, healthService []Health) *UtilityServer

NewUtilityServer create a new utility server struct

func (*UtilityServer) Serve

func (u *UtilityServer) Serve() error

Serve start the server and register route

func (*UtilityServer) ShutdownAfter

func (u *UtilityServer) ShutdownAfter(ctx context.Context, afterFunc func()) error

ShutdownAfter shutdown the server after executing afterFunc

Jump to

Keyboard shortcuts

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