Documentation
¶
Overview ¶
Package agent provides Agent-side ODP Service inspection, catalog navigation, and discovery.
Index ¶
- Constants
- Variables
- type Agent
- type AgentOptions
- type Cache
- type CacheFallbacks
- type CacheRecord
- type Capabilities
- type CapabilityIssue
- type CapabilityKind
- type CapabilityScope
- type CollectionSearchOptions
- type ContinuationOptions
- type DiscoveredAction
- type DiscoveredHTTPAction
- type DiscoveredOpenAPIAction
- type DiscoveryEvent
- type DiscoveryEventType
- type FederatedSearchRequest
- type Freshness
- type Inspection
- type ListOptions
- type MemoryCache
- type OfferingDetails
- type OfferingIssue
- type OfferingIssueScope
- type OfferingSearchOptions
- type RequestError
- type ResolvedAction
- type ResolvedSortDefinition
- type SearchCapabilityCatalog
- type ServiceClient
- func (client *ServiceClient) ContinueListCollectionPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Page[odp.Collection], error]
- func (client *ServiceClient) ContinueListCollections(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Collection, error]
- func (client *ServiceClient) ContinueListOfferingPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
- func (client *ServiceClient) ContinueListOfferings(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Offering, error]
- func (client *ServiceClient) ContinueSearchCollectionPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Page[odp.Collection], error]
- func (client *ServiceClient) ContinueSearchCollections(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Collection, error]
- func (client *ServiceClient) ContinueSearchOfferingPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
- func (client *ServiceClient) ContinueSearchOfferings(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Offering, error]
- func (client *ServiceClient) GetCollection(ctx context.Context, id string, representation odp.Representation) (odp.Collection, error)
- func (client *ServiceClient) GetCollectionSearchCapabilities(ctx context.Context, id string) (SearchCapabilityCatalog, error)
- func (client *ServiceClient) GetOffering(ctx context.Context, id string, representation odp.Representation) (odp.Offering, error)
- func (client *ServiceClient) GetOfferingDetails(ctx context.Context, id string) (OfferingDetails, error)
- func (client *ServiceClient) GetOfferingSearchCapabilities(ctx context.Context, collectionID string) (SearchCapabilityCatalog, error)
- func (client *ServiceClient) Inspect(ctx context.Context) (Inspection, error)
- func (client *ServiceClient) ListCollectionOfferingPages(ctx context.Context, collectionID string, options ListOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
- func (client *ServiceClient) ListCollectionOfferings(ctx context.Context, collectionID string, options ListOptions) iter.Seq2[odp.Offering, error]
- func (client *ServiceClient) ListCollectionPages(ctx context.Context, options ListOptions) iter.Seq2[odp.Page[odp.Collection], error]
- func (client *ServiceClient) ListCollections(ctx context.Context, options ListOptions) iter.Seq2[odp.Collection, error]
- func (client *ServiceClient) ListOfferingPages(ctx context.Context, options ListOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
- func (client *ServiceClient) ListOfferings(ctx context.Context, options ListOptions) iter.Seq2[odp.Offering, error]
- func (client *ServiceClient) ResolveAction(ctx context.Context, offeringID, actionID string) (ResolvedAction, error)
- func (client *ServiceClient) SearchCollectionPages(ctx context.Context, options CollectionSearchOptions) iter.Seq2[odp.Page[odp.Collection], error]
- func (client *ServiceClient) SearchCollections(ctx context.Context, options CollectionSearchOptions) iter.Seq2[odp.Collection, error]
- func (client *ServiceClient) SearchOfferingPages(ctx context.Context, options OfferingSearchOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
- func (client *ServiceClient) SearchOfferings(ctx context.Context, options OfferingSearchOptions) iter.Seq2[odp.Offering, error]
- type ServiceClientFactory
- type ServiceClientOptions
Constants ¶
Variables ¶
View Source
var ErrUnsupportedOperation = errors.New("ODP Service does not advertise the requested operation")
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func New ¶
func New(options AgentOptions) (*Agent, error)
func (*Agent) Environment ¶
func (agent *Agent) Environment() directory.Environment
func (*Agent) SearchOfferingsAcrossServices ¶
func (agent *Agent) SearchOfferingsAcrossServices(ctx context.Context, request FederatedSearchRequest) iter.Seq2[DiscoveryEvent, error]
type AgentOptions ¶
type AgentOptions struct {
Directory *directory.Client
DirectoryHTTPClient *http.Client
Environment directory.Environment
ServiceClient ServiceClientFactory
}
type CacheFallbacks ¶
type CacheRecord ¶
type Capabilities ¶
type Capabilities struct {
Enrollment []odp.EnrollmentProtocol
Operations []odp.OperationDescriptor
Payments []odp.PaymentProtocol
}
type CapabilityIssue ¶
type CapabilityIssue struct {
Kind CapabilityKind
Message string
Scope CapabilityScope
}
type CapabilityKind ¶
type CapabilityKind string
const ( CapabilityKindFilters CapabilityKind = "filters" CapabilityKindSorts CapabilityKind = "sorts" )
type CapabilityScope ¶
type CapabilityScope string
const ( CapabilityScopeCollection CapabilityScope = "collection" CapabilityScopeService CapabilityScope = "service" )
type CollectionSearchOptions ¶
type ContinuationOptions ¶ added in v0.2.0
type ContinuationOptions struct {
MaxItems int
MaxPages int
Representation odp.Representation
}
type DiscoveredAction ¶
type DiscoveredAction struct {
Authentication odp.AuthenticationRequirement
Description string
HTTP *DiscoveredHTTPAction
ID string
OpenAPI *DiscoveredOpenAPIAction
Rel odp.ActionRelation
}
type DiscoveredHTTPAction ¶
type DiscoveredHTTPAction struct {
Method string
Request *odp.ActionRequest
ResponseContentTypes []string
URL string
}
type DiscoveredOpenAPIAction ¶
type DiscoveryEvent ¶
type DiscoveryEventType ¶
type DiscoveryEventType string
const ( DiscoveryOffering DiscoveryEventType = "offering" DiscoveryIssue DiscoveryEventType = "issue" )
type FederatedSearchRequest ¶
type FederatedSearchRequest struct {
Concurrency int
MaxOfferingsPerService int
MaxServices int
Offerings OfferingSearchOptions
Services directory.SearchRequest
}
type Inspection ¶
type Inspection struct {
Capabilities Capabilities
Document odp.ServiceDocument
FinalURL string
Freshness Freshness
RequestedURL string
ServiceOrigin string
}
type ListOptions ¶
type ListOptions struct {
Limit int
MaxItems int
MaxPages int
Representation odp.Representation
}
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) Get ¶
func (cache *MemoryCache) Get(_ context.Context, key string) (CacheRecord, bool, error)
func (*MemoryCache) Set ¶
func (cache *MemoryCache) Set(_ context.Context, key string, record CacheRecord) error
type OfferingDetails ¶
type OfferingDetails struct {
odp.Offering
Actions []DiscoveredAction
AttributeSchema map[string]any
Issues []OfferingIssue
}
type OfferingIssue ¶
type OfferingIssue struct {
ActionID string
Message string
Scope OfferingIssueScope
}
type OfferingIssueScope ¶
type OfferingIssueScope string
const ( OfferingIssueAction OfferingIssueScope = "action" OfferingIssueAttributeSchema OfferingIssueScope = "attribute_schema" OfferingIssueAttributes OfferingIssueScope = "attributes" )
type OfferingSearchOptions ¶
type RequestError ¶
type RequestError struct {
Code string
Header http.Header
Problem *odp.ProblemDetails
Retryable bool
Status int
}
func (*RequestError) Error ¶
func (err *RequestError) Error() string
type ResolvedAction ¶
type ResolvedSortDefinition ¶
type ResolvedSortDefinition struct {
odp.SortDefinition
Filters []odp.FilterDefinition
}
type SearchCapabilityCatalog ¶
type SearchCapabilityCatalog struct {
Filters map[string]odp.FilterDefinition
Issues []CapabilityIssue
Sorts map[string]ResolvedSortDefinition
}
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
func NewServiceClient ¶
func NewServiceClient(options ServiceClientOptions) (*ServiceClient, error)
func (*ServiceClient) ContinueListCollectionPages ¶ added in v0.2.0
func (client *ServiceClient) ContinueListCollectionPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Page[odp.Collection], error]
func (*ServiceClient) ContinueListCollections ¶ added in v0.2.0
func (client *ServiceClient) ContinueListCollections(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Collection, error]
func (*ServiceClient) ContinueListOfferingPages ¶ added in v0.2.0
func (client *ServiceClient) ContinueListOfferingPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
func (*ServiceClient) ContinueListOfferings ¶ added in v0.2.0
func (client *ServiceClient) ContinueListOfferings(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Offering, error]
func (*ServiceClient) ContinueSearchCollectionPages ¶ added in v0.2.0
func (client *ServiceClient) ContinueSearchCollectionPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Page[odp.Collection], error]
func (*ServiceClient) ContinueSearchCollections ¶ added in v0.2.0
func (client *ServiceClient) ContinueSearchCollections(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Collection, error]
func (*ServiceClient) ContinueSearchOfferingPages ¶ added in v0.2.0
func (client *ServiceClient) ContinueSearchOfferingPages(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
func (*ServiceClient) ContinueSearchOfferings ¶ added in v0.2.0
func (client *ServiceClient) ContinueSearchOfferings(ctx context.Context, next string, options ContinuationOptions) iter.Seq2[odp.Offering, error]
func (*ServiceClient) GetCollection ¶
func (client *ServiceClient) GetCollection(ctx context.Context, id string, representation odp.Representation) (odp.Collection, error)
func (*ServiceClient) GetCollectionSearchCapabilities ¶
func (client *ServiceClient) GetCollectionSearchCapabilities(ctx context.Context, id string) (SearchCapabilityCatalog, error)
func (*ServiceClient) GetOffering ¶
func (client *ServiceClient) GetOffering(ctx context.Context, id string, representation odp.Representation) (odp.Offering, error)
func (*ServiceClient) GetOfferingDetails ¶
func (client *ServiceClient) GetOfferingDetails(ctx context.Context, id string) (OfferingDetails, error)
func (*ServiceClient) GetOfferingSearchCapabilities ¶
func (client *ServiceClient) GetOfferingSearchCapabilities(ctx context.Context, collectionID string) (SearchCapabilityCatalog, error)
func (*ServiceClient) Inspect ¶
func (client *ServiceClient) Inspect(ctx context.Context) (Inspection, error)
func (*ServiceClient) ListCollectionOfferingPages ¶
func (client *ServiceClient) ListCollectionOfferingPages(ctx context.Context, collectionID string, options ListOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
func (*ServiceClient) ListCollectionOfferings ¶
func (client *ServiceClient) ListCollectionOfferings(ctx context.Context, collectionID string, options ListOptions) iter.Seq2[odp.Offering, error]
func (*ServiceClient) ListCollectionPages ¶
func (client *ServiceClient) ListCollectionPages(ctx context.Context, options ListOptions) iter.Seq2[odp.Page[odp.Collection], error]
func (*ServiceClient) ListCollections ¶
func (client *ServiceClient) ListCollections(ctx context.Context, options ListOptions) iter.Seq2[odp.Collection, error]
func (*ServiceClient) ListOfferingPages ¶
func (client *ServiceClient) ListOfferingPages(ctx context.Context, options ListOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
func (*ServiceClient) ListOfferings ¶
func (client *ServiceClient) ListOfferings(ctx context.Context, options ListOptions) iter.Seq2[odp.Offering, error]
func (*ServiceClient) ResolveAction ¶
func (client *ServiceClient) ResolveAction(ctx context.Context, offeringID, actionID string) (ResolvedAction, error)
func (*ServiceClient) SearchCollectionPages ¶
func (client *ServiceClient) SearchCollectionPages(ctx context.Context, options CollectionSearchOptions) iter.Seq2[odp.Page[odp.Collection], error]
func (*ServiceClient) SearchCollections ¶
func (client *ServiceClient) SearchCollections(ctx context.Context, options CollectionSearchOptions) iter.Seq2[odp.Collection, error]
func (*ServiceClient) SearchOfferingPages ¶
func (client *ServiceClient) SearchOfferingPages(ctx context.Context, options OfferingSearchOptions) iter.Seq2[odp.OfferingPage[odp.Offering], error]
func (*ServiceClient) SearchOfferings ¶
func (client *ServiceClient) SearchOfferings(ctx context.Context, options OfferingSearchOptions) iter.Seq2[odp.Offering, error]
type ServiceClientFactory ¶
Click to show internal directories.
Click to hide internal directories.