Documentation
¶
Overview ¶
Package directory searches indexed Services and Collections in the canonical Directory.
Index ¶
- type Client
- func (client *Client) ContinueSearch(ctx context.Context, next string, options IterationOptions) SearchSequence[Result]
- func (client *Client) ContinueSearchServices(ctx context.Context, next string, options IterationOptions) SearchSequence[Service]
- func (client *Client) Environment() Environment
- func (client *Client) Search(ctx context.Context, request DirectorySearchRequest, options IterationOptions) SearchSequence[Result]
- func (client *Client) SearchServices(ctx context.Context, request SearchRequest, options IterationOptions) SearchSequence[Service]
- func (client *Client) Suggest(ctx context.Context, request SuggestionRequest) ([]string, error)
- func (client *Client) SuggestServices(ctx context.Context, request SuggestionRequest) ([]string, error)
- type CollectionSummary
- type DirectorySearchRequest
- type Environment
- type Facet
- type Facets
- type IndexedService
- type Issue
- type IssueScope
- type IterationOptions
- type OperationFilter
- type Options
- type PaymentFilter
- type PaymentOptionFacetValue
- type Publisher
- type RequestError
- type Result
- type SearchRequest
- type SearchResponse
- type SearchSequence
- type Service
- type ServiceFilters
- type Source
- type SourceType
- type SuggestionRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ContinueSearch ¶ added in v0.5.0
func (client *Client) ContinueSearch(ctx context.Context, next string, options IterationOptions) SearchSequence[Result]
func (*Client) ContinueSearchServices ¶ added in v0.4.0
func (client *Client) ContinueSearchServices(ctx context.Context, next string, options IterationOptions) SearchSequence[Service]
func (*Client) Environment ¶
func (client *Client) Environment() Environment
func (*Client) Search ¶ added in v0.5.0
func (client *Client) Search(ctx context.Context, request DirectorySearchRequest, options IterationOptions) SearchSequence[Result]
func (*Client) SearchServices ¶
func (client *Client) SearchServices(ctx context.Context, request SearchRequest, options IterationOptions) SearchSequence[Service]
func (*Client) SuggestServices ¶
type CollectionSummary ¶ added in v0.5.0
type CollectionSummary struct {
Additional odp.AdditionalMembers
ID string
Name string
Description string
}
type DirectorySearchRequest ¶ added in v0.5.0
type DirectorySearchRequest struct {
SearchRequest
Types []string `json:"types,omitempty"`
}
type Environment ¶
type Environment string
const ( Production Environment = "production" Sandbox Environment = "sandbox" )
type Facets ¶
type Facets struct {
Enrollment []Facet[odp.EnrollmentProtocol]
Keywords []Facet[string]
Operations []Facet[odp.OperationDescriptor]
PaymentOptions []Facet[PaymentOptionFacetValue]
Payments []Facet[odp.PaymentProtocol]
Trust []Facet[odp.TrustProtocol]
}
type IndexedService ¶ added in v0.5.0
IndexedService carries Directory metadata. Check Source.Type before using an ODP Agent client; imported Services may omit description, language, localizations and operations.
type Issue ¶ added in v0.4.0
type Issue struct {
Index int
Message string
Scope IssueScope
}
Issue describes one Directory record this client discarded, and why.
type IssueScope ¶ added in v0.4.0
type IssueScope string
const IssueResult IssueScope = "result"
const IssueService IssueScope = "service"
type IterationOptions ¶
type OperationFilter ¶ added in v0.2.0
type OperationFilter struct {
Authentication odp.AuthenticationRequirement `json:"authentication,omitempty"`
Name odp.Operation `json:"name"`
}
type Options ¶
type Options struct {
Environment Environment
HTTPClient *http.Client
}
type PaymentFilter ¶ added in v0.2.0
type PaymentFilter struct {
Authentication odp.AuthenticationRequirement `json:"authentication,omitempty"`
Name odp.Protocol `json:"name"`
Options []odp.PaymentOption `json:"options,omitempty"`
}
type PaymentOptionFacetValue ¶ added in v0.3.2
type PaymentOptionFacetValue struct {
Name odp.Protocol `json:"name"`
Option odp.PaymentOption `json:"option"`
}
type Publisher ¶ added in v0.6.0
type Publisher struct {
Additional odp.AdditionalMembers
PublisherID string
Name string
WebsiteURL string
}
type RequestError ¶
func (*RequestError) Error ¶
func (err *RequestError) Error() string
type Result ¶ added in v0.5.0
type Result struct {
Additional odp.AdditionalMembers
Type string
Service *IndexedService
Collection *CollectionSummary
Publisher *Publisher
IndexedAt time.Time
Raw json.RawMessage
}
Result retains unknown resource types in Raw without interpreting them as Services.
type SearchRequest ¶
type SearchRequest struct {
Filters *ServiceFilters `json:"filters,omitempty"`
Limit int `json:"limit,omitempty"`
Query string `json:"query,omitempty"`
}
type SearchResponse ¶ added in v0.5.0
type SearchResponse[Item any] struct { Additional odp.AdditionalMembers Facets *Facets // Issues reports records this page carried that could not be used. They are reported rather // than raised because a directory is not an ODP protocol role: one unusable record says // nothing about the rest of the page. Issues []Issue Items []Item Next string }
type SearchSequence ¶ added in v0.5.0
type SearchSequence[Item any] struct { Items iter.Seq2[Item, error] Responses iter.Seq2[SearchResponse[Item], error] }
SearchSequence exposes independent, lazy traversals of the same search.
type Service ¶
type Service struct {
Additional odp.AdditionalMembers
Description string
DocumentationURL string
IndexedAt time.Time
Keywords []string
Language string
Localizations []string
Name string
Operations []odp.OperationDescriptor
Protocols *odp.ServiceProtocols
ServiceOrigin string
StatusURL string
SupportURL string
WebsiteURL string
}
type ServiceFilters ¶
type ServiceFilters struct {
Enrollment []odp.EnrollmentProtocol `json:"enrollment,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Operations []OperationFilter `json:"operations,omitempty"`
Payments []PaymentFilter `json:"payments,omitempty"`
Sources []SourceType `json:"sources,omitempty"`
Trust []odp.TrustProtocol `json:"trust,omitempty"`
}
type Source ¶ added in v0.5.1
type Source struct {
Additional odp.AdditionalMembers
Type SourceType
URL string
X402Discovery bool
}
Source identifies the discovery document, not an endpoint to invoke.
type SourceType ¶ added in v0.5.1
type SourceType string
const ( SourceODP SourceType = "odp" SourceOpenAPI SourceType = "openapi" )
type SuggestionRequest ¶
type SuggestionRequest struct {
Filters *ServiceFilters `json:"filters,omitempty"`
Limit int `json:"limit,omitempty"`
Prefix string `json:"prefix"`
}
Click to show internal directories.
Click to hide internal directories.