aperture

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlowStatusStrings added in v1.0.0

func FlowStatusStrings() []string

FlowStatusStrings returns a slice of all String values of the enum

Types

type Client

type Client interface {
	StartFlow(ctx context.Context, controlPoint string, labels map[string]string) (Flow, error)
	Shutdown(ctx context.Context) error
	HTTPMiddleware(controlPoint string, labels map[string]string, timeout time.Duration) func(http.Handler) http.Handler
	GRPCUnaryInterceptor(controlPoint string, labels map[string]string, timeout time.Duration) func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
}

Client is the interface that is provided to the user upon which they can perform Check calls for their service and eventually shut down in case of error.

func NewClient

func NewClient(ctx context.Context, opts Options) (Client, error)

NewClient returns a new Client that can be used to perform Check calls. The user will pass in options which will be used to create a connection with otel and a tracerProvider retrieved from such connection.

type Flow

type Flow interface {
	Accepted() bool
	End(status FlowStatus) error
	CheckResponse() *flowcontrol.CheckResponse
}

Flow is the interface that is returned to the user every time a Check call through ApertureClient is made. The user can check the status of the check call, response from the server, and end the flow once the workload is executed.

type FlowStatus added in v1.0.0

type FlowStatus uint8

FlowStatus represents status of flow execution.

const (
	// OK indicates successful flow execution.
	OK FlowStatus = iota
	// Error indicate error on flow execution.
	Error
)

User passes a code to indicate status of flow execution.

func FlowStatusString added in v1.0.0

func FlowStatusString(s string) (FlowStatus, error)

FlowStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func FlowStatusValues added in v1.0.0

func FlowStatusValues() []FlowStatus

FlowStatusValues returns all values of the enum

func (FlowStatus) IsAFlowStatus added in v1.0.0

func (i FlowStatus) IsAFlowStatus() bool

IsAFlowStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (FlowStatus) String added in v1.0.0

func (i FlowStatus) String() string

type Options

type Options struct {
	ApertureAgentGRPCClientConn *grpc.ClientConn
	CheckTimeout                time.Duration
	Logger                      *logr.Logger
}

Options that the user can pass to Aperture in order to receive a new Client. FlowControlClientConn and OTLPExporterClientConn are required.

Jump to

Keyboard shortcuts

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