Documentation ¶
Index ¶
- func NewStoreFromBucket(bucket store.Store) types.ContentClaimsStore
- func NewStoreFromDatastore(ds datastore.Datastore) types.ContentClaimsStore
- func NewUCANServer(id principal.Signer, service types.Publisher, options ...server.Option) (server.ServerView, error)
- func NewUCANService(service types.Publisher) map[ucan.Ability]server.ServiceMethod[ok.Unit]
- type ClaimService
- func (cs *ClaimService) Cache(ctx context.Context, claim delegation.Delegation) error
- func (cs *ClaimService) Find(ctx context.Context, claim ipld.Link, url url.URL) (delegation.Delegation, error)
- func (cs *ClaimService) Get(ctx context.Context, claim ipld.Link) (delegation.Delegation, error)
- func (cs *ClaimService) Publish(ctx context.Context, claim delegation.Delegation) error
- type Failure
- type Finder
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStoreFromBucket ¶ added in v1.0.0
func NewStoreFromBucket(bucket store.Store) types.ContentClaimsStore
NewStoreFromBucket creates a claims store from a bucket style interface.
func NewStoreFromDatastore ¶ added in v1.0.0
func NewStoreFromDatastore(ds datastore.Datastore) types.ContentClaimsStore
func NewUCANServer ¶ added in v1.0.0
func NewUCANService ¶ added in v1.0.0
Types ¶
type ClaimService ¶ added in v1.0.0
type ClaimService struct {
// contains filtered or unexported fields
}
func New ¶ added in v1.0.0
func New(store types.ContentClaimsStore, cache types.ContentClaimsCache, httpClient *http.Client) *ClaimService
func (*ClaimService) Cache ¶ added in v1.0.0
func (cs *ClaimService) Cache(ctx context.Context, claim delegation.Delegation) error
func (*ClaimService) Find ¶ added in v1.0.0
func (cs *ClaimService) Find(ctx context.Context, claim ipld.Link, url url.URL) (delegation.Delegation, error)
func (*ClaimService) Get ¶ added in v1.0.0
func (cs *ClaimService) Get(ctx context.Context, claim ipld.Link) (delegation.Delegation, error)
func (*ClaimService) Publish ¶ added in v1.0.0
func (cs *ClaimService) Publish(ctx context.Context, claim delegation.Delegation) error
type Failure ¶ added in v1.0.0
func NewMissingClaimError ¶ added in v1.0.0
func NewMissingClaimError() Failure
type Finder ¶ added in v1.0.0
type Finder interface { // Find and retrieve a claim via URL. Find(ctx context.Context, claim ipld.Link, fetchURL url.URL) (delegation.Delegation, error) }
func NewSimpleFinder ¶ added in v1.0.0
NewSimpleFinder creates a new Finder with the provided HTTP client.
type Service ¶ added in v1.0.0
type Service interface { // Get reads the claim from the cache, or from storage if not found. Get(ctx context.Context, claim ipld.Link) (delegation.Delegation, error) // Find attempts to read the claim from the cache, falling back to retrieving // it from storage and finally, if still not found, fetching it from the // provided URL. The result is stored in the cache. Find(ctx context.Context, claim ipld.Link, fetchURL url.URL) (delegation.Delegation, error) // Cache writes the claim to the cache with default expiry. Cache(ctx context.Context, claim delegation.Delegation) error // Publish writes the claim to the cache, and adds it to storage. Publish(ctx context.Context, claim delegation.Delegation) error }
Click to show internal directories.
Click to hide internal directories.