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) CheckYear(ctx context.Context) error
- func (c *Config) DetermineOffsetsByYear() error
- func (c *Config) FindFormat(ctx context.Context) error
- func (c *Config) MaxForZoom() (image.Point, error)
- func (c *Config) OutputHeight() int
- func (c *Config) OutputWidth() int
- func (c *Config) RegisterCompletions(cmd *cobra.Command)
- func (c *Config) RegisterFlags(cmd *cobra.Command)
- func (c *Config) TileCount() int
Constants ¶
View Source
const ( Zoom6Max = 64 Zoom5Max = 32 Zoom4Max = 16 Zoom3Max = 8 Zoom2Max = 4 )
View Source
const ( FlagCompletion = "completion" FlagYear = "year" FlagNoCrop = "no-crop" FlagTileMinX = "tile-min-x" FlagTileMaxX = "tile-max-x" FlagTileMinY = "tile-min-y" FlagTileMaxY = "tile-max-y" FlagZoom = "zoom" FlagParallelism = "parallelism" FlagFormat = "format" FlagCompression = "compression" ShellBash = "bash" ShellZsh = "zsh" ShellFish = "fish" ShellPowerShell = "powershell" )
View Source
const URLTemplate = "https://tiles.telegeography.com/maps/submarine-cable-map-%d/%d/%d/%d.%s"
Variables ¶
View Source
var ( ErrMaxXTooLarge = errors.New("tile max x exceeds zoom level") ErrMaxYTooLarge = errors.New("tile max y exceeds zoom level") )
View Source
var ErrInvalidZoom = errors.New("invalid zoom")
View Source
var ErrMissingConfig = errors.New("command missing config")
View Source
var ErrMissingYear = errors.New("could not find year")
View Source
var ErrNoFormat = errors.New("could not discover file format")
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 Year int TileSize int NoCrop bool Tiles image.Rectangle Zoom int Parallelism int Format string Compression CompressionLevel }
func (*Config) DetermineOffsetsByYear ¶
func (*Config) OutputHeight ¶
func (*Config) OutputWidth ¶
func (*Config) RegisterCompletions ¶
func (*Config) RegisterFlags ¶
Click to show internal directories.
Click to hide internal directories.