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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InterfaceFactoryKey = util.Key("ufs 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 CfgInterfaceFactory

type CfgInterfaceFactory func(ctx context.Context) luciconfig.Interface

CfgInterfaceFactory is a contsructor for a luciconfig.Interface For potential unittest usage

type CrosInventoryClient

CrosInventoryClient refers to the fake inventory v2 client

type CrosInventoryInterfaceFactory

type CrosInventoryInterfaceFactory func(ctx context.Context, host string) (CrosInventoryClient, error)

CrosInventoryInterfaceFactory is a constructor for a invV2Api.InventoryClient

type GitInterfaceFactory

type GitInterfaceFactory func(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)

GitInterfaceFactory is a constructor for a git.ClientInterface

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) NewCfgInterface

func (es *InterfaceFactory) NewCfgInterface(ctx context.Context) luciconfig.Interface

NewCfgInterface creates a new config interface.

func (*InterfaceFactory) NewCrosInventoryInterfaceFactory

func (es *InterfaceFactory) NewCrosInventoryInterfaceFactory(ctx context.Context, host string) (CrosInventoryClient, error)

NewCrosInventoryInterfaceFactory creates a new CrosInventoryInterface.

func (*InterfaceFactory) NewGitInterface

func (es *InterfaceFactory) NewGitInterface(ctx context.Context, gitilesHost, project, branch string) (git.ClientInterface, error)

NewGitInterface creates a new git interface.

func (*InterfaceFactory) NewMachineDBInterfaceFactory

func (es *InterfaceFactory) NewMachineDBInterfaceFactory(ctx context.Context, host string) (crimson.CrimsonClient, error)

NewMachineDBInterfaceFactory creates a new machine DB interface.

func (*InterfaceFactory) NewSheetInterface

func (es *InterfaceFactory) NewSheetInterface(ctx context.Context) (sheet.ClientInterface, error)

NewSheetInterface creates a new Sheet interface.

type MachineDBInterfaceFactory

type MachineDBInterfaceFactory func(ctx context.Context, host string) (crimson.CrimsonClient, error)

MachineDBInterfaceFactory is a constructor for a crimson.CrimsonClient For potential unittest usage

type SheetInterfaceFactory

type SheetInterfaceFactory func(ctx context.Context) (sheet.ClientInterface, error)

SheetInterfaceFactory is a constructor for a sheet.ClientInterface

Jump to

Keyboard shortcuts

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