client

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MPL-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrEmptyRequestOption

func IsErrEmptyRequestOption(pErr error) bool

func IsErrReauthFailed

func IsErrReauthFailed(pErr error) bool

func NewErrEmptyReauthFunction

func NewErrEmptyReauthFunction(pInfo string) vconError.IErrorBuilder

func NewErrReauthFailed

func NewErrReauthFailed(pInfo string) vconError.IErrorBuilder

Types

type Cloud

type Cloud struct {
	VServerGatewayURL       string `yaml:"vserver_gateway_url,omitempty" json:"vserver_gateway_url,omitempty"`
	VLoadBalancerGatewayURL string `yaml:"vloadbalancer_gateway_url,omitempty" json:"vloadbalancer_gateway_url,omitempty"`
	IamGatewayURL           string `yaml:"iam_gateway_url,omitempty" json:"iam_gateway_url,omitempty"`
	ClienID                 string `yaml:"client_id,omitempty" json:"client_id,omitempty"`
	ClientSecret            string `yaml:"client_secret,omitempty" json:"client_secret,omitempty"`
	DatabaseDSN             string `yaml:"database_dsn,omitempty" json:"database_dsn,omitempty"`
	CacheExpireIn           int    `yaml:"cache_expire_in,omitempty" json:"cache_expire_in,omitempty"`
}

type Clouds

type Clouds struct {
	Clouds map[string]Cloud `yaml:"clouds" json:"clouds"`
}

type ErrEmptyReauthFunction

type ErrEmptyReauthFunction struct {
	vconError.BaseError
}

func (*ErrEmptyReauthFunction) Error

func (s *ErrEmptyReauthFunction) Error() string

type ErrReauthFailed

type ErrReauthFailed struct {
	vconError.BaseError
}

func (*ErrReauthFailed) Error

func (s *ErrReauthFailed) Error() string

type ProviderClient

type ProviderClient struct {
	IdentityEndpoint string
	AccessToken      string
	UserAgent        string
	HTTPClient       *req.Client
	ReauthFunc       func() error
	ThrowAway        bool
	Context          context.Context
	// contains filtered or unexported fields
}

func (*ProviderClient) IsThrowAway

func (s *ProviderClient) IsThrowAway() bool

func (*ProviderClient) Reauthenticate

func (s *ProviderClient) Reauthenticate() error

func (*ProviderClient) Request

func (s *ProviderClient) Request(pMethod, pUrl string, pOpts *RequestOpts) (*req.Response, error)

func (*ProviderClient) SetAccessToken

func (s *ProviderClient) SetAccessToken(pNewAccessToken string)

func (*ProviderClient) SetThrowaway

func (s *ProviderClient) SetThrowaway(pIsThrowAway bool)

func (*ProviderClient) SetUserAgent

func (s *ProviderClient) SetUserAgent(pUserAgent string)

func (*ProviderClient) UseHTTPClient

func (s *ProviderClient) UseHTTPClient()

func (*ProviderClient) UseTokenLock

func (s *ProviderClient) UseTokenLock()

type RequestOpts

type RequestOpts struct {
	JSONBody     interface{}
	JSONResponse interface{}
	JSONError    interface{}
	OkCodes      []int
	MoreHeaders  map[string]string
	OmitHeaders  []string
}

type ServiceClient

type ServiceClient struct {
	Endpoint    string
	Type        string
	MoreHeaders map[string]string

	*ProviderClient
}

func (*ServiceClient) Delete

func (s *ServiceClient) Delete(pUrl string, pOpts *RequestOpts) (*req.Response, error)

func (*ServiceClient) Get

func (s *ServiceClient) Get(pUrl string, pOpts *RequestOpts) (*req.Response, error)

func (*ServiceClient) Post

func (s *ServiceClient) Post(pUrl string, pOpts *RequestOpts) (*req.Response, error)

func (*ServiceClient) Put

func (s *ServiceClient) Put(pUrl string, pOpts *RequestOpts) (*req.Response, error)

func (*ServiceClient) Request

func (s *ServiceClient) Request(pMethod, pUrl string, pOpts *RequestOpts) (*req.Response, error)

func (*ServiceClient) ServiceURL

func (s *ServiceClient) ServiceURL(pParts ...string) string

Jump to

Keyboard shortcuts

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