payload

package
v1.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package payload provides large-payload stores for Durable Task Scheduler.

AzureBlobStore is the production interoperable implementation for application payloads. The separate exporthistory.AzureBlobHistoryStore writes exported history objects. MemoryStore is process-local and non-durable, while FileStore requires every client and worker to share the same durable filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureBlobStore

type AzureBlobStore struct {
	// contains filtered or unexported fields
}

AzureBlobStore stores payloads in Azure Blob Storage using .NET-compatible blob:v2 tokens. It also resolves .NET's legacy blob:v1 tokens.

func NewAzureBlobStore

func NewAzureBlobStore(options AzureBlobStoreOptions) (*AzureBlobStore, error)

NewAzureBlobStore constructs a production Azure Blob Storage payload store.

func (*AzureBlobStore) IsLargePayloadToken

func (*AzureBlobStore) IsLargePayloadToken(value string) bool

IsLargePayloadToken recognizes both .NET Azure Blob token versions.

func (*AzureBlobStore) LargePayloadDefaults

func (s *AzureBlobStore) LargePayloadDefaults() (thresholdBytes, maxPayloadBytes int)

LargePayloadDefaults supplies Azure Blob's .NET-compatible defaults.

func (*AzureBlobStore) Resolve

func (s *AzureBlobStore) Resolve(ctx context.Context, location string) ([]byte, error)

func (*AzureBlobStore) ResolveToken

func (s *AzureBlobStore) ResolveToken(ctx context.Context, token string) ([]byte, error)

ResolveToken resolves a .NET blob:v1 or blob:v2 token.

func (*AzureBlobStore) Store

func (s *AzureBlobStore) Store(ctx context.Context, payload []byte) (string, error)

func (*AzureBlobStore) StoreToken

func (s *AzureBlobStore) StoreToken(ctx context.Context, payload []byte) (string, error)

StoreToken stores a payload and returns the unwrapped .NET blob:v2 token.

func (*AzureBlobStore) UsesInclusiveLargePayloadThreshold

func (*AzureBlobStore) UsesInclusiveLargePayloadThreshold() bool

UsesInclusiveLargePayloadThreshold matches the .NET Azure Blob extension.

func (*AzureBlobStore) ValidateLargePayloadOptions

func (s *AzureBlobStore) ValidateLargePayloadOptions(thresholdBytes, maxPayloadBytes int) error

ValidateLargePayloadOptions enforces the .NET Azure Blob extension's threshold limit and the store's configured payload cap.

func (*AzureBlobStore) ValidateLargePayloadToken

func (s *AzureBlobStore) ValidateLargePayloadToken(token string) error

ValidateLargePayloadToken validates a recognized token without accessing the network.

type AzureBlobStoreOptions

type AzureBlobStoreOptions struct {
	ConnectionString string
	AccountURL       string
	Credential       azcore.TokenCredential
	Container        string
	// CompressionEnabled defaults to true when nil.
	CompressionEnabled *bool
	// AllowedHosts explicitly permits cross-account blob:v2 reads with Credential.
	// .NET-authored blobs on these hosts may not include Go integrity metadata;
	// they remain bounded by MaxPayloadBytes.
	AllowedHosts      []string
	AllowInsecureHTTP bool
	MaxPayloadBytes   int
}

AzureBlobStoreOptions configures AzureBlobStore. Exactly one authentication mode must be supplied: ConnectionString, or AccountURL with Credential.

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

FileStore stores large payloads beneath one filesystem root.

Every client and worker that may resolve its references must mount the same durable filesystem at the same path. Container-local and other ephemeral filesystems lose references on restart and are not suitable for production.

func NewFileStore

func NewFileStore(root string, maxBytes ...int64) (*FileStore, error)

NewFileStore creates a filesystem-backed store with an optional payload limit.

func (*FileStore) Resolve

func (s *FileStore) Resolve(ctx context.Context, location string) ([]byte, error)

Resolve reads a payload location created by this store.

func (*FileStore) Store

func (s *FileStore) Store(ctx context.Context, payload []byte) (string, error)

Store writes one payload beneath the configured root.

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

MemoryStore is a process-local, non-durable large-payload store.

References become unreadable when the process restarts and cannot be resolved by clients or workers in another process. Use it only for tests and single-process experiments; use AzureBlobStore for production DTS workloads.

func NewMemoryStore

func NewMemoryStore(maxBytes ...int) *MemoryStore

NewMemoryStore creates a process-local store with an optional payload limit.

func (*MemoryStore) Resolve

func (s *MemoryStore) Resolve(ctx context.Context, location string) ([]byte, error)

Resolve reads a payload previously stored by this process.

func (*MemoryStore) Store

func (s *MemoryStore) Store(ctx context.Context, payload []byte) (string, error)

Store saves one payload in process memory.

Jump to

Keyboard shortcuts

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