config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig() error

LoadConfig loads the config from the disk

Types

type Cart

type Cart struct {
	Name    string
	Created time.Time
	CartID  string
	HMAC    string
}

Cart represents an active vart in the config

type Config

type Config struct {
	Version     string
	Locale      string
	ResultCache map[string]map[string]string
	Carts       map[string]*Cart
}

Config is the top level config structure

func GetConfig

func GetConfig() *Config

GetConfig returns the current config

func (Config) ASINFromCache

func (c Config) ASINFromCache(cache string, item string) (string, bool)

ASINFromCache returns a asin from a named cache

func (Config) CartItemIDFromCache added in v0.1.2

func (c Config) CartItemIDFromCache(cartName string, item string) (string, bool)

CartItemIDFromCache returns a cart item ID from a named cart

func (Config) CartNameFromCache

func (c Config) CartNameFromCache(indexOrName string) string

CartNameFromCache returns a cart name from the cart cache

func (*Config) Flush

func (c *Config) Flush()

Flush writes the config to disk

func (Config) FromCache

func (c Config) FromCache(cache string, key string) (string, bool)

FromCache returns a key from a named cache

func (Config) NumericFromCache

func (c Config) NumericFromCache(cache string, index string) string

NumericFromCache returns a numeric value from a named cache

Jump to

Keyboard shortcuts

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