Documentation ¶
Overview ¶
Package protocolsio provides support for working with the protocols.io API. It currently provides the ability to crawl public protocols.
Package protocolsiocmd provides support for building command line tools that access protocols.io.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProtocolCrawler ¶
func NewProtocolCrawler(ctx context.Context, cfg apicrawlcmd.Crawl[Service], fs operations.FS, downloadsPath string, op checkpoint.Operation, fv *CrawlFlags, token *apitokens.T) (*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.
func OptionsForEndpoint ¶
func OptionsForEndpoint(cfg apicrawlcmd.Crawl[Service], token *apitokens.T) ([]operations.Option, error)
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Çommand implements the command line operations available for protocols.io.
func NewCommand ¶
func NewCommand(crawl apicrawlcmd.Crawl[yaml.Node], fs operations.FS, chkpt checkpoint.Operation, token *apitokens.T) (*Command, error)
NewCommand returns a new Command instance for the specified API crawl with API authentication information read from the specified file or from the context.
type CrawlFlags ¶
type CrawlFlags struct { Save bool `subcmd:"save,true,'save downloaded protocols to disk'"` IgnoreCheckpoint bool `subcmd:"ignore-checkpoint,false,'ignore the checkpoint files'"` Pages flags.IntRangeSpec `subcmd:"pages,,page range to return"` PageSize int `subcmd:"size,50,number of items in each page"` Key string `` /* 259-byte string literal not displayed */ }
type ScanFlags ¶
type ScanFlags struct {
Template string `subcmd:"template,'{{.ID}}',template to use for printing fields in the downloaded Protocol objects"`
}
type Service ¶
type Service struct { Filter string `yaml:"filter" cmd:"filter to apply to protocols.io API calls, typically public"` OrderField string `yaml:"order_field" cmd:"field used to order API responses, typically id"` OrderDirection string `yaml:"order_direction" cmd:"order direction to apply to protocols.io API calls, typically asc"` Incremental bool `yaml:"incremental" cmd:"if true, only download new or updated protocols"` }
Service represents the protocols.io specific confiugaration options.