Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("query target not found")
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Options)
Option defines a single option function.
func WithRelationProviders ¶
func WithRelationProviders(val map[string]RelationProvider) Option
type Options ¶
type Options struct {
Logger log.Logger
Config *config.Config
RelationProviders map[string]RelationProvider
}
Options defines the available options for this package.
type RelationProvider ¶
type RelationProvider interface {
Add(ctx context.Context, jrd *webfinger.JSONResourceDescriptor)
}
type Service ¶
type Service interface {
// Webfinger is the endpoint for retrieving various href relations.
//
// GET /.well-known/webfinger?
// resource=acct%3Acarol%40example.com&
// rel=http%3A%2F%2Fwebfinger.opencloud%rel%2Fserver-instance
// HTTP/1.1
// Host: example.com
//
// The server might respond like this:
//
// HTTP/1.1 200 OK
// Access-Control-Allow-Origin: *
// Content-Type: application/jrd+json
//
// {
// "subject" : "acct:carol@example.com",
// "links" :
// [
// {
// "rel" : "http://webfinger.opencloud/rel/server-instance",
// "href" : "https://instance.example.com",
// "titles": {
// "en": "Readable Instance Name"
// }
// },
// {
// "rel" : "http://webfinger.opencloud/rel/server-instance",
// "href" : "https://otherinstance.example.com",
// "titles": {
// "en": "Other Readable Instance Name"
// }
// }
// ]
// }
Webfinger(ctx context.Context, queryTarget *url.URL, rels []string) (webfinger.JSONResourceDescriptor, error)
}
Service defines the extension handlers.
func NewInstrument ¶
NewInstrument returns a service that instruments metrics.
func NewLogging ¶
NewLogging returns a service that logs messages.
func NewTracing ¶
func NewTracing(next Service, tp trace.TracerProvider) Service
NewTracing returns a service that instruments traces.
Click to show internal directories.
Click to hide internal directories.