server

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(*ServiceV1) error

Opt is a functional option.

func WithGRPCListenURL

func WithGRPCListenURL(url *url.URL) Opt

WithGRPCListenURL configures the gRPC listener address from a given URL.

func WithGRPCServerOptions

func WithGRPCServerOptions(opts ...grpc.ServerOption) Opt

WithGRPCServerOptions configures the gRPC server options.

func WithLogger

func WithLogger(log hclog.Logger) Opt

WithLogger configures the logger.

func WithOperator

func WithOperator(op operation.Operator) Opt

WithOperator configures the servers operation operator.

type ServiceConfig

type ServiceConfig struct {
	ListenAddr net.Addr
}

ServiceConfig is the running service config.

type ServiceV1

type ServiceV1 struct {
	// contains filtered or unexported fields
}

ServiceV1 is the enos.v1.ServerService.

func New

func New(opts ...Opt) (*ServiceV1, error)

New takes options and returns an instance of ServiceV1.

func (*ServiceV1) CheckScenarios

func (s *ServiceV1) CheckScenarios(
	ctx context.Context,
	req *pb.CheckScenariosRequest,
) (
	*pb.CheckScenariosResponse,
	error,
)

CheckScenarios generates scenario terraform modules for each scenario that has been filtered for the workspace. It then validates and plans the generated module.

func (*ServiceV1) DestroyScenarios

func (s *ServiceV1) DestroyScenarios(
	ctx context.Context,
	req *pb.DestroyScenariosRequest,
) (
	*pb.DestroyScenariosResponse,
	error,
)

DestroyScenarios destroys scenarios.

func (*ServiceV1) ExecScenarios

func (s *ServiceV1) ExecScenarios(
	ctx context.Context,
	req *pb.ExecScenariosRequest,
) (
	*pb.ExecScenariosResponse,
	error,
)

ExecScenarios executes a Terraform sub-command in the context of scenarios.

func (*ServiceV1) Format

func (s *ServiceV1) Format(
	ctx context.Context,
	req *pb.FormatRequest,
) (
	*pb.FormatResponse,
	error,
)

Format does formatting on Enos configuration.

func (*ServiceV1) GenerateScenarios

func (s *ServiceV1) GenerateScenarios(
	ctx context.Context,
	req *pb.GenerateScenariosRequest,
) (
	*pb.GenerateScenariosResponse,
	error,
)

GenerateScenarios generates scenario Terraform modules and configuration.

func (*ServiceV1) GetVersion

func (s *ServiceV1) GetVersion(
	ctx context.Context,
	req *pb.GetVersionRequest,
) (
	*pb.GetVersionResponse,
	error,
)

GetVersion returns the version information.

func (*ServiceV1) LaunchScenarios

func (s *ServiceV1) LaunchScenarios(
	ctx context.Context,
	req *pb.LaunchScenariosRequest,
) (
	*pb.LaunchScenariosResponse,
	error,
)

LaunchScenarios generates scenario terraform modules for each scenario that has been filtered for the workspace. It then validates the generated module and returns the results.

func (*ServiceV1) ListSamples

func (s *ServiceV1) ListSamples(
	ctx context.Context,
	req *pb.ListSamplesRequest,
) (
	*pb.ListSamplesResponse,
	error,
)

ListSamples returns a list of samples.

func (*ServiceV1) ListScenarios

ListScenarios returns a list of scenarios and their variants.

func (*ServiceV1) ObserveSample

func (s *ServiceV1) ObserveSample(
	ctx context.Context,
	req *pb.ObserveSampleRequest,
) (
	*pb.ObserveSampleResponse,
	error,
)

ObserveSample returns an observation of a sample.

func (*ServiceV1) Operation

func (s *ServiceV1) Operation(
	ctx context.Context,
	req *pb.OperationRequest,
) (*pb.OperationResponse, error)

Operation takes an operation request with an operation ID and returns the value of the operation.

func (*ServiceV1) OperationEventStream

OperationEventStream takes an operation request with an operation ID and streams the operation response events. Messages will be populated with updates and the final message will be populated with a complete response. When the operation is not in a failed or completed state the stream will remain open until the operation is cancelled or completes.

func (*ServiceV1) OutlineScenarios

func (s *ServiceV1) OutlineScenarios(
	ctx context.Context,
	req *pb.OutlineScenariosRequest,
) (
	*pb.OutlineScenariosResponse,
	error,
)

OutlineScenarios returns an outline of scenarios.

func (*ServiceV1) OutputScenarios

func (s *ServiceV1) OutputScenarios(
	ctx context.Context,
	req *pb.OutputScenariosRequest,
) (
	*pb.OutputScenariosResponse,
	error,
)

OutputScenarios returns scenario outputs.

func (*ServiceV1) RunScenarios

func (s *ServiceV1) RunScenarios(
	ctx context.Context,
	req *pb.RunScenariosRequest,
) (
	*pb.RunScenariosResponse,
	error,
)

RunScenarios generates scenario terraform modules for each scenario that has been filtered for the workspace. It then validates the generated module, runs it, and then destroys it.

func (*ServiceV1) Start

func (s *ServiceV1) Start(ctx context.Context) (*ServiceConfig, error)

Start takes a context and starts the server. It returns any immediate errors and a service config. Fatal errors encountered will automatically stop the server.

func (*ServiceV1) Stop

func (s *ServiceV1) Stop() error

Stop stops the service.

func (*ServiceV1) ValidateScenariosConfiguration

ValidateScenariosConfiguration validates a flight plan config.

Jump to

Keyboard shortcuts

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