config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config creates configuration structures based on provided json or yaml file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSchemaJson

type ConfigSchemaJson struct {
	// List of connections to object storage platforms that can be used for object
	// storage provisioning.
	Connections []Configuration `json:"connections,omitempty" yaml:"connections,omitempty" mapstructure:"connections,omitempty"`
}

this file contains JSON schema for Dell COSI Driver Configuration file

func New

func New(filename string) (*ConfigSchemaJson, error)

New takes filename and returns populated configuration struct.

func NewJSON

func NewJSON(bytes []byte) (*ConfigSchemaJson, error)

NewJSON takes array of bytes and unmarshals it, to return populated configuration struct. Array of bytes is expected to be in JSON format.

func NewYAML

func NewYAML(bytes []byte) (*ConfigSchemaJson, error)

NewYAML takes array of bytes and unmarshals it, to return populated configuration struct. Array of bytes is expected to be in YAML format.

type Configuration

type Configuration struct {
	// Objectscale corresponds to the JSON schema field "objectscale".
	Objectscale *Objectscale `json:"objectscale,omitempty" yaml:"objectscale,omitempty" mapstructure:"objectscale,omitempty"`
}

Configuration for single connection to object storage platform that is used for object storage provisioning

type Credentials

type Credentials struct {
	// Password for object storage provider
	Password string `json:"password" yaml:"password" mapstructure:"password"`

	// Username for object storage provider
	Username string `json:"username" yaml:"username" mapstructure:"username"`
}

Credentials used for authentication to object storage provider

func (*Credentials) UnmarshalJSON

func (j *Credentials) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Credentials) UnmarshalYAML

func (j *Credentials) UnmarshalYAML(b []byte) error

UnmarshalYAML implements yaml.Unmarshaler.

type Objectscale

type Objectscale struct {
	// Credentials corresponds to the JSON schema field "credentials".
	Credentials Credentials `json:"credentials" yaml:"credentials" mapstructure:"credentials"`

	// Indicates if the contents of the bucket should be emptied as part of the
	// deletion process
	EmptyBucket bool `json:"emptyBucket,omitempty" yaml:"emptyBucket,omitempty" mapstructure:"emptyBucket,omitempty"`

	// Default, unique identifier for the single connection.
	Id string `json:"id" yaml:"id" mapstructure:"id"`

	// Namespace associated with the user/tenant that is allowed to access the bucket
	Namespace string `json:"namespace" yaml:"namespace" mapstructure:"namespace"`

	// Endpoint of the ObjectScale Gateway Internal service
	ObjectscaleGateway string `json:"objectscale-gateway" yaml:"objectscale-gateway" mapstructure:"objectscale-gateway"`

	// The ID of the Objectscale the driver should communicate with
	ObjectscaleId string `json:"objectscale-id" yaml:"objectscale-id" mapstructure:"objectscale-id"`

	// Endpoint of the ObjectScale ObjectStore Management Gateway service
	ObjectstoreGateway string `json:"objectstore-gateway" yaml:"objectstore-gateway" mapstructure:"objectstore-gateway"`

	// The ID of the Objectstore under specific Objectscale, with which the driver
	// should communicate
	ObjectstoreId string `json:"objectstore-id" yaml:"objectstore-id" mapstructure:"objectstore-id"`

	// Protocols corresponds to the JSON schema field "protocols".
	Protocols Protocols `json:"protocols" yaml:"protocols" mapstructure:"protocols"`

	// Identity and Access Management (IAM) API specific field, points to the region
	// in which object storage provider is installed
	Region *string `json:"region,omitempty" yaml:"region,omitempty" mapstructure:"region,omitempty"`

	// Tls corresponds to the JSON schema field "tls".
	Tls Tls `json:"tls" yaml:"tls" mapstructure:"tls"`
}

Configuration specific to the Dell ObjectScale platform

func (*Objectscale) UnmarshalJSON

func (j *Objectscale) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Objectscale) UnmarshalYAML

func (j *Objectscale) UnmarshalYAML(b []byte) error

UnmarshalYAML implements yaml.Unmarshaler.

type Protocols

type Protocols struct {
	// S3 corresponds to the JSON schema field "s3".
	S3 *S3 `json:"s3,omitempty" yaml:"s3,omitempty" mapstructure:"s3,omitempty"`
}

Protocols supported by the connection

type S3

type S3 struct {
	// Endpoint of the ObjectStore S3 service
	Endpoint string `json:"endpoint" yaml:"endpoint" mapstructure:"endpoint"`
}

S3 configuration

func (*S3) UnmarshalJSON

func (j *S3) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*S3) UnmarshalYAML

func (j *S3) UnmarshalYAML(b []byte) error

UnmarshalYAML implements yaml.Unmarshaler.

type Tls

type Tls struct {
	// Base64 encoded content of the clients's certificate file
	ClientCert *string `json:"client-cert,omitempty" yaml:"client-cert,omitempty" mapstructure:"client-cert,omitempty"`

	// Base64 encoded content of the clients's key certificate file
	ClientKey *string `json:"client-key,omitempty" yaml:"client-key,omitempty" mapstructure:"client-key,omitempty"`

	// Controls whether a client verifies the server's certificate chain and host name
	Insecure bool `json:"insecure" yaml:"insecure" mapstructure:"insecure"`

	// Base64 encoded content of the root certificate authority file
	RootCas *string `json:"root-cas,omitempty" yaml:"root-cas,omitempty" mapstructure:"root-cas,omitempty"`
}

TLS configuration details

func (*Tls) UnmarshalJSON

func (j *Tls) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Tls) UnmarshalYAML

func (j *Tls) UnmarshalYAML(b []byte) error

UnmarshalYAML implements yaml.Unmarshaler.

Jump to

Keyboard shortcuts

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