serve

package
v1.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package serve provides the `serve` command for the CLI. The command starts the server.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedPlatform = errors.New("cannot start server, unsupported platform")

ErrUnsupportedPlatform is returned when serve is called by an unsupported platform

Functions

func Command

func Command(builder Builder) *cobra.Command

Command returns the BindPlane serve cobra command

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

type MockBuilder struct {
	mock.Mock
}

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

type MockBuilder_BuildServer_Call struct {
	*mock.Call
}

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 (*MockBuilder_BuildServer_Call) Run added in v1.21.0

func (*MockBuilder_BuildServer_Call) RunAndReturn added in v1.21.0

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

SupportsServer is a helper method to define mock.On call

type MockBuilder_SupportsServer_Call added in v1.21.0

type MockBuilder_SupportsServer_Call struct {
	*mock.Call
}

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 (*MockBuilder_SupportsServer_Call) Run added in v1.21.0

func (*MockBuilder_SupportsServer_Call) RunAndReturn added in v1.21.0

type MockServer added in v1.21.0

type MockServer struct {
	mock.Mock
}

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

func (*MockServer) Seed added in v1.21.0

func (_m *MockServer) Seed(ctx context.Context) error

Seed provides a mock function with given fields: ctx

func (*MockServer) Serve added in v1.21.0

func (_m *MockServer) Serve(ctx context.Context) error

Serve provides a mock function with given fields: ctx

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

type MockServer_Seed_Call struct {
	*mock.Call
}

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 (*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

type MockServer_Serve_Call struct {
	*mock.Call
}

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 (*MockServer_Serve_Call) Run added in v1.21.0

func (*MockServer_Serve_Call) RunAndReturn added in v1.21.0

func (_c *MockServer_Serve_Call) RunAndReturn(run func(context.Context) error) *MockServer_Serve_Call

type Server

type Server interface {
	// Seed will seed the BindPlane server.
	Seed(ctx context.Context) error

	// Serve will run a BindPlane server until an error occurs or the context is canceled.
	Serve(ctx context.Context) error
}

Server is an interface for serving BindPlane.

func NewServer

func NewServer(cfg *config.Config, s store.Store, tracer tracer.Tracer,
	logger *zap.Logger, mp metrics.Provider, routeBuilder exposedserver.RouteBuilder,
) Server

NewServer returns a new Server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL