common

package
v0.0.0-...-d1b2497 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessKey = "ak"
	SecretKey = "sk"
)

Variables

This section is empty.

Functions

func GetAuthModeAccessKey

func GetAuthModeAccessKey(secret map[string]string) (cloud.Auth, error)

func GetCCEClusterIDFromNodeLabels

func GetCCEClusterIDFromNodeLabels(ctx context.Context) (string, error)

func GetNodeTopology

func GetNodeTopology(ctx context.Context, mode TopologyMode) (string, string, error)

Get node id and zone

func WithAuthMode

func WithAuthMode(mode cloud.AuthMode) func(options *DriverOptions)

func WithBCCEndpoint

func WithBCCEndpoint(endpoint string) func(options *DriverOptions)

func WithBOSEndpoint

func WithBOSEndpoint(endpoint string) func(options *DriverOptions)

func WithBosfsImage

func WithBosfsImage(image string) func(options *DriverOptions)

func WithCDSEndpoint

func WithCDSEndpoint(endpoint string) func(options *DriverOptions)

func WithClusterID

func WithClusterID(clusterID string) func(options *DriverOptions)

func WithEnableOnlineExpansion

func WithEnableOnlineExpansion(enableOnlineExpansion bool) func(options *DriverOptions)

func WithMaxVolumesPerNode

func WithMaxVolumesPerNode(maxVolumesPerNode int) func(options *DriverOptions)

func WithMode

func WithMode(mode DriverMode) func(options *DriverOptions)

func WithNodeID

func WithNodeID(nodeID string) func(options *DriverOptions)

func WithOverrideDriverName

func WithOverrideDriverName(driverName string) func(options *DriverOptions)

func WithRegion

func WithRegion(region string) func(options *DriverOptions)

func WithTopologyMode

func WithTopologyMode(mode TopologyMode) func(options *DriverOptions)

func WithVersion

func WithVersion(version string) func(options *DriverOptions)

func WithZone

func WithZone(zone string) func(options *DriverOptions)

Types

type ControllerOptions

type ControllerOptions struct {
	ClusterID string
}

type DriverMode

type DriverMode string
const (
	DriverModeController DriverMode = "controller"
	DriverModeNode       DriverMode = "node"
	DriverModeAll        DriverMode = "all"
)

type DriverOptions

type DriverOptions struct {
	ControllerOptions
	NodeOptions
	EndpointOptions
	ImageOptions
	OverrideDriverName    string
	DriverVersion         string
	Mode                  DriverMode
	AuthMode              cloud.AuthMode
	Region                string
	TopologyMode          TopologyMode
	EnableOnlineExpansion bool
}

type EndpointOptions

type EndpointOptions struct {
	BCCEndpoint string
	CDSEndpoint string
	BOSEndpoint string
}

type FileSystem

type FileSystem interface {
	PathExists(ctx context.Context, path string) (bool, error)
	MkdirAll(ctx context.Context, path string) error
	MakeFile(ctx context.Context, path string) error
	WriteFile(ctx context.Context, path string, content []byte) error
	RemovePath(ctx context.Context, path string) error
	RemoveAll(ctx context.Context, path string) error
}

func NewFS

func NewFS() FileSystem

type GRPCServer

type GRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) error
}

Defines GRPC server interfaces

func NewGRPCServer

func NewGRPCServer() GRPCServer

type ImageOptions

type ImageOptions struct {
	BosfsImage string
}

type NodeOptions

type NodeOptions struct {
	NodeID            string
	Zone              string
	MaxVolumesPerNode int
}

type TopologyMode

type TopologyMode string

Jump to

Keyboard shortcuts

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