Documentation ¶
Index ¶
- Constants
- func NewFetcher(fetcherOpts FetcherOptions, opts ...operations.Option) (...)
- func NewPaginator(_ context.Context, cp Checkpoint, opts PaginatorOptions) (operations.Paginator[protocolsiosdk.ListProtocolsV3], error)
- func NewProtocolCrawler(ctx context.Context, checkpoint Checkpoint, fopts FetcherOptions, ...) (...)
- type Checkpoint
- type FetcherOptions
- type PaginatorOptions
- type PublicBearerToken
Constants ¶
const ContentType = "protocols.io/protocol"
Variables ¶
This section is empty.
Functions ¶
func NewFetcher ¶
func NewFetcher(fetcherOpts FetcherOptions, opts ...operations.Option) (operations.Fetcher[protocolsiosdk.ListProtocolsV3, protocolsiosdk.ProtocolPayload], error)
NewFetcher returns an instance of operations.Fetcher for protocols.io 'GetList' operation.
func NewPaginator ¶
func NewPaginator(_ context.Context, cp Checkpoint, opts PaginatorOptions) (operations.Paginator[protocolsiosdk.ListProtocolsV3], error)
NewPaginator returns an instance of operations.Paginator for protocols.io 'GetList' operation.
func NewProtocolCrawler ¶
func NewProtocolCrawler( ctx context.Context, checkpoint Checkpoint, fopts FetcherOptions, popts PaginatorOptions, opts ...operations.Option) (*operations.Crawler[protocolsiosdk.ListProtocolsV3, protocolsiosdk.ProtocolPayload], error)
NewProtocolCrawler creates a new instance of operations.Crawler that can be used to crawl/download protocols on protocols.io.
Types ¶
type Checkpoint ¶
type Checkpoint struct { CompletedPage int64 `json:"completed_page"` CurrentPage int64 `json:"current_page"` TotalPages int64 `json:"total_pages"` }
Checkpoint represents the most recently completed page of the paginated crawl.
type FetcherOptions ¶
FetcherOptions represent the options for creating a new Fetcher, including a VersionMap which allows for incremental downloading of Protocol objects. The VersionMap contains the version ID of a previously downloaded instance of that protocol, keyed by it's ID. The fetcher will only redownload a protocol object if its version ID has channged. The VersionMap is typically built by scanning all previously downloaded protocol objects.
type PaginatorOptions ¶
type PublicBearerToken ¶
type PublicBearerToken struct {
Token string
}
PublicBearerToken is an implementation of operations.Authorizer for a protocols.io public bearer token.
func (PublicBearerToken) WithAuthorization ¶
Directories ¶
Path | Synopsis |
---|---|
Package protocolsio provides support for working with the protocols.io API.
|
Package protocolsio provides support for working with the protocols.io API. |
Package protocolsiosdk provides a minimal SDK for the protocols.io API.
|
Package protocolsiosdk provides a minimal SDK for the protocols.io API. |