utils

package
v0.0.0-...-ddd6cb9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, s string) []string

AppendIfMissing appends string to a slice if it's not contains it

func CreateErrorFromValue

func CreateErrorFromValue(statusCode int, v []byte) error

CreateErrorFromValue creates error from azure response

func FromBToS

func FromBToS(pointer *[]byte) string

FromBToS converts byte pointer to string

func NewServicePrincipalTokenFromCredentials

func NewServicePrincipalTokenFromCredentials(c map[string]string, scope string) (*adal.ServicePrincipalToken, error)

NewServicePrincipalTokenFromCredentials creates a new ServicePrincipalToken using values of the passed credentials map.

func S

func S(input string) *string

S converts string to string pointer

func ToI

func ToI(pointer *int32) int

ToI converts integer pointer to integer

func ToJSON

func ToJSON(v interface{}) (string, error)

ToJSON returns the passed item as a pretty-printed JSON string. If any JSON error occurs, it returns the empty string.

func ToS

func ToS(pointer *string) string

ToS converts stirng pointer to string

Types

type AKSError

type AKSError struct {
	StatusCode int
	Message    string
}

AKSError describes a client error

func NewErr

func NewErr(params ...interface{}) *AKSError

NewErr creates new AKS error Params: 1 - Message string 2 - StatusCode int

func (*AKSError) Error

func (e *AKSError) Error() string

type AzureServerError

type AzureServerError struct {
	Message string `json:"message"`
}

AzureServerError describes an Azure error

Jump to

Keyboard shortcuts

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