queues

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

Queue Storage Queues SDK for API version 2018-11-09

This package allows you to interact with the Queues Queue Storage API

Supported Authorizers

  • Azure Active Directory (for the Resource Endpoint https://storage.azure.com)
  • SharedKeyLite (Blob, File & Queue)

Example Usage

package main

import (
	"context"
	"fmt"
	"time"
	
	"github.com/Azure/go-autorest/autorest"
	"github.com/tombuildsstuff/giovanni/storage/2018-11-09/queue/queues"
)

func Example() error {
	accountName := "storageaccount1"
    storageAccountKey := "ABC123...."
    queueName := "myqueue"
    
    storageAuth := autorest.NewSharedKeyLiteAuthorizer(accountName, storageAccountKey)
    queuesClient := queues.New()
    queuesClient.Client.Authorizer = storageAuth
    
    ctx := context.TODO()
    metadata := map[string]string{
    	"hello": "world",
    }
    if _, err := queuesClient.Create(ctx, accountName, queueName, metadata); err != nil {
        return fmt.Errorf("Error creating Queue: %s", err)
    }
    
    return nil 
}

Documentation

Index

Constants

View Source
const APIVersion = "2018-11-09"

APIVersion is the version of the API used for all Storage API Operations

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

Types

type Client

type Client struct {
	autorest.Client
	BaseURI string
}

Client is the base client for Queue Storage Shares.

func New

func New() Client

New creates an instance of the Client client.

func NewWithEnvironment

func NewWithEnvironment(environment azure.Environment) Client

NewWithEnvironment creates an instance of the Client client.

func (Client) Create

func (client Client) Create(ctx context.Context, accountName, queueName string, metaData map[string]string) (result autorest.Response, err error)

Create creates the specified Queue within the specified Storage Account

func (Client) CreatePreparer

func (client Client) CreatePreparer(ctx context.Context, accountName string, queueName string, metaData map[string]string) (*http.Request, error)

CreatePreparer prepares the Create request.

func (Client) CreateResponder

func (client Client) CreateResponder(resp *http.Response) (result autorest.Response, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (Client) CreateSender

func (client Client) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (Client) Delete

func (client Client) Delete(ctx context.Context, accountName, queueName string) (result autorest.Response, err error)

Delete deletes the specified Queue within the specified Storage Account

func (Client) DeletePreparer

func (client Client) DeletePreparer(ctx context.Context, accountName string, queueName string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (Client) DeleteResponder

func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (Client) DeleteSender

func (client Client) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (Client) GetMetaData

func (client Client) GetMetaData(ctx context.Context, accountName, queueName string) (result GetMetaDataResult, err error)

GetMetaData returns the metadata for this Queue

func (Client) GetMetaDataPreparer

func (client Client) GetMetaDataPreparer(ctx context.Context, accountName, queueName string) (*http.Request, error)

GetMetaDataPreparer prepares the GetMetaData request.

func (Client) GetMetaDataResponder

func (client Client) GetMetaDataResponder(resp *http.Response) (result GetMetaDataResult, err error)

GetMetaDataResponder handles the response to the GetMetaData request. The method always closes the http.Response Body.

func (Client) GetMetaDataSender

func (client Client) GetMetaDataSender(req *http.Request) (*http.Response, error)

GetMetaDataSender sends the GetMetaData request. The method will close the http.Response Body if it receives an error.

func (Client) GetResourceID

func (client Client) GetResourceID(accountName, queueName string) string

GetResourceID returns the Resource ID for the given Queue This can be useful when, for example, you're using this as a unique identifier

func (Client) GetServiceProperties

func (client Client) GetServiceProperties(ctx context.Context, accountName string) (result StorageServicePropertiesResponse, err error)

SetServiceProperties gets the properties for this queue

func (Client) GetServicePropertiesPreparer

func (client Client) GetServicePropertiesPreparer(ctx context.Context, accountName string) (*http.Request, error)

GetServicePropertiesPreparer prepares the GetServiceProperties request.

func (Client) GetServicePropertiesResponder

func (client Client) GetServicePropertiesResponder(resp *http.Response) (result StorageServicePropertiesResponse, err error)

GetServicePropertiesResponder handles the response to the GetServiceProperties request. The method always closes the http.Response Body.

func (Client) GetServicePropertiesSender

func (client Client) GetServicePropertiesSender(req *http.Request) (*http.Response, error)

GetServicePropertiesSender sends the GetServiceProperties request. The method will close the http.Response Body if it receives an error.

func (Client) SetMetaData

func (client Client) SetMetaData(ctx context.Context, accountName, queueName string, metaData map[string]string) (result autorest.Response, err error)

SetMetaData returns the metadata for this Queue

func (Client) SetMetaDataPreparer

func (client Client) SetMetaDataPreparer(ctx context.Context, accountName, queueName string, metaData map[string]string) (*http.Request, error)

SetMetaDataPreparer prepares the SetMetaData request.

func (Client) SetMetaDataResponder

func (client Client) SetMetaDataResponder(resp *http.Response) (result autorest.Response, err error)

SetMetaDataResponder handles the response to the SetMetaData request. The method always closes the http.Response Body.

func (Client) SetMetaDataSender

func (client Client) SetMetaDataSender(req *http.Request) (*http.Response, error)

SetMetaDataSender sends the SetMetaData request. The method will close the http.Response Body if it receives an error.

func (Client) SetServiceProperties

func (client Client) SetServiceProperties(ctx context.Context, accountName string, properties StorageServiceProperties) (result autorest.Response, err error)

SetServiceProperties sets the properties for this queue

func (Client) SetServicePropertiesPreparer

func (client Client) SetServicePropertiesPreparer(ctx context.Context, accountName string, properties StorageServiceProperties) (*http.Request, error)

SetServicePropertiesPreparer prepares the SetServiceProperties request.

func (Client) SetServicePropertiesResponder

func (client Client) SetServicePropertiesResponder(resp *http.Response) (result autorest.Response, err error)

SetServicePropertiesResponder handles the response to the SetServiceProperties request. The method always closes the http.Response Body.

func (Client) SetServicePropertiesSender

func (client Client) SetServicePropertiesSender(req *http.Request) (*http.Response, error)

SetServicePropertiesSender sends the SetServiceProperties request. The method will close the http.Response Body if it receives an error.

type Cors

type Cors struct {
	CorsRule []CorsRule `xml:"CorsRule"`
}

type CorsRule

type CorsRule struct {
	AllowedOrigins  string `xml:"AllowedOrigins"`
	AllowedMethods  string `xml:"AllowedMethods"`
	AllowedHeaders  string `xml:"AllowedHeaders`
	ExposedHeaders  string `xml:"ExposedHeaders"`
	MaxAgeInSeconds int    `xml:"MaxAgeInSeconds"`
}

type GetMetaDataResult

type GetMetaDataResult struct {
	autorest.Response

	MetaData map[string]string
}

type LoggingConfig

type LoggingConfig struct {
	Version         string          `xml:"Version"`
	Delete          bool            `xml:"Delete"`
	Read            bool            `xml:"Read"`
	Write           bool            `xml:"Write"`
	RetentionPolicy RetentionPolicy `xml:"RetentionPolicy"`
}

type MetricsConfig

type MetricsConfig struct {
	Version         string          `xml:"Version"`
	Enabled         bool            `xml:"Enabled"`
	RetentionPolicy RetentionPolicy `xml:"RetentionPolicy"`

	// Element IncludeAPIs is only expected when Metrics is enabled
	IncludeAPIs *bool `xml:"IncludeAPIs,omitempty"`
}

type ResourceID

type ResourceID struct {
	AccountName string
	QueueName   string
}

func ParseResourceID added in v0.2.0

func ParseResourceID(id string) (*ResourceID, error)

ParseResourceID parses the Resource ID and returns an Object which can be used to interact with a Queue within a Storage Account

type RetentionPolicy

type RetentionPolicy struct {
	Enabled bool `xml:"Enabled"`
	Days    int  `xml:"Days"`
}

type StorageServiceProperties

type StorageServiceProperties struct {
	Logging       *LoggingConfig `xml:"Logging,omitempty"`
	HourMetrics   *MetricsConfig `xml:"HourMetrics,omitempty"`
	MinuteMetrics *MetricsConfig `xml:"MinuteMetrics,omitempty"`
	Cors          *Cors          `xml:"Cors,omitempty"`
}

type StorageServicePropertiesResponse

type StorageServicePropertiesResponse struct {
	StorageServiceProperties
	autorest.Response
}

Jump to

Keyboard shortcuts

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