external

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InterfaceFactoryKey = Key("invV2 external-server-interface key")

InterfaceFactoryKey is the key used to store instance of InterfaceFactory in context.

Functions

func WithServerInterface

func WithServerInterface(ctx context.Context) context.Context

WithServerInterface adds the external server interface to context.

func WithTestingContext

func WithTestingContext(ctx context.Context) context.Context

WithTestingContext allows for mocked external interface.

Types

type InterfaceFactory

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

InterfaceFactory provides a collection of interfaces to external clients.

func GetServerInterface

func GetServerInterface(ctx context.Context) (*InterfaceFactory, error)

GetServerInterface retrieves the ExternalServerInterface from context.

func (*InterfaceFactory) NewUFSInterfaceFactory

func (es *InterfaceFactory) NewUFSInterfaceFactory(ctx context.Context, host string) (UFSClient, error)

NewUFSInterfaceFactory creates a new UFSInterface.

type Key

type Key string

Key is a type for use in adding values to context. It is not recommended to use plain string as key.

type UFSClient

type UFSClient interface {
	GetDutState(ctx context.Context, in *ufsapi.GetDutStateRequest, opts ...grpc.CallOption) (*lab.DutState, error)
	GetMachine(ctx context.Context, in *ufsapi.GetMachineRequest, opts ...grpc.CallOption) (*ufspb.Machine, error)
	GetMachineLSE(ctx context.Context, in *ufsapi.GetMachineLSERequest, opts ...grpc.CallOption) (*ufspb.MachineLSE, error)
	ListMachines(ctx context.Context, in *ufsapi.ListMachinesRequest, opts ...grpc.CallOption) (*ufsapi.ListMachinesResponse, error)
	ListMachineLSEs(ctx context.Context, in *ufsapi.ListMachineLSEsRequest, opts ...grpc.CallOption) (*ufsapi.ListMachineLSEsResponse, error)
	UpdateDutState(ctx context.Context, in *ufsapi.UpdateDutStateRequest, opts ...grpc.CallOption) (*lab.DutState, error)
	ListDutStates(ctx context.Context, in *ufsapi.ListDutStatesRequest, opts ...grpc.CallOption) (*ufsapi.ListDutStatesResponse, error)
	CreateMachineLSE(context.Context, *ufsapi.CreateMachineLSERequest, ...grpc.CallOption) (*ufspb.MachineLSE, error)
	CreateAsset(context.Context, *ufsapi.CreateAssetRequest, ...grpc.CallOption) (*ufspb.Asset, error)
	RackRegistration(context.Context, *ufsapi.RackRegistrationRequest, ...grpc.CallOption) (*ufspb.Rack, error)
	GetAsset(context.Context, *ufsapi.GetAssetRequest, ...grpc.CallOption) (*ufspb.Asset, error)
	GetRack(context.Context, *ufsapi.GetRackRequest, ...grpc.CallOption) (*ufspb.Rack, error)
	UpdateMachineLSE(context.Context, *ufsapi.UpdateMachineLSERequest, ...grpc.CallOption) (*ufspb.MachineLSE, error)
	DeleteMachineLSE(context.Context, *ufsapi.DeleteMachineLSERequest, ...grpc.CallOption) (*emptypb.Empty, error)
	UpdateAsset(context.Context, *ufsapi.UpdateAssetRequest, ...grpc.CallOption) (*ufspb.Asset, error)
}

UFSClient refers to the fake UFS client

type UFSInterfaceFactory

type UFSInterfaceFactory func(ctx context.Context, host string) (UFSClient, error)

UFSInterfaceFactory is a constructor for a api.UFSClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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