azure

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAzureBlobListLength

func GetAzureBlobListLength(ctx context.Context, podIdentity string, connectionString, blobContainerName string, accountName string, blobDelimiter string, blobPrefix string) (int, error)

GetAzureBlobListLength returns the count of the blobs in blob container in int

func GetAzureMetricValue

func GetAzureMetricValue(ctx context.Context, info MonitorInfo, podIdentity string) (int32, error)

GetAzureMetricValue returns the value of an Azure Monitor metric, rounded to the nearest int

func GetAzureQueueLength

func GetAzureQueueLength(ctx context.Context, podIdentity string, connectionString, queueName string, accountName string) (int32, error)

GetAzureQueueLength returns the length of a queue in int

func GetEventHubClient

func GetEventHubClient(info EventHubInfo) (*eventhub.Hub, error)

GetEventHubClient returns eventhub client

func ParseAzureEventHubConnectionString

func ParseAzureEventHubConnectionString(connectionString string) (string, string, error)

ParseAzureEventHubConnectionString parses Event Hub connection string into (namespace, name) Connection string should be in following format: Endpoint=sb://eventhub-namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=secretKey123;EntityPath=eventhub-name

func ParseAzureStorageBlobConnection

func ParseAzureStorageBlobConnection(podIdentity, connectionString, accountName string) (azblob.Credential, *url.URL, error)

ParseAzureStorageBlobConnection parses blob connection string and returns credential and resource url

func ParseAzureStorageQueueConnection

func ParseAzureStorageQueueConnection(podIdentity, connectionString, accountName string) (azqueue.Credential, *url.URL, error)

ParseAzureStorageQueueConnection parses queue connection string and returns credential and resource url

Types

type AADToken

type AADToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    string `json:"expires_in"`
	ExpiresOn    string `json:"expires_on"`
	NotBefore    string `json:"not_before"`
	Resource     string `json:"resource"`
	TokenType    string `json:"token_type"`
}

AADToken is the token from Azure AD

func GetAzureADPodIdentityToken

func GetAzureADPodIdentityToken(audience string) (AADToken, error)

GetAzureADPodIdentityToken returns the AADToken for resource

type Checkpoint

type Checkpoint struct {
	PartitionID    string `json:"PartitionId"`
	SequenceNumber int64  `json:"SequenceNumber"`
	// contains filtered or unexported fields
}

Checkpoint is the object eventhub processor stores in storage for checkpointing event processors. This matches the object stored by the eventhub C# sdk and Java sdk

func GetCheckpointFromBlobStorage

func GetCheckpointFromBlobStorage(ctx context.Context, info EventHubInfo, partitionID string) (Checkpoint, error)

GetCheckpointFromBlobStorage accesses Blob storage and gets checkpoint information of a partition

type EventHubInfo

type EventHubInfo struct {
	EventHubConnection    string
	EventHubConsumerGroup string
	StorageConnection     string
	BlobContainer         string
}

EventHubInfo to keep event hub connection and resources

type MonitorInfo

type MonitorInfo struct {
	ResourceURI         string
	TenantID            string
	SubscriptionID      string
	ResourceGroupName   string
	Name                string
	Filter              string
	AggregationInterval string
	AggregationType     string
	ClientID            string
	ClientPassword      string
}

MonitorInfo to create metric request

type StorageEndpointType

type StorageEndpointType int

StorageEndpointType for different types of storage provided by Azure

const (
	// BlobEndpoint storage type
	BlobEndpoint StorageEndpointType = iota
	// QueueEndpoint storage type
	QueueEndpoint
	// TableEndpoint storage type
	TableEndpoint
	// FileEndpoint storage type
	FileEndpoint
)

func (StorageEndpointType) Name

func (e StorageEndpointType) Name() string

Name returns resource name for StorageEndpointType

func (StorageEndpointType) Prefix

func (e StorageEndpointType) Prefix() string

Prefix returns prefix for a StorageEndpointType

Jump to

Keyboard shortcuts

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