Documentation ¶
Overview ¶
Package server is a generated GoMock package.
Index ¶
- 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 *common.HTTPHandler, arg1 *sync.RWMutex, arg2, arg3 string) error
- func (m *MockServer) AddRouteWithReadLock(arg0 *common.HTTPHandler, arg1 *sync.RWMutex, arg2, arg3 string) error
- func (m *MockServer) Dispatch() error
- func (m *MockServer) DispatchTLS(arg0, arg1 []byte) error
- func (m *MockServer) EXPECT() *MockServerMockRecorder
- func (m *MockServer) RegisterChain(arg0 string, arg1 common.Engine)
- func (m *MockServer) Shutdown() error
- type MockServerMockRecorder
- func (mr *MockServerMockRecorder) AddAliases(arg0 interface{}, arg1 ...interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddAliasesWithReadLock(arg0 interface{}, arg1 ...interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddRoute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) AddRouteWithReadLock(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) Dispatch() *gomock.Call
- func (mr *MockServerMockRecorder) DispatchTLS(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockServerMockRecorder) RegisterChain(arg0, arg1 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 MockServer ¶
type MockServer struct {
// contains filtered or unexported fields
}
MockServer is a mock of Server interface.
func NewMockServer ¶
func NewMockServer(ctrl *gomock.Controller) *MockServer
NewMockServer creates a new mock instance.
func (*MockServer) AddAliases ¶
func (m *MockServer) AddAliases(arg0 string, arg1 ...string) error
AddAliases mocks base method.
func (*MockServer) AddAliasesWithReadLock ¶
func (m *MockServer) AddAliasesWithReadLock(arg0 string, arg1 ...string) error
AddAliasesWithReadLock mocks base method.
func (*MockServer) AddRoute ¶
func (m *MockServer) AddRoute(arg0 *common.HTTPHandler, arg1 *sync.RWMutex, arg2, arg3 string) error
AddRoute mocks base method.
func (*MockServer) AddRouteWithReadLock ¶
func (m *MockServer) AddRouteWithReadLock(arg0 *common.HTTPHandler, arg1 *sync.RWMutex, arg2, arg3 string) error
AddRouteWithReadLock mocks base method.
func (*MockServer) DispatchTLS ¶
func (m *MockServer) DispatchTLS(arg0, arg1 []byte) error
DispatchTLS mocks base method.
func (*MockServer) EXPECT ¶
func (m *MockServer) EXPECT() *MockServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockServer) RegisterChain ¶
func (m *MockServer) RegisterChain(arg0 string, arg1 common.Engine)
RegisterChain mocks base method.
type MockServerMockRecorder ¶
type MockServerMockRecorder struct {
// contains filtered or unexported fields
}
MockServerMockRecorder is the mock recorder for MockServer.
func (*MockServerMockRecorder) AddAliases ¶
func (mr *MockServerMockRecorder) AddAliases(arg0 interface{}, arg1 ...interface{}) *gomock.Call
AddAliases indicates an expected call of AddAliases.
func (*MockServerMockRecorder) AddAliasesWithReadLock ¶
func (mr *MockServerMockRecorder) AddAliasesWithReadLock(arg0 interface{}, arg1 ...interface{}) *gomock.Call
AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
func (*MockServerMockRecorder) AddRoute ¶
func (mr *MockServerMockRecorder) AddRoute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
AddRoute indicates an expected call of AddRoute.
func (*MockServerMockRecorder) AddRouteWithReadLock ¶
func (mr *MockServerMockRecorder) AddRouteWithReadLock(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock.
func (*MockServerMockRecorder) Dispatch ¶
func (mr *MockServerMockRecorder) Dispatch() *gomock.Call
Dispatch indicates an expected call of Dispatch.
func (*MockServerMockRecorder) DispatchTLS ¶
func (mr *MockServerMockRecorder) DispatchTLS(arg0, arg1 interface{}) *gomock.Call
DispatchTLS indicates an expected call of DispatchTLS.
func (*MockServerMockRecorder) RegisterChain ¶
func (mr *MockServerMockRecorder) RegisterChain(arg0, arg1 interface{}) *gomock.Call
RegisterChain indicates an expected call of RegisterChain.
func (*MockServerMockRecorder) Shutdown ¶
func (mr *MockServerMockRecorder) Shutdown() *gomock.Call
Shutdown indicates an expected call of Shutdown.
type PathAdder ¶
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 ¶
func PathWriterFromWithReadLock(pather PathAdderWithReadLock) PathAdder
type PathAdderWithReadLock ¶
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 // 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) // Shutdown this server Shutdown() error }
Server maintains the HTTP router