bmc

package
v0.0.0-...-d7b82ac Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(name string) *string

String returns a pointer to the string value passed in.

Types

type Config

type Config struct {
	User        *string
	Fingerprint *string
	KeyFile     *string
	PassPhrase  *string
	Tenancy     *string
	Region      *string
	APIEndpoint *url.URL
	MaxRetries  *int
	// An integer value representing the logging level. The default log level
	// is zero (LogOff), which represents no logging. To enable logging set
	// to a LogLevel Value.
	LogLevel *LogLevelType
	// The logger writer interface to write logging messages to. Defaults to
	// standard out.
	Logger Logger
	// The HTTP client to use when sending requests. Defaults to
	// `http.DefaultClient`.
	HTTPClient *http.Client
}

A Config provides service configuration for service clients.

func FromConfigFile

func FromConfigFile(profile string) *Config

FromConfigFile retrieves the configuration from the BMC config

func NewConfig

func NewConfig() *Config

NewConfig returns a new Config pointer that can be chained

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

Error is the BMC error defined as: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/responses/Error

func NewError

func NewError(resp http.Response) *Error

NewError returns a pointer to the BMC error

type LogLevelType

type LogLevelType uint

A LogLevelType defines the level logging should be performed at. Used to instruct the SDK which statements should be logged.

const (
	// LogOff states that no logging should be performed by the SDK. This is the
	// default state of the SDK, and should be use to disable all logging.
	LogOff LogLevelType = iota * 0x1000

	// LogDebug state that debug output should be logged by the SDK. This should
	// be used to inspect request made and responses received.
	LogDebug
)
const (
	// LogDebugWithSigning states that the SDK should log request signing and
	// presigning events. This should be used to log the signing details of
	// requests for debugging. Will also enable LogDebug.
	LogDebugWithSigning LogLevelType = LogDebug | (1 << iota)

	// LogDebugWithHTTPBody states the SDK should log HTTP request and response
	// HTTP bodys in addition to the headers and path. This should be used to
	// see the body content of requests and responses made while using the SDK
	// Will also enable LogDebug.
	LogDebugWithHTTPBody

	// LogDebugWithRequestRetries states the SDK should log when service requests will
	// be retried. This should be used to log when you want to log when service
	// requests are being retried. Will also enable LogDebug.
	LogDebugWithRequestRetries

	// LogDebugWithRequestErrors states the SDK should log when service requests fail
	// to build, send, validate, or unmarshal.
	LogDebugWithRequestErrors
)

Debug Logging Sub Levels

func LogLevel

func LogLevel(l LogLevelType) *LogLevelType

LogLevel returns the pointer to a LogLevel. Should be used to workaround not being able to take the address of a non-composite literal.

func (*LogLevelType) Value

func (l *LogLevelType) Value() LogLevelType

Value returns the LogLevel value or the default value LogOff if the LogLevel is nil. Safe to use on nil value LogLevelTypes.

type Logger

type Logger interface {
	Log(...interface{})
}

A Logger is a minimalistic interface for the SDK to log messages to. Should be used to provide custom logging writers for the SDK to use.

Jump to

Keyboard shortcuts

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