Documentation ¶
Index ¶
- Constants
- Variables
- func CompressionLevelStrings() []string
- func InitLog()
- func NewContext(ctx context.Context, conf *Config) context.Context
- type CompressionLevel
- func (i CompressionLevel) IsACompressionLevel() bool
- func (i CompressionLevel) MarshalText() ([]byte, error)
- func (c *CompressionLevel) Set(s string) error
- func (i CompressionLevel) String() string
- func (c *CompressionLevel) ToPNG() png.CompressionLevel
- func (c *CompressionLevel) Type() string
- func (i *CompressionLevel) UnmarshalText(text []byte) error
- type Config
- func (c *Config) BuildURL(year, zoom int, pt image.Point, format string) *url.URL
- func (c *Config) CheckYear(ctx context.Context) error
- func (c *Config) FindFormat(ctx context.Context) error
- func (c *Config) GetYearBounds() (image.Rectangle, error)
- func (c *Config) MaxForZoom() (image.Point, error)
- func (c *Config) RegisterCompletions(cmd *cobra.Command)
- func (c *Config) RegisterFlags(cmd *cobra.Command)
- func (c *Config) TileCount() int
- func (c *Config) TilesHorizontal() int
- func (c *Config) TilesVertical() int
- func (c *Config) UpdateBounds() error
Constants ¶
View Source
const ( Zoom6Max = 64 Zoom5Max = 32 Zoom4Max = 16 Zoom3Max = 8 Zoom2Max = 4 )
View Source
const ( FlagBaseURL = "base-url" FlagInsecure = "insecure" FlagYear = "year" FlagFullImage = "full-image" FlagCropLeft = "crop-left" FlagCropRight = "crop-right" FlagCropTop = "crop-top" FlagCropBottom = "crop-bottom" FlagZoom = "zoom" FlagParallelism = "parallelism" FlagFormat = "format" FlagCompression = "compression" FlagNoProgress = "no-progress" )
Variables ¶
View Source
var ( ErrBoundsTooSmall = errors.New("bounds too small") ErrBoundsTooLarge = errors.New("bounds too large") )
View Source
var ( ErrNoFormat = errors.New("could not discover file format") ErrUnexpectedResponse = errors.New("unexpected response") )
View Source
var ErrInvalidZoom = errors.New("invalid zoom")
View Source
var ErrMissingConfig = errors.New("command missing config")
View Source
var ErrMissingYear = errors.New("map is not available for year")
Functions ¶
func CompressionLevelStrings ¶
func CompressionLevelStrings() []string
CompressionLevelStrings returns a slice of all String values of the enum
Types ¶
type CompressionLevel ¶
type CompressionLevel int
const ( CompressionDefault CompressionLevel = iota CompressionNone CompressionFast CompressionBest )
func CompressionLevelString ¶
func CompressionLevelString(s string) (CompressionLevel, error)
CompressionLevelString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func CompressionLevelValues ¶
func CompressionLevelValues() []CompressionLevel
CompressionLevelValues returns all values of the enum
func (CompressionLevel) IsACompressionLevel ¶
func (i CompressionLevel) IsACompressionLevel() bool
IsACompressionLevel returns "true" if the value is listed in the enum definition. "false" otherwise
func (CompressionLevel) MarshalText ¶
func (i CompressionLevel) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for CompressionLevel
func (*CompressionLevel) Set ¶
func (c *CompressionLevel) Set(s string) error
func (CompressionLevel) String ¶
func (i CompressionLevel) String() string
func (*CompressionLevel) ToPNG ¶
func (c *CompressionLevel) ToPNG() png.CompressionLevel
func (*CompressionLevel) Type ¶
func (c *CompressionLevel) Type() string
func (*CompressionLevel) UnmarshalText ¶
func (i *CompressionLevel) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for CompressionLevel
type Config ¶
type Config struct { Completion string BaseURL pflagx.URL Insecure bool Client *http.Client Year int TileSize int FullImage bool Crop image.Rectangle Bounds image.Rectangle Zoom int Parallelism int Format string Compression CompressionLevel NoProgress bool }
func (*Config) GetYearBounds ¶ added in v0.3.0
func (*Config) RegisterCompletions ¶
func (*Config) RegisterFlags ¶
func (*Config) TilesHorizontal ¶ added in v0.3.0
func (*Config) TilesVertical ¶ added in v0.3.0
func (*Config) UpdateBounds ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.