Documentation
¶
Overview ¶
Package directory provides the canonical ODP Service directory client.
Index ¶
- type Client
- func (client *Client) ContinueSearchPages(ctx context.Context, next string, options IterationOptions) iter.Seq2[SearchPage, error]
- func (client *Client) ContinueSearchServices(ctx context.Context, next string, options IterationOptions) iter.Seq2[Service, error]
- func (client *Client) Environment() Environment
- func (client *Client) SearchPages(ctx context.Context, request SearchRequest, options IterationOptions) iter.Seq2[SearchPage, error]
- func (client *Client) SearchServices(ctx context.Context, request SearchRequest, options IterationOptions) iter.Seq2[Service, error]
- func (client *Client) SuggestServices(ctx context.Context, request SuggestionRequest) ([]string, error)
- type Environment
- type Facet
- type Facets
- type Issue
- type IssueScope
- type IterationOptions
- type OperationFilter
- type Options
- type PaymentFilter
- type PaymentOptionFacetValue
- type RequestError
- type SearchPage
- type SearchRequest
- type Service
- type ServiceFilters
- 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) ContinueSearchPages ¶ added in v0.4.0
func (client *Client) ContinueSearchPages(ctx context.Context, next string, options IterationOptions) iter.Seq2[SearchPage, error]
ContinueSearchPages resumes a traversal from the Next of a page a previous search yielded, so a caller that stopped at its own page budget can pick the sequence up rather than start again.
func (*Client) ContinueSearchServices ¶ added in v0.4.0
func (client *Client) ContinueSearchServices(ctx context.Context, next string, options IterationOptions) iter.Seq2[Service, error]
ContinueSearchServices resumes an item traversal from a page's Next.
func (*Client) Environment ¶
func (client *Client) Environment() Environment
func (*Client) SearchPages ¶
func (client *Client) SearchPages(ctx context.Context, request SearchRequest, options IterationOptions) iter.Seq2[SearchPage, error]
func (*Client) SearchServices ¶
func (client *Client) SearchServices(ctx context.Context, request SearchRequest, options IterationOptions) iter.Seq2[Service, error]
func (*Client) SuggestServices ¶
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 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 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 RequestError ¶
func (*RequestError) Error ¶
func (err *RequestError) Error() string
type SearchPage ¶
type SearchPage 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 []Service
Next string
}
type SearchRequest ¶
type SearchRequest struct {
Filters *ServiceFilters `json:"filters,omitempty"`
Limit int `json:"limit,omitempty"`
Query string `json:"query,omitempty"`
}
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"`
Trust []odp.TrustProtocol `json:"trust,omitempty"`
}
type SuggestionRequest ¶
Click to show internal directories.
Click to hide internal directories.