utils

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	AzureClientID           = "AZURE_CLIENT_ID"
	AzureClientSecret       = "AZURE_CLIENT_SECRET" //nolint:gosec
	AzureFederatedTokenFile = "AZURE_FEDERATED_TOKEN_FILE"
	AzureTenantID           = "AZURE_TENANT_ID"
)
View Source
const (
	DefaultMaxRetries    = 3
	DefaultMaxRetryDelay = 60 * time.Second
	DefaultRetryDelay    = 5 * time.Second
)
View Source
const (
	ModuleName    = "sigs.k8s.io/cloud-provider-azure/pkg/azclient"
	ModuleVersion = "v0.0.1"
)
View Source
const (
	AzureStackCloudName = "AZURESTACKCLOUD"
)

Variables

View Source
var DefaultTransport *http.Transport
View Source
var TracingProvider tracing.Provider

Functions

func ClientNameFromContext

func ClientNameFromContext(ctx context.Context) (string, bool)

func ContextWithClientName

func ContextWithClientName(ctx context.Context, clientName string) context.Context

func ContextWithRequestMethod

func ContextWithRequestMethod(ctx context.Context, methodRequest string) context.Context

func ContextWithResourceGroupName

func ContextWithResourceGroupName(ctx context.Context, resourceGroupName string) context.Context

func ContextWithSubscriptionID

func ContextWithSubscriptionID(ctx context.Context, subscriptionID string) context.Context

func GetDefaultAzCoreClientOption

func GetDefaultAzCoreClientOption() policy.ClientOptions

func GetDefaultOption

func GetDefaultOption() *arm.ClientOptions

func RequestMethodFromContext

func RequestMethodFromContext(ctx context.Context) (string, bool)

func ResourceGroupNameFromContext

func ResourceGroupNameFromContext(ctx context.Context) (string, bool)

func SubscriptionIDFromContext

func SubscriptionIDFromContext(ctx context.Context) (string, bool)

Types

type CreateOrUpdateFunc

type CreateOrUpdateFunc[Type interface{}] interface {
	CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, resourceParam Type) (*Type, error)
}

CreateOrUpdate creates or updates a service resource.

type DeleteFunc

type DeleteFunc[Type interface{}] interface {
	Delete(ctx context.Context, resourceGroupName string, resourceName string) error
}

Delete deletes a service resource by name.

type FuncPolicyWrapper

type FuncPolicyWrapper func(req *policy.Request) (*http.Response, error)

func (FuncPolicyWrapper) Do

type GetFunc

type GetFunc[Type interface{}] interface {
	Get(ctx context.Context, resourceGroupName string, resourceName string) (result *Type, rerr error)
}

Get gets the service resource

type GetWithExpandFunc

type GetWithExpandFunc[Type interface{}] interface {
	Get(ctx context.Context, resourceGroupName string, resourceName string, expand *string) (result *Type, rerr error)
}

Get gets the service resource

type ListFunc

type ListFunc[Type interface{}] interface {
	List(ctx context.Context, resourceGroupName string) (result []*Type, rerr error)
}

List gets a list of service resource in the resource group.

type PollerWrapper

type PollerWrapper[ResponseType interface{}] struct {
	// contains filtered or unexported fields
}

func NewPollerWrapper

func NewPollerWrapper[ResponseType interface{}](poller *runtime.Poller[ResponseType], err error) *PollerWrapper[ResponseType]

func (*PollerWrapper[ResponseType]) WaitforPollerResp

func (handler *PollerWrapper[ResponseType]) WaitforPollerResp(ctx context.Context) (result *ResponseType, err error)

Poller is the poller to be used for polling. assume that the poller will ends

type SubResourceCreateOrUpdateFunc

type SubResourceCreateOrUpdateFunc[Type interface{}] interface {
	CreateOrUpdate(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string, resourceParam Type) (*Type, error)
}

CreateOrUpdate creates or updates a service resource.

type SubResourceDeleteFunc

type SubResourceDeleteFunc[Type interface{}] interface {
	Delete(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string) error
}

Delete deletes a service resource by name.

type SubResourceGetFunc

type SubResourceGetFunc[Type interface{}] interface {
	Get(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string) (result *Type, rerr error)
}

Get gets the service resource

type SubResourceGetWithExpandFunc

type SubResourceGetWithExpandFunc[Type interface{}] interface {
	Get(ctx context.Context, resourceGroupName string, parentResourceName string, resourceName string, expand *string) (result *Type, rerr error)
}

Get gets the service resource

type SubResourceListFunc

type SubResourceListFunc[Type interface{}] interface {
	List(ctx context.Context, resourceGroupName string, parentResourceName string) (result []*Type, rerr error)
}

List gets a list of service resource in the resource group.

Directories

Path Synopsis
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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