Documentation ¶
Overview ¶
Package server is a generated GoMock package.
Index ¶
- type HTTPConfig
- type MockServer
- func (m *MockServer) AddAliases(arg0 string, arg1 ...string) error
- func (m *MockServer) AddAliasesWithReadLock(arg0 string, arg1 ...string) error
- func (m *MockServer) AddRoute(arg0 http.Handler, arg1, arg2 string) error
- func (m *MockServer) AddRouteWithReadLock(arg0 http.Handler, arg1, arg2 string) error
- func (m *MockServer) Dispatch() error
- func (m *MockServer) EXPECT() *MockServerMockRecorder
- func (m *MockServer) RegisterChain(arg0 string, arg1 *snow.ConsensusContext, arg2 common.VM)
- func (m *MockServer) Shutdown() error
- type MockServerMockRecorder
- func (mr *MockServerMockRecorder) AddAliases(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockServerMockRecorder) AddAliasesWithReadLock(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockServerMockRecorder) AddRoute(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServerMockRecorder) AddRouteWithReadLock(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServerMockRecorder) Dispatch() *gomock.Call
- func (mr *MockServerMockRecorder) RegisterChain(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockServerMockRecorder) Shutdown() *gomock.Call
- type PathAdder
- type PathAdderWithReadLock
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPConfig ¶ added in v1.9.12
type MockServer ¶ added in v1.7.6
type MockServer struct {
// contains filtered or unexported fields
}
MockServer is a mock of Server interface.
func NewMockServer ¶ added in v1.7.6
func NewMockServer(ctrl *gomock.Controller) *MockServer
NewMockServer creates a new mock instance.
func (*MockServer) AddAliases ¶ added in v1.7.6
func (m *MockServer) AddAliases(arg0 string, arg1 ...string) error
AddAliases mocks base method.
func (*MockServer) AddAliasesWithReadLock ¶ added in v1.7.6
func (m *MockServer) AddAliasesWithReadLock(arg0 string, arg1 ...string) error
AddAliasesWithReadLock mocks base method.
func (*MockServer) AddRoute ¶ added in v1.7.6
func (m *MockServer) AddRoute(arg0 http.Handler, arg1, arg2 string) error
AddRoute mocks base method.
func (*MockServer) AddRouteWithReadLock ¶ added in v1.7.6
func (m *MockServer) AddRouteWithReadLock(arg0 http.Handler, arg1, arg2 string) error
AddRouteWithReadLock mocks base method.
func (*MockServer) Dispatch ¶ added in v1.7.6
func (m *MockServer) Dispatch() error
Dispatch mocks base method.
func (*MockServer) EXPECT ¶ added in v1.7.6
func (m *MockServer) EXPECT() *MockServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockServer) RegisterChain ¶ added in v1.7.6
func (m *MockServer) RegisterChain(arg0 string, arg1 *snow.ConsensusContext, arg2 common.VM)
RegisterChain mocks base method.
func (*MockServer) Shutdown ¶ added in v1.7.6
func (m *MockServer) Shutdown() error
Shutdown mocks base method.
type MockServerMockRecorder ¶ added in v1.7.6
type MockServerMockRecorder struct {
// contains filtered or unexported fields
}
MockServerMockRecorder is the mock recorder for MockServer.
func (*MockServerMockRecorder) AddAliases ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddAliases(arg0 any, arg1 ...any) *gomock.Call
AddAliases indicates an expected call of AddAliases.
func (*MockServerMockRecorder) AddAliasesWithReadLock ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddAliasesWithReadLock(arg0 any, arg1 ...any) *gomock.Call
AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
func (*MockServerMockRecorder) AddRoute ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddRoute(arg0, arg1, arg2 any) *gomock.Call
AddRoute indicates an expected call of AddRoute.
func (*MockServerMockRecorder) AddRouteWithReadLock ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddRouteWithReadLock(arg0, arg1, arg2 any) *gomock.Call
AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock.
func (*MockServerMockRecorder) Dispatch ¶ added in v1.7.6
func (mr *MockServerMockRecorder) Dispatch() *gomock.Call
Dispatch indicates an expected call of Dispatch.
func (*MockServerMockRecorder) RegisterChain ¶ added in v1.7.6
func (mr *MockServerMockRecorder) RegisterChain(arg0, arg1, arg2 any) *gomock.Call
RegisterChain indicates an expected call of RegisterChain.
func (*MockServerMockRecorder) Shutdown ¶ added in v1.7.6
func (mr *MockServerMockRecorder) Shutdown() *gomock.Call
Shutdown indicates an expected call of Shutdown.
type PathAdder ¶ added in v1.7.6
type PathAdder interface { // AddRoute registers a route to a handler. AddRoute(handler http.Handler, base, endpoint string) error // AddAliases registers aliases to the server AddAliases(endpoint string, aliases ...string) error }
func PathWriterFromWithReadLock ¶ added in v1.7.6
func PathWriterFromWithReadLock(pather PathAdderWithReadLock) PathAdder
type PathAdderWithReadLock ¶ added in v1.7.6
type PathAdderWithReadLock interface { // AddRouteWithReadLock registers a route to a handler assuming the http // read lock is currently held. AddRouteWithReadLock(handler http.Handler, base, endpoint string) error // AddAliasesWithReadLock registers aliases to the server assuming the http read // lock is currently held. AddAliasesWithReadLock(endpoint string, aliases ...string) error }
type Server ¶
type Server interface { PathAdder PathAdderWithReadLock // Dispatch starts the API server Dispatch() error // RegisterChain registers the API endpoints associated with this chain. // That is, add <route, handler> pairs to server so that API calls can be // made to the VM. RegisterChain(chainName string, ctx *snow.ConsensusContext, vm common.VM) // Shutdown this server Shutdown() error }
Server maintains the HTTP router
func New ¶ added in v1.7.6
func New( log logging.Logger, factory logging.Factory, listener net.Listener, allowedOrigins []string, shutdownTimeout time.Duration, nodeID ids.NodeID, tracingEnabled bool, tracer trace.Tracer, namespace string, registerer prometheus.Registerer, httpConfig HTTPConfig, allowedHosts []string, ) (Server, error)
New returns an instance of a Server.