config

package
v0.0.0-...-4625a4a Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 17 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 {
		AccessKey   string `gcfg:"access-key"`
		SecretKey   string `gcfg:"secret-key"`
		Region      string `gcfg:"region"`
		ProjectName string `gcfg:"project-name"`
		ProjectId   string `gcfg:"project-id"`
		Password    string `gcfg:"password"`
		Username    string `gcfg:"username"`
		AuthURL     string `gcfg:"auth-url"`
		DomainID    string `gcfg:"domain-id"`
		DomainName  string `gcfg:"domain-name"`
		TenantID    string `gcfg:"tenant-id"`
	}

	Vpc struct {
		Id string `gcfg:"id"`
	}

	CloudClient *golangsdk.ProviderClient
}

CloudCredentials define

func LoadConfig

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

LoadConfig from file

func (*CloudCredentials) SFSV2Client

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

SFSV2Client return sfs 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