provisioning

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderNotAllowedErrorName = "ProviderNotAllowed"

Variables

View Source
var ErrProviderNotAllowed = errors.New(ProviderNotAllowedErrorName, "provider not allowed")

ErrProviderNotAllowed is returned when a provider is not in the allowed list.

Functions

func NewSubscriptionID

func NewSubscriptionID(consumer SpaceDID) (string, error)

Types

type AccountDID

type AccountDID = did.DID

type Service

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

func NewService

func NewService(providers []ServiceDID, consumerStore consumer.Store, subscriptionStore subscription.Store) *Service

func (*Service) GetConsumer

func (s *Service) GetConsumer(ctx context.Context, provider ServiceDID, space SpaceDID) (consumer.Record, error)

GetConsumer returns the consumer record for a given service provider and consumer (space). It may return consumer.ErrConsumerNotFound.

func (*Service) GetSubscription

func (s *Service) GetSubscription(ctx context.Context, provider ServiceDID, subscription SubscriptionID) (subscription.Record, error)

GetSubscription returns the subscription record for a given service provider. It may return subscription.ErrSubscriptionNotFound.

func (*Service) ListServiceProviders

func (s *Service) ListServiceProviders(ctx context.Context, space SpaceDID) ([]ServiceDID, error)

ListServiceProviders returns a list of services that have been provisioned for the given consumer (space).

func (*Service) Provision

func (s *Service) Provision(ctx context.Context, customer AccountDID, consumer SpaceDID, provider ServiceDID, cause cid.Cid) (SubscriptionID, error)

Provision provisions a service provider for a consumer (space) on behalf of a customer (account). It may return [customer.ErrCustomerNotFound] if the customer does not exist and consumer.ErrConsumerExists if the consumer is already provisioned for the provider.

type ServiceDID

type ServiceDID = did.DID

type SpaceDID

type SpaceDID = did.DID

type SubscriptionID

type SubscriptionID = string

Jump to

Keyboard shortcuts

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