Documentation
¶
Index ¶
- func OkHandler(ctx context.Context) http.Handler
- type API
- type APIMock
- func (mock *APIMock) RegisterRoutes(ctx context.Context, routes ...Route) error
- func (mock *APIMock) RegisterRoutesCalls() []struct{ ... }
- func (mock *APIMock) Run(ctx context.Context) error
- func (mock *APIMock) RunCalls() []struct{ ... }
- func (mock *APIMock) Shutdown(ctx context.Context) error
- func (mock *APIMock) ShutdownCalls() []struct{ ... }
- type Config
- type ErrCreateOpenapiSchema
- type Route
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶ added in v0.3.1
type APIMock ¶ added in v0.3.1
type APIMock struct {
// RegisterRoutesFunc mocks the RegisterRoutes method.
RegisterRoutesFunc func(ctx context.Context, routes ...Route) error
// RunFunc mocks the Run method.
RunFunc func(ctx context.Context) error
// ShutdownFunc mocks the Shutdown method.
ShutdownFunc func(ctx context.Context) error
// contains filtered or unexported fields
}
APIMock is a mock implementation of API.
func TestSomethingThatUsesAPI(t *testing.T) {
// make and configure a mocked API
mockedAPI := &APIMock{
RegisterRoutesFunc: func(ctx context.Context, routes ...Route) error {
panic("mock out the RegisterRoutes method")
},
RunFunc: func(ctx context.Context) error {
panic("mock out the Run method")
},
ShutdownFunc: func(ctx context.Context) error {
panic("mock out the Shutdown method")
},
}
// use mockedAPI in code that requires API
// and then make assertions.
}
func (*APIMock) RegisterRoutes ¶ added in v0.3.1
RegisterRoutes calls RegisterRoutesFunc.
func (*APIMock) RegisterRoutesCalls ¶ added in v0.3.1
RegisterRoutesCalls gets all the calls that were made to RegisterRoutes. Check the length with:
len(mockedAPI.RegisterRoutesCalls())
func (*APIMock) RunCalls ¶ added in v0.3.1
RunCalls gets all the calls that were made to Run. Check the length with:
len(mockedAPI.RunCalls())
func (*APIMock) ShutdownCalls ¶ added in v0.3.1
ShutdownCalls gets all the calls that were made to Shutdown. Check the length with:
len(mockedAPI.ShutdownCalls())
type Config ¶ added in v0.3.1
type Config struct {
ListeningAddress string `yaml:"address" mapstructure:"address"`
Tls TLSConfig `yaml:"tls" mapstructure:"tls"`
}
Config is the configuration for the data API
type ErrCreateOpenapiSchema ¶ added in v0.3.1
type ErrCreateOpenapiSchema struct {
// contains filtered or unexported fields
}
func (ErrCreateOpenapiSchema) Error ¶ added in v0.3.1
func (e ErrCreateOpenapiSchema) Error() string
Click to show internal directories.
Click to hide internal directories.