wf

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 30 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
	NoDefaultPaths bool
	Concurrency    int
	Indent         int
	FlattenCSV     bool
	Eliyabot       bool
}

ExtractorConfig is the configuration for the extractor.

func DefaultExtractorConfig

func DefaultExtractorConfig() *ExtractorConfig

DefaultExtractorConfig generates a default configuration.

type Hasher added in v0.9.0

type Hasher struct {
}

Hasher hashes

func (*Hasher) HashAssetPath added in v0.9.0

func (*Hasher) HashAssetPath(path string) (string, error)

HashAssetPath returns hashed asset path.

type ServiceRegion added in v0.7.0

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

Enum values for ServiceRegion.

type Spriter added in v0.9.0

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

Spriter extracts and crops WF sprites.

func NewSpriter added in v0.9.0

func NewSpriter(config *SpriterConfig) (*Spriter, error)

NewSpriter creates a new spriter with the supplied configuration. If the configuration is nil, use DefaultSpriterConfig.

func (*Spriter) ExtractSprite added in v0.9.0

func (spriter *Spriter) ExtractSprite() error

ExtractSprite extracts and processes sprite assets.

type SpriterConfig added in v0.9.0

type SpriterConfig struct {
	SrcPath     string
	DestPath    string
	SpritePath  string
	Scale       float32
	Concurrency int
	Eliyabot    bool
}

SpriterConfig is the configuration for the spriter.

func DefaultSpriterConfig added in v0.9.0

func DefaultSpriterConfig() *SpriterConfig

DefaultSpriterConfig generates a default configuration.

Jump to

Keyboard shortcuts

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