Documentation ¶
Overview ¶
Package storage provides a client around Azure Blob Storage for sending data that will be used by the ARN service.
Usage:
cli, err := storage.New("https://myaccount.blob.core.windows.net", cred) if err != nil { log.Fatal(err) } defer cli.Close() if err := cli.Upload(ctx, "my-id", []byte("my-data")); err != nil { log.Fatal(err) }
Changes from the original:
- Moved to the slog package and from passing logrus via context.
- No longer use any logging from azcore.
- Made the credential cache non-blocking with background refreshes instead of stop the world refreshes - Used the exponential backoff package for retries - Moved to standard go options for constructors - Removed use of "to" package for pointer creation, replaced with a simple generic function - Wrote tests and changed structure to help with testing - Did some re-ordering of events to avoid making unnecessary calls in certain failiure cases
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for interacting with Azure Blob Storage for pushing and pulling data used by the ARN service.
type Option ¶
Option is a function that sets an option on the client.
func WithContainerExt ¶
WithContainerExt sets a name extension for a blob container. This can be useful for doing discovery of containers that are created by a particular client. Names are in the format "arm-ext-nt-YYYY-MM-DD". This will cause the client to create "arm-ext-nt-[ext]-YYYY-MM-DD". Note characters must be letters, numbers, or hyphens. Any letters will be automatically lowercased. The ext cannot be more than 41 characters.
func WithFake ¶ added in v0.1.1
WithFake sets a fake uploader for testing purposes. This will cause the client to use the fake Upload() method instead of the real one. Can only be used in testing.
func WithLogger ¶
WithLogger sets the logger on the client. By default it uses slog.Default().
func WithPolicyOptions ¶
func WithPolicyOptions(opts policy.ClientOptions) Option
WithPolicyOptions sets the policy options for the service.Client. By default it uses the default policy options.