client

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretTypeAzure azure secret type
	SecretTypeAzure corev1.SecretType = "azure"
)

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound check the error is Resource Not Found

Types

type Client

type Client struct {
	Config           *Config
	LoadBalancer     loadBalancerClient
	VM               virtualMachineClient
	NetworkInterface networkInterfaceClient
	SecurityGroup    securityGroupClient
	PublicIPAddress  publicIPAddressClient
}

Client defines the Azure clients we need

func NewClient

func NewClient(storeLister *core.StoreLister) (*Client, error)

NewClient returns a new Azure Client

func NewClientWithConfig

func NewClientWithConfig(config *Config) (*Client, error)

NewClientWithConfig returns a Azure Client by config

type Config

type Config struct {
	SubscriptionID string `json:"subscriptionID"`
	ClientID       string `json:"clientID"`
	ClientSecret   string `json:"clientSecret"`
	TenantID       string `json:"tenantID"`
}

Config defines the config data required by Azure

func NewConfig

func NewConfig(data map[string][]byte) *Config

NewConfig new config

type ServiceError

type ServiceError struct {
	StatusCode int
	Code       string
	Message    string
	Target     string
}

ServiceError for azure service return error

func NewServiceError

func NewServiceError(code string, message string) *ServiceError

NewServiceError create a service error

func ParseServiceError

func ParseServiceError(err error) *ServiceError

ParseServiceError parse azure error to ServiceError struct if the err is not service error, will return nil

func (*ServiceError) Error

func (e *ServiceError) Error() string

Jump to

Keyboard shortcuts

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