Documentation ¶
Overview ¶
Package server is a generated GoMock package.
Index ¶
- type MockPathAdder
- type MockPathAdderMockRecorder
- type MockPathAdderWithReadLock
- func (m *MockPathAdderWithReadLock) AddAliasesWithReadLock(endpoint string, aliases ...string) error
- func (m *MockPathAdderWithReadLock) AddRouteWithReadLock(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, ...) error
- func (m *MockPathAdderWithReadLock) EXPECT() *MockPathAdderWithReadLockMockRecorder
- type MockPathAdderWithReadLockMockRecorder
- type MockServer
- func (m *MockServer) AddAliases(endpoint string, aliases ...string) error
- func (m *MockServer) AddAliasesWithReadLock(endpoint string, aliases ...string) error
- func (m *MockServer) AddChainRoute(handler *common.HTTPHandler, ctx *snow.ConsensusContext, base, endpoint string) error
- func (m *MockServer) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string) error
- func (m *MockServer) AddRouteWithReadLock(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string) error
- func (m *MockServer) Dispatch() error
- func (m *MockServer) DispatchTLS(certBytes, keyBytes []byte) error
- func (m *MockServer) EXPECT() *MockServerMockRecorder
- func (m *MockServer) Initialize(log logging.Logger, factory logging.Factory, host string, port uint16, ...)
- func (m *MockServer) RegisterChain(chainName string, engine common.Engine)
- func (m *MockServer) Shutdown() error
- type MockServerMockRecorder
- func (mr *MockServerMockRecorder) AddAliases(endpoint interface{}, aliases ...interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddAliasesWithReadLock(endpoint interface{}, aliases ...interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddChainRoute(handler, ctx, base, endpoint interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddRoute(handler, lock, base, endpoint interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddRouteWithReadLock(handler, lock, base, endpoint interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) Dispatch() *gomock.Call
- func (mr *MockServerMockRecorder) DispatchTLS(certBytes, keyBytes interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) Initialize(log, factory, host, port, allowedOrigins, shutdownTimeout, nodeID interface{}, ...) *gomock.Call
- func (mr *MockServerMockRecorder) RegisterChain(chainName, engine interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) Shutdown() *gomock.Call
- type PathAdder
- type PathAdderWithReadLock
- type Server
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockPathAdder ¶ added in v1.7.6
type MockPathAdder struct {
// contains filtered or unexported fields
}
MockPathAdder is a mock of PathAdder interface.
func NewMockPathAdder ¶ added in v1.7.6
func NewMockPathAdder(ctrl *gomock.Controller) *MockPathAdder
NewMockPathAdder creates a new mock instance.
func (*MockPathAdder) AddAliases ¶ added in v1.7.6
func (m *MockPathAdder) AddAliases(endpoint string, aliases ...string) error
AddAliases mocks base method.
func (*MockPathAdder) AddRoute ¶ added in v1.7.6
func (m *MockPathAdder) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, loggingWriter io.Writer) error
AddRoute mocks base method.
func (*MockPathAdder) EXPECT ¶ added in v1.7.6
func (m *MockPathAdder) EXPECT() *MockPathAdderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockPathAdderMockRecorder ¶ added in v1.7.6
type MockPathAdderMockRecorder struct {
// contains filtered or unexported fields
}
MockPathAdderMockRecorder is the mock recorder for MockPathAdder.
func (*MockPathAdderMockRecorder) AddAliases ¶ added in v1.7.6
func (mr *MockPathAdderMockRecorder) AddAliases(endpoint interface{}, aliases ...interface{}) *gomock.Call
AddAliases indicates an expected call of AddAliases.
func (*MockPathAdderMockRecorder) AddRoute ¶ added in v1.7.6
func (mr *MockPathAdderMockRecorder) AddRoute(handler, lock, base, endpoint, loggingWriter interface{}) *gomock.Call
AddRoute indicates an expected call of AddRoute.
type MockPathAdderWithReadLock ¶ added in v1.7.6
type MockPathAdderWithReadLock struct {
// contains filtered or unexported fields
}
MockPathAdderWithReadLock is a mock of PathAdderWithReadLock interface.
func NewMockPathAdderWithReadLock ¶ added in v1.7.6
func NewMockPathAdderWithReadLock(ctrl *gomock.Controller) *MockPathAdderWithReadLock
NewMockPathAdderWithReadLock creates a new mock instance.
func (*MockPathAdderWithReadLock) AddAliasesWithReadLock ¶ added in v1.7.6
func (m *MockPathAdderWithReadLock) AddAliasesWithReadLock(endpoint string, aliases ...string) error
AddAliasesWithReadLock mocks base method.
func (*MockPathAdderWithReadLock) AddRouteWithReadLock ¶ added in v1.7.6
func (m *MockPathAdderWithReadLock) AddRouteWithReadLock(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string, loggingWriter io.Writer) error
AddRouteWithReadLock mocks base method.
func (*MockPathAdderWithReadLock) EXPECT ¶ added in v1.7.6
func (m *MockPathAdderWithReadLock) EXPECT() *MockPathAdderWithReadLockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockPathAdderWithReadLockMockRecorder ¶ added in v1.7.6
type MockPathAdderWithReadLockMockRecorder struct {
// contains filtered or unexported fields
}
MockPathAdderWithReadLockMockRecorder is the mock recorder for MockPathAdderWithReadLock.
func (*MockPathAdderWithReadLockMockRecorder) AddAliasesWithReadLock ¶ added in v1.7.6
func (mr *MockPathAdderWithReadLockMockRecorder) AddAliasesWithReadLock(endpoint interface{}, aliases ...interface{}) *gomock.Call
AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
func (*MockPathAdderWithReadLockMockRecorder) AddRouteWithReadLock ¶ added in v1.7.6
func (mr *MockPathAdderWithReadLockMockRecorder) AddRouteWithReadLock(handler, lock, base, endpoint, loggingWriter interface{}) *gomock.Call
AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock.
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(endpoint string, aliases ...string) error
AddAliases mocks base method.
func (*MockServer) AddAliasesWithReadLock ¶ added in v1.7.6
func (m *MockServer) AddAliasesWithReadLock(endpoint string, aliases ...string) error
AddAliasesWithReadLock mocks base method.
func (*MockServer) AddChainRoute ¶ added in v1.7.6
func (m *MockServer) AddChainRoute(handler *common.HTTPHandler, ctx *snow.ConsensusContext, base, endpoint string) error
AddChainRoute mocks base method.
func (*MockServer) AddRoute ¶ added in v1.7.6
func (m *MockServer) AddRoute(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint string) error
AddRoute mocks base method.
func (*MockServer) AddRouteWithReadLock ¶ added in v1.7.6
func (m *MockServer) AddRouteWithReadLock(handler *common.HTTPHandler, lock *sync.RWMutex, base, endpoint 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) DispatchTLS ¶ added in v1.7.6
func (m *MockServer) DispatchTLS(certBytes, keyBytes []byte) error
DispatchTLS 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) Initialize ¶ added in v1.7.6
func (m *MockServer) Initialize(log logging.Logger, factory logging.Factory, host string, port uint16, allowedOrigins []string, shutdownTimeout time.Duration, nodeID ids.NodeID, wrappers ...Wrapper)
Initialize mocks base method.
func (*MockServer) RegisterChain ¶ added in v1.7.6
func (m *MockServer) RegisterChain(chainName string, engine common.Engine)
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(endpoint interface{}, aliases ...interface{}) *gomock.Call
AddAliases indicates an expected call of AddAliases.
func (*MockServerMockRecorder) AddAliasesWithReadLock ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddAliasesWithReadLock(endpoint interface{}, aliases ...interface{}) *gomock.Call
AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
func (*MockServerMockRecorder) AddChainRoute ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddChainRoute(handler, ctx, base, endpoint interface{}) *gomock.Call
AddChainRoute indicates an expected call of AddChainRoute.
func (*MockServerMockRecorder) AddRoute ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddRoute(handler, lock, base, endpoint interface{}) *gomock.Call
AddRoute indicates an expected call of AddRoute.
func (*MockServerMockRecorder) AddRouteWithReadLock ¶ added in v1.7.6
func (mr *MockServerMockRecorder) AddRouteWithReadLock(handler, lock, base, endpoint interface{}) *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) DispatchTLS ¶ added in v1.7.6
func (mr *MockServerMockRecorder) DispatchTLS(certBytes, keyBytes interface{}) *gomock.Call
DispatchTLS indicates an expected call of DispatchTLS.
func (*MockServerMockRecorder) Initialize ¶ added in v1.7.6
func (mr *MockServerMockRecorder) Initialize(log, factory, host, port, allowedOrigins, shutdownTimeout, nodeID interface{}, wrappers ...interface{}) *gomock.Call
Initialize indicates an expected call of Initialize.
func (*MockServerMockRecorder) RegisterChain ¶ added in v1.7.6
func (mr *MockServerMockRecorder) RegisterChain(chainName, engine interface{}) *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 *common.HTTPHandler, lock *sync.RWMutex, 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 *common.HTTPHandler, lock *sync.RWMutex, 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 // Initialize creates the API server at the provided host and port Initialize(log logging.Logger, factory logging.Factory, host string, port uint16, allowedOrigins []string, shutdownTimeout time.Duration, nodeID ids.NodeID, wrappers ...Wrapper) // Dispatch starts the API server Dispatch() error // DispatchTLS starts the API server with the provided TLS certificate DispatchTLS(certBytes, keyBytes []byte) 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. // This method runs in a goroutine to avoid a deadlock in the event that the caller // holds the engine's context lock. Namely, this could happen when the P-Chain is // creating a new chain and holds the P-Chain's lock when this function is held, // and at the same time the server's lock is held due to an API call and is trying // to grab the P-Chain's lock. RegisterChain(chainName string, engine common.Engine) // AddChainRoute registers a route to a chain's handler AddChainRoute( handler *common.HTTPHandler, ctx *snow.ConsensusContext, base, endpoint string, ) error // Shutdown this server Shutdown() error }
Server maintains the HTTP router