config

package
v0.0.0-...-1e6525a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHeaders

func FormatHeaders(headers http.Header, seperator string) string

FormatHeaders processes a headers object plus a deliminator, returning a string

func ReadContents

func ReadContents(poc string) (string, bool, error)

ReadContents from file path

func RedactHeaders

func RedactHeaders(headers http.Header) (processedHeaders []string)

RedactHeaders processes a headers object, returning a redacted list

Types

type CloudCredentials

type CloudCredentials struct {
	Global struct {
		TenantID         string `gcfg:"tenant-id"`
		DomainName       string `gcfg:"domain-name"`
		Username         string
		Password         string
		AccessKey        string `gcfg:"access-key"`
		SecretKey        string `gcfg:"secret-key"`
		Region           string `gcfg:"region"`
		AvailabilityZone string `gcfg:"availability-zone"`
		ProjectName      string `gcfg:"project-name"`
		ProjectId        string `gcfg:"project-id"`
		AuthURL          string `gcfg:"auth-url"`
	}

	Vpc struct {
		Id              string `gcfg:"id"`
		SubnetId        string `gcfg:"subnet-id"`
		SecurityGroupId string `gcfg:"security-group-id"`
	}

	Ext struct {
		ShareProto string `gcfg:"share-proto"`
	}

	CloudClient *golangsdk.ProviderClient
}

CloudCredentials define

func LoadConfig

func LoadConfig(configFile string) (cc CloudCredentials, err error)

LoadConfig from file

func (*CloudCredentials) EFSV1Client

func (c *CloudCredentials) EFSV1Client() (*golangsdk.ServiceClient, error)

EFSV1Client return efs v1 client

func (*CloudCredentials) SFSV2Client

func (c *CloudCredentials) SFSV2Client() (*golangsdk.ServiceClient, error)

SFSV2Client return sfs-turbo v2 client

func (*CloudCredentials) Validate

func (c *CloudCredentials) Validate() error

Validate CloudCredentials

type LogRoundTripper

type LogRoundTripper struct {
	Rt      http.RoundTripper
	OsDebug bool
}

LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client RoundTripper to allow for logging.

func (*LogRoundTripper) RoundTrip

func (lrt *LogRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip performs a round-trip HTTP request and logs relevant information about it.

Jump to

Keyboard shortcuts

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