chassis

package
v0.0.0-...-8d2fcc7 Latest Latest
Warning

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

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

Documentation

Overview

Package chassis ...

Index

Constants

This section is empty.

Variables

View Source
var (
	//GetDbConnectFunc ...
	GetDbConnectFunc = common.GetDBConnection
	//GenericSaveFunc ...
	GenericSaveFunc = smodel.GenericSave
	//JSONUnmarshalFunc1  ...
	JSONUnmarshalFunc1 = json.Unmarshal
	//JSONUnmarshalFunc2  ...
	JSONUnmarshalFunc2 = json.Unmarshal
	//JSONUnmarshalFunc3  ...
	JSONUnmarshalFunc3 = json.Unmarshal
	//JSONUnmarshalFunc4  ...
	JSONUnmarshalFunc4 = json.Unmarshal
	//StrconvUnquote ...
	StrconvUnquote = strconv.Unquote
	//JSONMarshalFunc ...
	JSONMarshalFunc = json.Marshal
	//GetResourceFunc  ...
	GetResourceFunc = smodel.GetResource
)
View Source
var (
	//SmodelFindAllFunc ...
	SmodelFindAllFunc = smodel.FindAll
	//FindAllPluginsFunc ...
	FindAllPluginsFunc = findAllPlugins
)
View Source
var (
	//JSONUnmarshalFunc ...
	JSONUnmarshalFunc = json.Unmarshal
	//RequestParamsCaseValidatorFunc ...
	RequestParamsCaseValidatorFunc = common.RequestParamsCaseValidator
)
View Source
var (
	//ContactPluginFunc ...
	ContactPluginFunc = contactPlugin
)
View Source
var (
	// GetResourceInfoFromDeviceFunc function pointer for the scommon.GetResourceInfoFromDevice
	GetResourceInfoFromDeviceFunc = scommon.GetResourceInfoFromDevice
)

Functions

This section is empty.

Types

type Create

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

Create struct helps to create chassis

func NewCreateHandler

func NewCreateHandler(createPluginClient plugin.ClientFactory) *Create

NewCreateHandler returns an instance of Create struct

func (*Create) Handle

Handle defines the operations which handle the RPC request-response for creating a chassis

type Delete

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

Delete struct helps to delete chassis

func NewDeleteHandler

func NewDeleteHandler(createPluginClient plugin.ClientFactory, finder func(Table string, key string, r interface{}) *errors.Error) *Delete

NewDeleteHandler returns an instance of Delete struct

func (*Delete) Handle

Handle defines the operations which handle the RPC request-response for deleting a chassis

type Get

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

Get struct helps to get chassis resource information

func NewGetHandler

func NewGetHandler(
	pluginClientCreator plugin.ClientFactory,
	inMemoryDBFinder func(table, key string, r interface{}) *errors.Error) *Get

NewGetHandler returns an instance of Get Struct

func (*Get) Handle

Handle is used to fetch resource data. The function is supposed to be used as part of RPC For getting chassis resource information, parameters need to be passed Request . Request holds the Uuid and Url , Url will be parsed from that search key will created There will be two return values for the function. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.

type GetCollection

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

GetCollection struct helps to get chassis collection information

func NewGetCollectionHandler

func NewGetCollectionHandler(
	pcf plugin.ClientFactory,
	imkp func(table string) ([]string, error)) *GetCollection

NewGetCollectionHandler returns an instance of GetCollection struct

func (*GetCollection) Handle

func (h *GetCollection) Handle(ctx context.Context) (r response.RPC)

Handle defines the operations which handle the RPC request-response for getting chassis collection information

type PluginContact

type PluginContact struct {
	ContactClient   func(context.Context, string, string, string, string, interface{}, map[string]string) (*http.Response, error)
	DecryptPassword func([]byte) ([]byte, error)
	GetPluginStatus func(context.Context, smodel.Plugin) bool
}

PluginContact struct to inject the pmb client function into the handlers

func (*PluginContact) GetChassisResource

func (p *PluginContact) GetChassisResource(ctx context.Context, req *chassisproto.GetChassisRequest) (response.RPC, error)

GetChassisResource is used to fetch resource data. The function is supposed to be used as part of RPC For getting chassis resource information, parameters need to be passed Request . Request holds the Uuid and Url , Url will be parsed from that search key will created There will be two return values for the fuction. One is the RPC response, which contains the status code, status message, headers and body and the second value is error.

type PluginToken

type PluginToken struct {
	Tokens map[string]string
	// contains filtered or unexported fields
}

PluginToken interface to hold the token

var Token PluginToken

Token variable hold the all the XAuthToken against the plguin ID

type Update

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

Update struct helps to update chassis

func NewUpdateHandler

func NewUpdateHandler(pluginClientFactory plugin.ClientFactory) *Update

NewUpdateHandler returns an instance of Update struct

func (*Update) Handle

Handle defines the operations which handle the RPC request-response for updating a chassis

Jump to

Keyboard shortcuts

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