wf

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoNewAssets = errors.New("no new assets")

Functions

This section is empty.

Types

type AssetListMode

type AssetListMode int

AssetListMode specifies whether to retrive full asset list or diff only.

const (
	FullAssets AssetListMode = iota
	DiffAssets
)

Enum values for AssetListMode.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client communicating with WF API.

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient creates a new client with the supplied configuration. If the configuration is nil, use DefaultClientConfig.

func (*Client) FetchAssetsFromAPI

func (client *Client) FetchAssetsFromAPI() error

FetchAssetsFromAPI fetches metadata from API then download and extract the assets archives.

type ClientConfig

type ClientConfig struct {
	Version     string
	Mode        AssetListMode
	Workdir     string
	Concurrency int
	Region      ServiceRegion
}

ClientConfig is the configuration for the client.

func DefaultClientConfig

func DefaultClientConfig() *ClientConfig

DefaultClientConfig generates a default configuration.

type Extractor

type Extractor struct {
	// contains filtered or unexported fields
}

Extractor parses and extracts WF assets.

func NewExtractor

func NewExtractor(config *ExtractorConfig) (*Extractor, error)

NewExtractor creates a new extractor with the supplied configuration. If the configuration is nil, use DefaultExtractorConfig.

func (*Extractor) ExtractAssets

func (extractor *Extractor) ExtractAssets() error

ExtractAssets extracts assets from downloaded files.

type ExtractorConfig

type ExtractorConfig struct {
	SrcPath     string
	DestPath    string
	PathList    string
	Concurrency int
	Indent      int
	FlattenCSV  bool
}

ExtractorConfig is the configuration for the extractor.

func DefaultExtractorConfig

func DefaultExtractorConfig() *ExtractorConfig

DefaultExtractorConfig generates a default configuration.

type ServiceRegion added in v0.7.0

type ServiceRegion int
const (
	RegionJP ServiceRegion = iota
	RegionGL
	RegionKR
)

Enum values for ServiceRegion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL