azure

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 19 Imported by: 2

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 AzureMonitorInfo) (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)

func ParseAzureStorageQueueConnection

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

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)

type AzureMonitorInfo

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

type AzureStorageEndpointType

type AzureStorageEndpointType int
const (
	BlobEndpoint AzureStorageEndpointType = iota
	QueueEndpoint
	TableEndpoint
	FileEndpoint
)

func (AzureStorageEndpointType) Name

func (AzureStorageEndpointType) Prefix

func (e AzureStorageEndpointType) Prefix() string

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
}

Jump to

Keyboard shortcuts

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