client

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NotFoundError is the error type returned in case of a 404 error. This is required to test for this kind of error.
	NotFoundError = clientError("404 Not Found")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Iscsi  *ISCSIService
	Nfs    *NFSService
	NvmeOf *NvmeOfService
	Status *StatusService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options ...Option) (*Client, error)

type ISCSIService

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

func (*ISCSIService) AddLogicalUnit

func (s *ISCSIService) AddLogicalUnit(ctx context.Context, iqn iscsi.Iqn, volume *common.VolumeConfig) (*common.VolumeConfig, error)

func (*ISCSIService) Create

func (*ISCSIService) Delete

func (s *ISCSIService) Delete(ctx context.Context, iqn iscsi.Iqn) error

func (*ISCSIService) DeleteLogicalUnit

func (s *ISCSIService) DeleteLogicalUnit(ctx context.Context, iqn iscsi.Iqn, lun int) error

func (*ISCSIService) Get

func (*ISCSIService) GetAll

func (s *ISCSIService) GetAll(ctx context.Context) ([]*iscsi.ResourceConfig, error)

func (*ISCSIService) GetLogicalUnit

func (s *ISCSIService) GetLogicalUnit(ctx context.Context, iqn iscsi.Iqn, lun int) (*common.VolumeConfig, error)

func (*ISCSIService) Start

func (s *ISCSIService) Start(ctx context.Context, iqn iscsi.Iqn) (*iscsi.ResourceConfig, error)

func (*ISCSIService) Stop

type LeveledLogger

type LeveledLogger interface {
	Errorf(string, ...interface{})
	Infof(string, ...interface{})
	Debugf(string, ...interface{})
	Warnf(string, ...interface{})
}

LeveledLogger interface implements the basic methods that a logger library needs

type LogLevel

type LogLevel string
const (
	LevelDebug LogLevel = "DEBUG"
	LevelInfo  LogLevel = "INFO"
	LevelWarn  LogLevel = "WARN"
	LevelError LogLevel = "ERROR"
)

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

Logger represents a standard logger interface

type NFSService

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

func (*NFSService) Create

func (s *NFSService) Create(ctx context.Context, config *nfs.ResourceConfig) (*nfs.ResourceConfig, error)

func (*NFSService) Delete

func (s *NFSService) Delete(ctx context.Context, name string) error

func (*NFSService) Get

func (s *NFSService) Get(ctx context.Context, name string) (*nfs.ResourceConfig, error)

func (*NFSService) GetAll

func (s *NFSService) GetAll(ctx context.Context) ([]*nfs.ResourceConfig, error)

func (*NFSService) Start

func (s *NFSService) Start(ctx context.Context, name string) (*nfs.ResourceConfig, error)

func (*NFSService) Stop

func (s *NFSService) Stop(ctx context.Context, name string) (*nfs.ResourceConfig, error)

type NvmeOfService

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

func (*NvmeOfService) AddVolume

func (s *NvmeOfService) AddVolume(ctx context.Context, nqn nvmeof.Nqn, volume *common.VolumeConfig) (*common.VolumeConfig, error)

func (*NvmeOfService) Create

func (*NvmeOfService) Delete

func (s *NvmeOfService) Delete(ctx context.Context, nqn nvmeof.Nqn) error

func (*NvmeOfService) DeleteVolume

func (s *NvmeOfService) DeleteVolume(ctx context.Context, nqn nvmeof.Nqn, volume int) error

func (*NvmeOfService) Get

func (*NvmeOfService) GetAll

func (*NvmeOfService) GetVolume

func (s *NvmeOfService) GetVolume(ctx context.Context, nqn nvmeof.Nqn, lun int) (*common.VolumeConfig, error)

func (*NvmeOfService) Start

func (*NvmeOfService) Stop

type Option

type Option func(*Client) error

Option configures a Client

func BaseURL

func BaseURL(URL *url.URL) Option

BaseURL is a Client's option to set the baseURL of the REST client.

func HTTPClient

func HTTPClient(httpClient *http.Client) Option

HTTPClient is a Client's option to set a specific http.Client.

func Log

func Log(logger interface{}) Option

Log is a client's option to set a Logger

type Status added in v1.3.0

type Status struct {
	Status string `json:"status"`
}

type StatusService added in v1.3.0

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

func (*StatusService) Get added in v1.3.0

func (s *StatusService) Get(ctx context.Context) (*Status, error)

type TestLogger

type TestLogger interface {
	Logf(string, ...interface{})
}

TestLogger represents a logger interface used in tests, as in testing.T

Jump to

Keyboard shortcuts

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