Help us shape the future of Go! Take the 2026 Go Developer Survey

provider

package
v0.57.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxProviderFeatureMetaSize = 12000

MaxProviderFeatureMetaSize is the max size of the ProviderFeatureMeta field.

Variables

View Source
var (
	// ErrEmptyResourceID is returned if the resource id was empty.
	ErrEmptyResourceID = errors.New("resource id cannot be empty")
	// ErrEmptyProviderID is returned if the provider id was empty.
	ErrEmptyProviderID = errors.New("provider id cannot be empty")
	// ErrEmptyProviderAccountID is returned if the provider id was empty.
	ErrEmptyProviderAccountID = errors.New("provider account id cannot be empty")
	// ErrUnimplementedProviderFeature is returned when a provider feature is not implemented.
	ErrUnimplementedProviderFeature = errors.New("provider feature unimplemented")
	// ErrProviderFeatureMetaSizeExceeded is returned if a size limit is exceeded.
	ErrProviderFeatureMetaSizeExceeded = errors.New("maximum provider feature metadata size exceeded")
)
View Source
var (
	ProviderFeature_name = map[int32]string{
		0: "ProviderFeature_NONE",
		1: "ProviderFeature_SESSION",
		2: "ProviderFeature_SHARED_OBJECT",
		3: "ProviderFeature_BLOCK_STORE",
		4: "ProviderFeature_SHARED_OBJECT_RECOVERY",
	}
	ProviderFeature_value = map[string]int32{
		"ProviderFeature_NONE":                   0,
		"ProviderFeature_SESSION":                1,
		"ProviderFeature_SHARED_OBJECT":          2,
		"ProviderFeature_BLOCK_STORE":            3,
		"ProviderFeature_SHARED_OBJECT_RECOVERY": 4,
	}
)

Enum value maps for ProviderFeature.

View Source
var (
	ProviderAccountStatus_name = map[int32]string{
		0: "ProviderAccountStatus_NONE",
		1: "ProviderAccountStatus_PENDING",
		2: "ProviderAccountStatus_READY",
		3: "ProviderAccountStatus_DELETED",
		4: "ProviderAccountStatus_FAILED",
		5: "ProviderAccountStatus_UNAUTHENTICATED",
		6: "ProviderAccountStatus_DORMANT",
	}
	ProviderAccountStatus_value = map[string]int32{
		"ProviderAccountStatus_NONE":            0,
		"ProviderAccountStatus_PENDING":         1,
		"ProviderAccountStatus_READY":           2,
		"ProviderAccountStatus_DELETED":         3,
		"ProviderAccountStatus_FAILED":          4,
		"ProviderAccountStatus_UNAUTHENTICATED": 5,
		"ProviderAccountStatus_DORMANT":         6,
	}
)

Enum value maps for ProviderAccountStatus.

Functions

func GetProviderAccountFeature

func GetProviderAccountFeature[V ProviderAccountFeature](ctx context.Context, acc ProviderAccount, feature ProviderFeature) (V, error)

GetProviderAccountFeature type asserts the provider account feature.

Implements one of SpaceProvider, BlockStoreProvider, ... Check GetProviderInfo()=>features in advance before calling this. Returns ErrUnimplementedProviderFeature if the feature is not implemented.

func NewProviderAccountInfoBlock

func NewProviderAccountInfoBlock() block.Block

NewProviderAccountInfoBlock constructs a new ProviderAccountInfo block.

func NewProviderInfoBlock

func NewProviderInfoBlock() block.Block

NewProviderInfoBlock constructs a new ProviderInfo block.

func ValidateProviderAccountID

func ValidateProviderAccountID(id string) error

ValidateProviderAccountID validates a provider identifier.

func ValidateProviderID

func ValidateProviderID(id string) error

ValidateProviderID validates a provider identifier.

func ValidateResourceID

func ValidateResourceID(id string) error

ValidateResourceID validates a resource identifier.

Types

type AccessProviderAccount

type AccessProviderAccount interface {
	// Directive indicates AccessProviderAccount is a directive.
	directive.Directive

	// AccessProviderID returns the provider id to lookup.
	AccessProviderID() string
	// AccessProviderAccountID returns the account id to lookup.
	AccessProviderAccountID() string
}

AccessProviderAccount is a directive to access an account on a provider.

func NewAccessProviderAccount

func NewAccessProviderAccount(providerID, accountID string) AccessProviderAccount

NewAccessProviderAccount constructs a new AccessProviderAccount directive.

type AccessProviderAccountValue

type AccessProviderAccountValue = ProviderAccount

AccessProviderAccountValue is the result type for AccessProviderAccount.

type AccountTransition

type AccountTransition struct {

	// OperationId identifies this source-to-destination transition across retries.
	OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operationId,omitempty"`
	// Source identifies the account whose Sessions and resources are moving.
	Source *ProviderResourceRef `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	// Destination identifies the surviving account; id is its settings object ID.
	Destination *ProviderResourceRef `protobuf:"bytes,3,opt,name=destination,proto3" json:"destination,omitempty"`
	// DestinationEndpoint must match the receiver's configured cloud provider.
	DestinationEndpoint string `protobuf:"bytes,4,opt,name=destination_endpoint,json=destinationEndpoint,proto3" json:"destinationEndpoint,omitempty"`
	// DestinationPeerIds are the destination's independently authorized transport peers.
	DestinationPeerIds []string `protobuf:"bytes,5,rep,name=destination_peer_ids,json=destinationPeerIds,proto3" json:"destinationPeerIds,omitempty"`
	// SessionPeerIds is the exact set of source Sessions approved for the transition.
	SessionPeerIds []string `protobuf:"bytes,6,rep,name=session_peer_ids,json=sessionPeerIds,proto3" json:"sessionPeerIds,omitempty"`
	// SourceEndpoint identifies cloud authority; empty identifies a local account.
	SourceEndpoint string `protobuf:"bytes,7,opt,name=source_endpoint,json=sourceEndpoint,proto3" json:"sourceEndpoint,omitempty"`
	// contains filtered or unexported fields
}

AccountTransition is the durable, provider-authorized result of an account merge. Source replicas retain it so independently authorized Sessions can reconnect.

func (*AccountTransition) CloneMessageVT

func (m *AccountTransition) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*AccountTransition) CloneVT

func (m *AccountTransition) CloneVT() *AccountTransition

func (*AccountTransition) EqualMessageVT

func (this *AccountTransition) EqualMessageVT(thatMsg any) bool

func (*AccountTransition) EqualVT

func (this *AccountTransition) EqualVT(that *AccountTransition) bool

func (*AccountTransition) GetDestination

func (x *AccountTransition) GetDestination() *ProviderResourceRef

func (*AccountTransition) GetDestinationEndpoint

func (x *AccountTransition) GetDestinationEndpoint() string

func (*AccountTransition) GetDestinationPeerIds

func (x *AccountTransition) GetDestinationPeerIds() []string

func (*AccountTransition) GetOperationId

func (x *AccountTransition) GetOperationId() string

func (*AccountTransition) GetSessionPeerIds

func (x *AccountTransition) GetSessionPeerIds() []string

func (*AccountTransition) GetSource

func (x *AccountTransition) GetSource() *ProviderResourceRef

func (*AccountTransition) GetSourceEndpoint

func (x *AccountTransition) GetSourceEndpoint() string

func (*AccountTransition) MarshalJSON

func (x *AccountTransition) MarshalJSON() ([]byte, error)

MarshalJSON marshals the AccountTransition to JSON.

func (*AccountTransition) MarshalProtoJSON

func (x *AccountTransition) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the AccountTransition message to JSON.

func (*AccountTransition) MarshalProtoText

func (x *AccountTransition) MarshalProtoText() string

func (*AccountTransition) MarshalToSizedBufferVT

func (m *AccountTransition) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*AccountTransition) MarshalToVT

func (m *AccountTransition) MarshalToVT(dAtA []byte) (int, error)

func (*AccountTransition) MarshalVT

func (m *AccountTransition) MarshalVT() (dAtA []byte, err error)

func (*AccountTransition) ProtoMessage

func (*AccountTransition) ProtoMessage()

func (*AccountTransition) Reset

func (x *AccountTransition) Reset()

func (*AccountTransition) SizeVT

func (m *AccountTransition) SizeVT() (n int)

func (*AccountTransition) String

func (x *AccountTransition) String() string

func (*AccountTransition) UnmarshalJSON

func (x *AccountTransition) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the AccountTransition from JSON.

func (*AccountTransition) UnmarshalProtoJSON

func (x *AccountTransition) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the AccountTransition message from JSON.

func (*AccountTransition) UnmarshalVT

func (m *AccountTransition) UnmarshalVT(dAtA []byte) error

func (*AccountTransition) Validate

func (t *AccountTransition) Validate() error

Validate checks the fixed account relationship and independently authorized peers.

type LookupProvider

type LookupProvider interface {
	// Directive indicates LookupProvider is a directive.
	directive.Directive

	// LookupProviderID returns the provider id to lookup.
	LookupProviderID() string
}

LookupProvider is a directive to look up a provider.

func NewLookupProvider

func NewLookupProvider(id string) LookupProvider

NewLookupProvider constructs a new LookupProvider directive.

type LookupProviderInfo

type LookupProviderInfo interface {
	// Directive indicates LookupProviderInfo is a directive.
	directive.Directive

	// LookupProviderInfoID returns the provider id to lookup.
	// Empty to look up all.
	LookupProviderInfoID() string
}

LookupProviderInfo is a directive to look up provider info. Usually used to list the available providers.

func NewLookupProviderInfo

func NewLookupProviderInfo(id string) LookupProviderInfo

NewLookupProviderInfo constructs a new LookupProviderInfo directive.

type LookupProviderInfoValue

type LookupProviderInfoValue = *ProviderInfo

LookupProviderInfoValue is the result type for LookupProviderInfo.

func ExLookupProviderInfos

func ExLookupProviderInfos(
	ctx context.Context,
	b bus.Bus,
	id string,
	waitOne bool,
) ([]LookupProviderInfoValue, error)

ExLookupProviderInfos executes a lookup for all of the providers on the bus.

id can optionally filter to a specific provider id. If waitOne is set, waits for at least one value before returning. Returns when the directive becomes idle.

type LookupProviderValue

type LookupProviderValue = Provider

LookupProviderValue is the result type for LookupProvider.

func ExLookupProviders

func ExLookupProviders(
	ctx context.Context,
	b bus.Bus,
	id string,
	waitOne bool,
) ([]LookupProviderValue, directive.Instance, directive.Reference, error)

ExLookupProviders executes a lookup for all of the providers on the bus.

id can optionally filter to a specific provider id. If waitOne is set, waits for at least one value before returning. Returns when the directive becomes idle.

type Provider

type Provider interface {
	// GetProviderInfo returns the basic provider information.
	GetProviderInfo() *ProviderInfo

	// AccessProviderAccount accesses a provider account.
	// If accountID is empty, it will use the default or prompt the user.
	// Released may be nil.
	AccessProviderAccount(
		ctx context.Context,
		accountID string,
		released func(),
	) (ProviderAccount, func(), error)

	// Execute executes the provider.
	// Return nil for no-op (will not be restarted).
	Execute(ctx context.Context) error
}

Provider is the interface implemented by the provider controller.

func ExLookupProvider

func ExLookupProvider(
	ctx context.Context,
	b bus.Bus,
	id string,
	returnIfIdle bool,
	valDisposeCb func(),
) (Provider, directive.Reference, error)

ExLookupProvider executes a lookup for a single provider on the bus.

id should be set to filter to a specific provider id If waitOne is set, waits for at least one value before returning. Returns when the directive becomes idle.

type ProviderAccount

type ProviderAccount interface {
	// GetProviderAccountFeature returns the implementation of a specific provider feature.
	//
	// Implements one of SpaceProvider, BlockStoreProvider, ...
	// Check GetProviderInfo()=>features in advance before calling this.
	// Returns ErrProviderFeatureUnimplemented if the feature is not implemented.
	GetProviderAccountFeature(ctx context.Context, feature ProviderFeature) (ProviderAccountFeature, error)
}

ProviderAccount represents an account for a provider.

func ExAccessProviderAccount

func ExAccessProviderAccount(
	ctx context.Context,
	b bus.Bus,
	providerID,
	accountID string,
	returnIfIdle bool,
	valDisposeCb func(),
) (ProviderAccount, directive.Reference, error)

ExAccessProviderAccount executes a lookup for a single provider on the bus.

id should be set to filter to a specific provider id If waitOne is set, waits for at least one value before returning. Returns when the directive becomes idle.

type ProviderAccountFeature

type ProviderAccountFeature any

ProviderAccountFeature is a ProviderFeature implementation base type.

type ProviderAccountInfo

type ProviderAccountInfo struct {

	// ProviderId is the provider identifier.
	ProviderId string `protobuf:"bytes,1,opt,name=provider_id,json=providerId,proto3" json:"providerId,omitempty"`
	// ProviderAccountId is the provider account identifier.
	ProviderAccountId string `protobuf:"bytes,2,opt,name=provider_account_id,json=providerAccountId,proto3" json:"providerAccountId,omitempty"`
	// ProviderFeatures is the set of features configured for the account.
	ProviderFeatures []ProviderFeature `protobuf:"varint,3,rep,packed,name=provider_features,json=providerFeatures,proto3" json:"providerFeatures,omitempty"`
	// ProviderAccountStatus contains the status of the account.
	ProviderAccountStatus ProviderAccountStatus `protobuf:"varint,4,opt,name=provider_account_status,json=providerAccountStatus,proto3" json:"providerAccountStatus,omitempty"`
	// ProviderAccountState contains serialized account info.
	// The format is per-provider.
	ProviderAccountState []byte `protobuf:"bytes,5,opt,name=provider_account_state,json=providerAccountState,proto3" json:"providerAccountState,omitempty"`
	// contains filtered or unexported fields
}

ProviderAccountInfo contains details about an account on a Provider.

func UnmarshalProviderAccountInfo

func UnmarshalProviderAccountInfo(ctx context.Context, bcs *block.Cursor) (*ProviderAccountInfo, error)

UnmarshalProviderAccountInfo unmarshals a ProviderAccountInfo from a block cursor.

func (*ProviderAccountInfo) CloneMessageVT

func (*ProviderAccountInfo) CloneVT

func (*ProviderAccountInfo) EqualMessageVT

func (this *ProviderAccountInfo) EqualMessageVT(thatMsg any) bool

func (*ProviderAccountInfo) EqualVT

func (this *ProviderAccountInfo) EqualVT(that *ProviderAccountInfo) bool

func (*ProviderAccountInfo) GetProviderAccountId

func (x *ProviderAccountInfo) GetProviderAccountId() string

func (*ProviderAccountInfo) GetProviderAccountState

func (x *ProviderAccountInfo) GetProviderAccountState() []byte

func (*ProviderAccountInfo) GetProviderAccountStatus

func (x *ProviderAccountInfo) GetProviderAccountStatus() ProviderAccountStatus

func (*ProviderAccountInfo) GetProviderFeatures

func (x *ProviderAccountInfo) GetProviderFeatures() []ProviderFeature

func (*ProviderAccountInfo) GetProviderId

func (x *ProviderAccountInfo) GetProviderId() string

func (*ProviderAccountInfo) MarshalBlock

func (i *ProviderAccountInfo) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ProviderAccountInfo) MarshalJSON

func (x *ProviderAccountInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderAccountInfo to JSON.

func (*ProviderAccountInfo) MarshalProtoJSON

func (x *ProviderAccountInfo) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderAccountInfo message to JSON.

func (*ProviderAccountInfo) MarshalProtoText

func (x *ProviderAccountInfo) MarshalProtoText() string

func (*ProviderAccountInfo) MarshalToSizedBufferVT

func (m *ProviderAccountInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProviderAccountInfo) MarshalToVT

func (m *ProviderAccountInfo) MarshalToVT(dAtA []byte) (int, error)

func (*ProviderAccountInfo) MarshalVT

func (m *ProviderAccountInfo) MarshalVT() (dAtA []byte, err error)

func (*ProviderAccountInfo) ProtoMessage

func (*ProviderAccountInfo) ProtoMessage()

func (*ProviderAccountInfo) Reset

func (x *ProviderAccountInfo) Reset()

func (*ProviderAccountInfo) SizeVT

func (m *ProviderAccountInfo) SizeVT() (n int)

func (*ProviderAccountInfo) String

func (x *ProviderAccountInfo) String() string

func (*ProviderAccountInfo) UnmarshalBlock

func (i *ProviderAccountInfo) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ProviderAccountInfo) UnmarshalJSON

func (x *ProviderAccountInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderAccountInfo from JSON.

func (*ProviderAccountInfo) UnmarshalProtoJSON

func (x *ProviderAccountInfo) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderAccountInfo message from JSON.

func (*ProviderAccountInfo) UnmarshalVT

func (m *ProviderAccountInfo) UnmarshalVT(dAtA []byte) error

func (*ProviderAccountInfo) Validate

func (i *ProviderAccountInfo) Validate() error

Validate validates the ProviderAccountInfo.

type ProviderAccountStatus

type ProviderAccountStatus int32

ProviderAccountStatus contains the high-level status of an account.

const (
	// ProviderAccountStatus_NONE is if the account was not created yet (zero value)
	ProviderAccountStatus_ProviderAccountStatus_NONE ProviderAccountStatus = 0
	// ProviderAccountStatus_PENDING is the pending state (account is being created).
	ProviderAccountStatus_ProviderAccountStatus_PENDING ProviderAccountStatus = 1
	// ProviderAccountStatus_READY is the ready state (account is ready).
	ProviderAccountStatus_ProviderAccountStatus_READY ProviderAccountStatus = 2
	// ProviderAccountStatus_DELETED is the deleted state (account was deleted).
	ProviderAccountStatus_ProviderAccountStatus_DELETED ProviderAccountStatus = 3
	// ProviderAccountStatus_FAILED is the failed state (account was not able to be created).
	ProviderAccountStatus_ProviderAccountStatus_FAILED ProviderAccountStatus = 4
	// ProviderAccountStatus_UNAUTHENTICATED is set when the session key is stale
	// but the account still exists on the cloud. Recoverable via re-login.
	ProviderAccountStatus_ProviderAccountStatus_UNAUTHENTICATED ProviderAccountStatus = 5
	// ProviderAccountStatus_DORMANT is set when the session is connected but
	// access is gated (e.g. no active subscription). The WS tracker enters idle
	// mode and wakes when account state changes.
	ProviderAccountStatus_ProviderAccountStatus_DORMANT ProviderAccountStatus = 6
)

func (ProviderAccountStatus) Enum

func (ProviderAccountStatus) MarshalJSON

func (x ProviderAccountStatus) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderAccountStatus to JSON.

func (ProviderAccountStatus) MarshalProtoJSON

func (x ProviderAccountStatus) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderAccountStatus to JSON.

func (ProviderAccountStatus) MarshalProtoText

func (x ProviderAccountStatus) MarshalProtoText() string

func (ProviderAccountStatus) MarshalText

func (x ProviderAccountStatus) MarshalText() ([]byte, error)

MarshalText marshals the ProviderAccountStatus to text.

func (ProviderAccountStatus) String

func (x ProviderAccountStatus) String() string

func (*ProviderAccountStatus) UnmarshalJSON

func (x *ProviderAccountStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderAccountStatus from JSON.

func (*ProviderAccountStatus) UnmarshalProtoJSON

func (x *ProviderAccountStatus) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderAccountStatus from JSON.

func (*ProviderAccountStatus) UnmarshalText

func (x *ProviderAccountStatus) UnmarshalText(b []byte) error

UnmarshalText unmarshals the ProviderAccountStatus from text.

type ProviderController

type ProviderController interface {
	// Controller indicates this is a controller.
	controller.Controller

	// GetProviderInfo returns the basic provider information.
	GetProviderInfo() *ProviderInfo

	// GetProvider returns the provider, waiting for it to be ready.
	//
	// Returns nil, context.Canceled if canceled.
	GetProvider(ctx context.Context) (Provider, error)
}

ProviderController is implemented by provider controllers.

type ProviderFeature

type ProviderFeature int32

ProviderFeature is a list of available provider features.

const (
	// ProviderFeature_NONE is the zero value.
	ProviderFeature_ProviderFeature_NONE ProviderFeature = 0
	// ProviderFeature_SESSION is the session (account identity => session) feature.
	ProviderFeature_ProviderFeature_SESSION ProviderFeature = 1
	// ProviderFeature_SHARED_OBJECT is the shared object service (root state refs).
	ProviderFeature_ProviderFeature_SHARED_OBJECT ProviderFeature = 2
	// ProviderFeature_BLOCK_STORE is the block store (Content-ID) feature.
	ProviderFeature_ProviderFeature_BLOCK_STORE ProviderFeature = 3
	// ProviderFeature_SHARED_OBJECT_RECOVERY is same-entity shared object recovery.
	ProviderFeature_ProviderFeature_SHARED_OBJECT_RECOVERY ProviderFeature = 4
)

func (ProviderFeature) Enum

func (x ProviderFeature) Enum() *ProviderFeature

func (ProviderFeature) MarshalJSON

func (x ProviderFeature) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderFeature to JSON.

func (ProviderFeature) MarshalProtoJSON

func (x ProviderFeature) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderFeature to JSON.

func (ProviderFeature) MarshalProtoText

func (x ProviderFeature) MarshalProtoText() string

func (ProviderFeature) MarshalText

func (x ProviderFeature) MarshalText() ([]byte, error)

MarshalText marshals the ProviderFeature to text.

func (ProviderFeature) String

func (x ProviderFeature) String() string

func (*ProviderFeature) UnmarshalJSON

func (x *ProviderFeature) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderFeature from JSON.

func (*ProviderFeature) UnmarshalProtoJSON

func (x *ProviderFeature) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderFeature from JSON.

func (*ProviderFeature) UnmarshalText

func (x *ProviderFeature) UnmarshalText(b []byte) error

UnmarshalText unmarshals the ProviderFeature from text.

type ProviderFeatureMap

type ProviderFeatureMap struct {

	// MapItems is the list of provider feature map items.
	// The list is evaluated from beginning to end.
	// Items later in the list are secondary to items earlier in the list.
	MapItems []*ProviderFeatureMapItem `protobuf:"bytes,1,rep,name=map_items,json=mapItems,proto3" json:"mapItems,omitempty"`
	// contains filtered or unexported fields
}

ProviderFeatureMap is a mapping between ProviderFeature and provider ID. This is used to specify which functionality is mapped to which provider.

func (*ProviderFeatureMap) CloneMessageVT

func (m *ProviderFeatureMap) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ProviderFeatureMap) CloneVT

func (m *ProviderFeatureMap) CloneVT() *ProviderFeatureMap

func (*ProviderFeatureMap) EqualMessageVT

func (this *ProviderFeatureMap) EqualMessageVT(thatMsg any) bool

func (*ProviderFeatureMap) EqualVT

func (this *ProviderFeatureMap) EqualVT(that *ProviderFeatureMap) bool

func (*ProviderFeatureMap) GetMapItems

func (x *ProviderFeatureMap) GetMapItems() []*ProviderFeatureMapItem

func (*ProviderFeatureMap) MarshalJSON

func (x *ProviderFeatureMap) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderFeatureMap to JSON.

func (*ProviderFeatureMap) MarshalProtoJSON

func (x *ProviderFeatureMap) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderFeatureMap message to JSON.

func (*ProviderFeatureMap) MarshalProtoText

func (x *ProviderFeatureMap) MarshalProtoText() string

func (*ProviderFeatureMap) MarshalToSizedBufferVT

func (m *ProviderFeatureMap) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProviderFeatureMap) MarshalToVT

func (m *ProviderFeatureMap) MarshalToVT(dAtA []byte) (int, error)

func (*ProviderFeatureMap) MarshalVT

func (m *ProviderFeatureMap) MarshalVT() (dAtA []byte, err error)

func (*ProviderFeatureMap) ProtoMessage

func (*ProviderFeatureMap) ProtoMessage()

func (*ProviderFeatureMap) Reset

func (x *ProviderFeatureMap) Reset()

func (*ProviderFeatureMap) SizeVT

func (m *ProviderFeatureMap) SizeVT() (n int)

func (*ProviderFeatureMap) String

func (x *ProviderFeatureMap) String() string

func (*ProviderFeatureMap) UnmarshalJSON

func (x *ProviderFeatureMap) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderFeatureMap from JSON.

func (*ProviderFeatureMap) UnmarshalProtoJSON

func (x *ProviderFeatureMap) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderFeatureMap message from JSON.

func (*ProviderFeatureMap) UnmarshalVT

func (m *ProviderFeatureMap) UnmarshalVT(dAtA []byte) error

type ProviderFeatureMapItem

type ProviderFeatureMapItem struct {

	// ProviderFeatures is the set of features we are mapping.
	ProviderFeatures []ProviderFeature `protobuf:"varint,1,rep,packed,name=provider_features,json=providerFeatures,proto3" json:"providerFeatures,omitempty"`
	// ProviderId is the provider identifier.
	ProviderId string `protobuf:"bytes,2,opt,name=provider_id,json=providerId,proto3" json:"providerId,omitempty"`
	// ProviderAccountId is the provider account identifier.
	ProviderAccountId string `protobuf:"bytes,3,opt,name=provider_account_id,json=providerAccountId,proto3" json:"providerAccountId,omitempty"`
	// contains filtered or unexported fields
}

ProviderFeatureMapItem is an item in the ProviderFeatureMap.

func (*ProviderFeatureMapItem) CloneMessageVT

func (*ProviderFeatureMapItem) CloneVT

func (*ProviderFeatureMapItem) EqualMessageVT

func (this *ProviderFeatureMapItem) EqualMessageVT(thatMsg any) bool

func (*ProviderFeatureMapItem) EqualVT

func (this *ProviderFeatureMapItem) EqualVT(that *ProviderFeatureMapItem) bool

func (*ProviderFeatureMapItem) GetProviderAccountId

func (x *ProviderFeatureMapItem) GetProviderAccountId() string

func (*ProviderFeatureMapItem) GetProviderFeatures

func (x *ProviderFeatureMapItem) GetProviderFeatures() []ProviderFeature

func (*ProviderFeatureMapItem) GetProviderId

func (x *ProviderFeatureMapItem) GetProviderId() string

func (*ProviderFeatureMapItem) MarshalJSON

func (x *ProviderFeatureMapItem) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderFeatureMapItem to JSON.

func (*ProviderFeatureMapItem) MarshalProtoJSON

func (x *ProviderFeatureMapItem) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderFeatureMapItem message to JSON.

func (*ProviderFeatureMapItem) MarshalProtoText

func (x *ProviderFeatureMapItem) MarshalProtoText() string

func (*ProviderFeatureMapItem) MarshalToSizedBufferVT

func (m *ProviderFeatureMapItem) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProviderFeatureMapItem) MarshalToVT

func (m *ProviderFeatureMapItem) MarshalToVT(dAtA []byte) (int, error)

func (*ProviderFeatureMapItem) MarshalVT

func (m *ProviderFeatureMapItem) MarshalVT() (dAtA []byte, err error)

func (*ProviderFeatureMapItem) ProtoMessage

func (*ProviderFeatureMapItem) ProtoMessage()

func (*ProviderFeatureMapItem) Reset

func (x *ProviderFeatureMapItem) Reset()

func (*ProviderFeatureMapItem) SizeVT

func (m *ProviderFeatureMapItem) SizeVT() (n int)

func (*ProviderFeatureMapItem) String

func (x *ProviderFeatureMapItem) String() string

func (*ProviderFeatureMapItem) UnmarshalJSON

func (x *ProviderFeatureMapItem) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderFeatureMapItem from JSON.

func (*ProviderFeatureMapItem) UnmarshalProtoJSON

func (x *ProviderFeatureMapItem) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderFeatureMapItem message from JSON.

func (*ProviderFeatureMapItem) UnmarshalVT

func (m *ProviderFeatureMapItem) UnmarshalVT(dAtA []byte) error

type ProviderFeatureResourceRef

type ProviderFeatureResourceRef struct {

	// ProviderResourceRef is the reference to the resource on the provider.
	ProviderResourceRef *ProviderResourceRef `protobuf:"bytes,1,opt,name=provider_resource_ref,json=providerResourceRef,proto3" json:"providerResourceRef,omitempty"`
	// ProviderFeature is the feature implemented by this resource.
	ProviderFeature ProviderFeature `protobuf:"varint,2,opt,name=provider_feature,json=providerFeature,proto3" json:"providerFeature,omitempty"`
	// ProviderFeatureMeta is encoded metadata specific to the resource type.
	// Max size 120kb
	ProviderFeatureMeta []byte `protobuf:"bytes,3,opt,name=provider_feature_meta,json=providerFeatureMeta,proto3" json:"providerFeatureMeta,omitempty"`
	// contains filtered or unexported fields
}

ProviderFeatureResourceRef is a reference to a resource with a feature and metadata on a provider.

func (*ProviderFeatureResourceRef) CloneMessageVT

func (*ProviderFeatureResourceRef) CloneVT

func (*ProviderFeatureResourceRef) EqualMessageVT

func (this *ProviderFeatureResourceRef) EqualMessageVT(thatMsg any) bool

func (*ProviderFeatureResourceRef) EqualVT

func (*ProviderFeatureResourceRef) GetLogger

func (r *ProviderFeatureResourceRef) GetLogger(le *logrus.Entry) *logrus.Entry

GetLogger adds debug values to the logger.

func (*ProviderFeatureResourceRef) GetProviderFeature

func (x *ProviderFeatureResourceRef) GetProviderFeature() ProviderFeature

func (*ProviderFeatureResourceRef) GetProviderFeatureMeta

func (x *ProviderFeatureResourceRef) GetProviderFeatureMeta() []byte

func (*ProviderFeatureResourceRef) GetProviderResourceRef

func (x *ProviderFeatureResourceRef) GetProviderResourceRef() *ProviderResourceRef

func (*ProviderFeatureResourceRef) MarshalJSON

func (x *ProviderFeatureResourceRef) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderFeatureResourceRef to JSON.

func (*ProviderFeatureResourceRef) MarshalProtoJSON

func (x *ProviderFeatureResourceRef) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderFeatureResourceRef message to JSON.

func (*ProviderFeatureResourceRef) MarshalProtoText

func (x *ProviderFeatureResourceRef) MarshalProtoText() string

func (*ProviderFeatureResourceRef) MarshalToSizedBufferVT

func (m *ProviderFeatureResourceRef) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProviderFeatureResourceRef) MarshalToVT

func (m *ProviderFeatureResourceRef) MarshalToVT(dAtA []byte) (int, error)

func (*ProviderFeatureResourceRef) MarshalVT

func (m *ProviderFeatureResourceRef) MarshalVT() (dAtA []byte, err error)

func (*ProviderFeatureResourceRef) ProtoMessage

func (*ProviderFeatureResourceRef) ProtoMessage()

func (*ProviderFeatureResourceRef) Reset

func (x *ProviderFeatureResourceRef) Reset()

func (*ProviderFeatureResourceRef) SizeVT

func (m *ProviderFeatureResourceRef) SizeVT() (n int)

func (*ProviderFeatureResourceRef) String

func (x *ProviderFeatureResourceRef) String() string

func (*ProviderFeatureResourceRef) UnmarshalJSON

func (x *ProviderFeatureResourceRef) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderFeatureResourceRef from JSON.

func (*ProviderFeatureResourceRef) UnmarshalProtoJSON

func (x *ProviderFeatureResourceRef) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderFeatureResourceRef message from JSON.

func (*ProviderFeatureResourceRef) UnmarshalVT

func (m *ProviderFeatureResourceRef) UnmarshalVT(dAtA []byte) error

func (*ProviderFeatureResourceRef) Validate

func (r *ProviderFeatureResourceRef) Validate() error

Validate validates the shared object ref.

type ProviderHandler

type ProviderHandler any

ProviderHandler manages a Provider and receives event callbacks. This is typically fulfilled by the provider controller.

type ProviderInfo

type ProviderInfo struct {

	// ProviderId is the provider identifier.
	ProviderId string `protobuf:"bytes,1,opt,name=provider_id,json=providerId,proto3" json:"providerId,omitempty"`
	// ProviderFeatures is the list of available provider features.
	ProviderFeatures []ProviderFeature `protobuf:"varint,2,rep,packed,name=provider_features,json=providerFeatures,proto3" json:"providerFeatures,omitempty"`
	// contains filtered or unexported fields
}

ProviderInfo is basic information about a local/p2p/cloud provider controller.

func UnmarshalProviderInfo

func UnmarshalProviderInfo(ctx context.Context, bcs *block.Cursor) (*ProviderInfo, error)

UnmarshalProviderInfo unmarshals a ProviderInfo from a block cursor.

func (*ProviderInfo) CloneMessageVT

func (m *ProviderInfo) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ProviderInfo) CloneVT

func (m *ProviderInfo) CloneVT() *ProviderInfo

func (*ProviderInfo) EqualMessageVT

func (this *ProviderInfo) EqualMessageVT(thatMsg any) bool

func (*ProviderInfo) EqualVT

func (this *ProviderInfo) EqualVT(that *ProviderInfo) bool

func (*ProviderInfo) GetProviderFeatures

func (x *ProviderInfo) GetProviderFeatures() []ProviderFeature

func (*ProviderInfo) GetProviderId

func (x *ProviderInfo) GetProviderId() string

func (*ProviderInfo) MarshalBlock

func (i *ProviderInfo) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ProviderInfo) MarshalJSON

func (x *ProviderInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderInfo to JSON.

func (*ProviderInfo) MarshalProtoJSON

func (x *ProviderInfo) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderInfo message to JSON.

func (*ProviderInfo) MarshalProtoText

func (x *ProviderInfo) MarshalProtoText() string

func (*ProviderInfo) MarshalToSizedBufferVT

func (m *ProviderInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProviderInfo) MarshalToVT

func (m *ProviderInfo) MarshalToVT(dAtA []byte) (int, error)

func (*ProviderInfo) MarshalVT

func (m *ProviderInfo) MarshalVT() (dAtA []byte, err error)

func (*ProviderInfo) ProtoMessage

func (*ProviderInfo) ProtoMessage()

func (*ProviderInfo) Reset

func (x *ProviderInfo) Reset()

func (*ProviderInfo) SizeVT

func (m *ProviderInfo) SizeVT() (n int)

func (*ProviderInfo) String

func (x *ProviderInfo) String() string

func (*ProviderInfo) UnmarshalBlock

func (i *ProviderInfo) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ProviderInfo) UnmarshalJSON

func (x *ProviderInfo) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderInfo from JSON.

func (*ProviderInfo) UnmarshalProtoJSON

func (x *ProviderInfo) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderInfo message from JSON.

func (*ProviderInfo) UnmarshalVT

func (m *ProviderInfo) UnmarshalVT(dAtA []byte) error

func (*ProviderInfo) Validate

func (i *ProviderInfo) Validate() error

Validate validates the ProviderInfo.

type ProviderResourceRef

type ProviderResourceRef struct {

	// Id is the resource id, unique to the provider.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// ProviderId is the provider identifier.
	// This corresponds to a provider controller.
	ProviderId string `protobuf:"bytes,2,opt,name=provider_id,json=providerId,proto3" json:"providerId,omitempty"`
	// ProviderAccountId is the provider account identifier.
	ProviderAccountId string `protobuf:"bytes,3,opt,name=provider_account_id,json=providerAccountId,proto3" json:"providerAccountId,omitempty"`
	// contains filtered or unexported fields
}

ProviderResourceRef is a common reference type to a resource stored on a provider.

func (*ProviderResourceRef) CloneMessageVT

func (*ProviderResourceRef) CloneVT

func (*ProviderResourceRef) EqualMessageVT

func (this *ProviderResourceRef) EqualMessageVT(thatMsg any) bool

func (*ProviderResourceRef) EqualVT

func (this *ProviderResourceRef) EqualVT(that *ProviderResourceRef) bool

func (*ProviderResourceRef) GetId

func (x *ProviderResourceRef) GetId() string

func (*ProviderResourceRef) GetLogger

func (r *ProviderResourceRef) GetLogger(le *logrus.Entry) *logrus.Entry

GetLogger adds debug values to the logger.

func (*ProviderResourceRef) GetProviderAccountId

func (x *ProviderResourceRef) GetProviderAccountId() string

func (*ProviderResourceRef) GetProviderId

func (x *ProviderResourceRef) GetProviderId() string

func (*ProviderResourceRef) MarshalJSON

func (x *ProviderResourceRef) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ProviderResourceRef to JSON.

func (*ProviderResourceRef) MarshalProtoJSON

func (x *ProviderResourceRef) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ProviderResourceRef message to JSON.

func (*ProviderResourceRef) MarshalProtoText

func (x *ProviderResourceRef) MarshalProtoText() string

func (*ProviderResourceRef) MarshalToSizedBufferVT

func (m *ProviderResourceRef) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ProviderResourceRef) MarshalToVT

func (m *ProviderResourceRef) MarshalToVT(dAtA []byte) (int, error)

func (*ProviderResourceRef) MarshalVT

func (m *ProviderResourceRef) MarshalVT() (dAtA []byte, err error)

func (*ProviderResourceRef) ProtoMessage

func (*ProviderResourceRef) ProtoMessage()

func (*ProviderResourceRef) Reset

func (x *ProviderResourceRef) Reset()

func (*ProviderResourceRef) SizeVT

func (m *ProviderResourceRef) SizeVT() (n int)

func (*ProviderResourceRef) String

func (x *ProviderResourceRef) String() string

func (*ProviderResourceRef) UnmarshalJSON

func (x *ProviderResourceRef) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ProviderResourceRef from JSON.

func (*ProviderResourceRef) UnmarshalProtoJSON

func (x *ProviderResourceRef) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ProviderResourceRef message from JSON.

func (*ProviderResourceRef) UnmarshalVT

func (m *ProviderResourceRef) UnmarshalVT(dAtA []byte) error

func (*ProviderResourceRef) Validate

func (r *ProviderResourceRef) Validate() error

Validate validates the resource ref.

type StorageStatsProvider

type StorageStatsProvider interface {
	// GetStorageStats returns storage usage statistics for the account volume.
	GetStorageStats(ctx context.Context) (*volume.StorageStats, error)
}

StorageStatsProvider is an optional interface that ProviderAccount implementations can satisfy to report account-level storage statistics.

type StorageStatsWatchProvider added in v0.51.7

type StorageStatsWatchProvider interface {
	StorageStatsProvider

	// GetStorageStatsSnapshotWithWait returns current storage stats and a wait
	// channel that closes after the next storage stats mutation.
	GetStorageStatsSnapshotWithWait(ctx context.Context) (*volume.StorageStats, <-chan struct{}, error)
}

StorageStatsWatchProvider is an optional interface that ProviderAccount implementations can satisfy to expose a storage-stats snapshot and a channel that closes when storage usage may have changed.

Directories

Path Synopsis
Package provider_gccleanup runs provider account GC cleanup sweeps.
Package provider_gccleanup runs provider account GC cleanup sweeps.
Package provider_migration composes authorized account resource movement.
Package provider_migration composes authorized account resource movement.
api
cacheseed
Package provider_spacewave_cacheseed provides the dev-only cache-seed inspector RPC service.
Package provider_spacewave_cacheseed provides the dev-only cache-seed inspector RPC service.
cacheseedbuffer
Package cacheseedbuffer records bounded seed-reason-tagged HTTP requests.
Package cacheseedbuffer records bounded seed-reason-tagged HTTP requests.
packfile/delta
Package delta builds incremental packfile uploads from a writable block store by diffing against a CDN mirror view and chunking the delta into size-bounded kvfile packs.
Package delta builds incremental packfile uploads from a writable block store by diffing against a CDN mirror view and chunking the delta into size-bounded kvfile packs.
packfile/order
Package order groups related blocks for physical packfile locality.
Package order groups related blocks for physical packfile locality.
seedreason
Package seedreason owns the HTTP seed-reason taxonomy used to classify provider cloud requests.
Package seedreason owns the HTTP seed-reason taxonomy used to classify provider cloud requests.

Jump to

Keyboard shortcuts

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