server

package
v1.13.5-0...-41ef1e7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0, MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClaimHandler

func GetClaimHandler(service types.Getter) http.HandlerFunc

GetClaimHandler retrieves a single content claim by it's root CID.

func GetClaimsHandler

func GetClaimsHandler(service types.Querier) http.HandlerFunc

GetClaimsHandler retrieves content claims when a GET request is sent to "/claims?multihash={multihash}".

func GetDIDDocument

func GetDIDDocument(id principal.Signer) http.HandlerFunc

GetDIDDocument returns the DID document for did:web resolution.

func GetIPNICIDHandler

func GetIPNICIDHandler(service types.Querier, config *ipniConfig) http.HandlerFunc

func GetRootHandler

func GetRootHandler(id principal.Signer) http.HandlerFunc

GetRootHandler displays version info when a GET request is sent to "/".

func ListenAndServe

func ListenAndServe(addr string, indexer types.Service, opts ...Option) error

ListenAndServe creates a new indexing service HTTP server, and starts it up.

func NewServer

func NewServer(indexer types.Service, opts ...Option) (*http.ServeMux, error)

NewServer creates a new indexing service HTTP server.

func PostAdHandler

func PostAdHandler(sk crypto.PrivKey, store store.PublisherStore) http.HandlerFunc

func PostClaimsHandler

func PostClaimsHandler(id principal.Signer, service types.Publisher, options ...server.Option) http.HandlerFunc

PostClaimsHandler invokes the ucanto service when a POST request is sent to "/claims".

Types

type Document

type Document struct {
	Context            []string             `json:"@context"` // https://w3id.org/did/v1
	ID                 string               `json:"id"`
	Controller         []string             `json:"controller,omitempty"`
	VerificationMethod []VerificationMethod `json:"verificationMethod,omitempty"`
	Authentication     []string             `json:"authentication,omitempty"`
	AssertionMethod    []string             `json:"assertionMethod,omitempty"`
}

Document is a did document that describes a did subject. See https://www.w3.org/TR/did-core/#dfn-did-documents.

type Option

type Option func(*config) error

func WithContentClaimsOptions

func WithContentClaimsOptions(options ...server.Option) Option

func WithIPNI

func WithIPNI(provider peer.AddrInfo, metadata metadata.Metadata) Option

func WithIPNIPublisherStore

func WithIPNIPublisherStore(store store.PublisherStore) Option

func WithIdentity

func WithIdentity(s principal.Signer) Option

WithIdentity specifies the server DID.

func WithTelemetry

func WithTelemetry() Option

type VerificationMethod

type VerificationMethod struct {
	ID                 string `json:"id,omitempty"`
	Type               string `json:"type,omitempty"`
	Controller         string `json:"controller,omitempty"`
	PublicKeyMultibase string `json:"publicKeyMultibase,omitempty"`
}

VerificationMethod describes how to authenticate or authorize interactions with a did subject. See https://www.w3.org/TR/did-core/#dfn-verification-method.

Jump to

Keyboard shortcuts

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