Documentation ¶
Overview ¶
Package serve provides the `serve` command for the CLI. The command starts the server.
Index ¶
- Variables
- func Command(builder Builder) *cobra.Command
- type Builder
- type MockBuilder
- type MockBuilder_BuildServer_Call
- func (_c *MockBuilder_BuildServer_Call) Return(_a0 Server, _a1 error) *MockBuilder_BuildServer_Call
- func (_c *MockBuilder_BuildServer_Call) Run(run func(ctx context.Context)) *MockBuilder_BuildServer_Call
- func (_c *MockBuilder_BuildServer_Call) RunAndReturn(run func(context.Context) (Server, error)) *MockBuilder_BuildServer_Call
- type MockBuilder_Expecter
- type MockBuilder_SupportsServer_Call
- type MockServer
- type MockServer_Expecter
- type MockServer_Seed_Call
- type MockServer_Serve_Call
- type Server
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedPlatform = errors.New("cannot start server, unsupported platform")
ErrUnsupportedPlatform is returned when serve is called by an unsupported platform
Functions ¶
Types ¶
type Builder ¶
type Builder interface { // Build returns a new Server. BuildServer(ctx context.Context) (Server, error) // SupportsServer returns true if the OS supports the serve command. // i.e. its not windows. SupportsServer() bool }
Builder is an interface for building a Server.
type MockBuilder ¶ added in v1.21.0
MockBuilder is an autogenerated mock type for the Builder type
func NewMockBuilder ¶ added in v1.21.0
func NewMockBuilder(t interface { mock.TestingT Cleanup(func()) }) *MockBuilder
NewMockBuilder creates a new instance of MockBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockBuilder) BuildServer ¶ added in v1.21.0
func (_m *MockBuilder) BuildServer(ctx context.Context) (Server, error)
BuildServer provides a mock function with given fields: ctx
func (*MockBuilder) EXPECT ¶ added in v1.21.0
func (_m *MockBuilder) EXPECT() *MockBuilder_Expecter
func (*MockBuilder) SupportsServer ¶ added in v1.21.0
func (_m *MockBuilder) SupportsServer() bool
SupportsServer provides a mock function with given fields:
type MockBuilder_BuildServer_Call ¶ added in v1.21.0
MockBuilder_BuildServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BuildServer'
func (*MockBuilder_BuildServer_Call) Return ¶ added in v1.21.0
func (_c *MockBuilder_BuildServer_Call) Return(_a0 Server, _a1 error) *MockBuilder_BuildServer_Call
func (*MockBuilder_BuildServer_Call) Run ¶ added in v1.21.0
func (_c *MockBuilder_BuildServer_Call) Run(run func(ctx context.Context)) *MockBuilder_BuildServer_Call
func (*MockBuilder_BuildServer_Call) RunAndReturn ¶ added in v1.21.0
func (_c *MockBuilder_BuildServer_Call) RunAndReturn(run func(context.Context) (Server, error)) *MockBuilder_BuildServer_Call
type MockBuilder_Expecter ¶ added in v1.21.0
type MockBuilder_Expecter struct {
// contains filtered or unexported fields
}
func (*MockBuilder_Expecter) BuildServer ¶ added in v1.21.0
func (_e *MockBuilder_Expecter) BuildServer(ctx interface{}) *MockBuilder_BuildServer_Call
BuildServer is a helper method to define mock.On call
- ctx context.Context
func (*MockBuilder_Expecter) SupportsServer ¶ added in v1.21.0
func (_e *MockBuilder_Expecter) SupportsServer() *MockBuilder_SupportsServer_Call
SupportsServer is a helper method to define mock.On call
type MockBuilder_SupportsServer_Call ¶ added in v1.21.0
MockBuilder_SupportsServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SupportsServer'
func (*MockBuilder_SupportsServer_Call) Return ¶ added in v1.21.0
func (_c *MockBuilder_SupportsServer_Call) Return(_a0 bool) *MockBuilder_SupportsServer_Call
func (*MockBuilder_SupportsServer_Call) Run ¶ added in v1.21.0
func (_c *MockBuilder_SupportsServer_Call) Run(run func()) *MockBuilder_SupportsServer_Call
func (*MockBuilder_SupportsServer_Call) RunAndReturn ¶ added in v1.21.0
func (_c *MockBuilder_SupportsServer_Call) RunAndReturn(run func() bool) *MockBuilder_SupportsServer_Call
type MockServer ¶ added in v1.21.0
MockServer is an autogenerated mock type for the Server type
func NewMockServer ¶ added in v1.21.0
func NewMockServer(t interface { mock.TestingT Cleanup(func()) }) *MockServer
NewMockServer creates a new instance of MockServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockServer) EXPECT ¶ added in v1.21.0
func (_m *MockServer) EXPECT() *MockServer_Expecter
type MockServer_Expecter ¶ added in v1.21.0
type MockServer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockServer_Expecter) Seed ¶ added in v1.21.0
func (_e *MockServer_Expecter) Seed(ctx interface{}) *MockServer_Seed_Call
Seed is a helper method to define mock.On call
- ctx context.Context
func (*MockServer_Expecter) Serve ¶ added in v1.21.0
func (_e *MockServer_Expecter) Serve(ctx interface{}) *MockServer_Serve_Call
Serve is a helper method to define mock.On call
- ctx context.Context
type MockServer_Seed_Call ¶ added in v1.21.0
MockServer_Seed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Seed'
func (*MockServer_Seed_Call) Return ¶ added in v1.21.0
func (_c *MockServer_Seed_Call) Return(_a0 error) *MockServer_Seed_Call
func (*MockServer_Seed_Call) Run ¶ added in v1.21.0
func (_c *MockServer_Seed_Call) Run(run func(ctx context.Context)) *MockServer_Seed_Call
func (*MockServer_Seed_Call) RunAndReturn ¶ added in v1.21.0
func (_c *MockServer_Seed_Call) RunAndReturn(run func(context.Context) error) *MockServer_Seed_Call
type MockServer_Serve_Call ¶ added in v1.21.0
MockServer_Serve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Serve'
func (*MockServer_Serve_Call) Return ¶ added in v1.21.0
func (_c *MockServer_Serve_Call) Return(_a0 error) *MockServer_Serve_Call
func (*MockServer_Serve_Call) Run ¶ added in v1.21.0
func (_c *MockServer_Serve_Call) Run(run func(ctx context.Context)) *MockServer_Serve_Call
func (*MockServer_Serve_Call) RunAndReturn ¶ added in v1.21.0
func (_c *MockServer_Serve_Call) RunAndReturn(run func(context.Context) error) *MockServer_Serve_Call