config

package
v0.0.0-...-3728ce2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config provides configuration stuff

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteConfig

func WriteConfig(conf *Config, w io.Writer) error

WriteConfig writes the given configuration to the given Writer

Types

type Config

type Config struct {
	Site []Site
}

Config is used to store all the sites in an array

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a new default config

func ReadConfig

func ReadConfig(data string) (*Config, error)

ReadConfig reads a config from the given string

type Site

type Site struct {
	Description string
	URL         string
	Username    string
	Password    string
	LastCheck   time.Time
	LastBytes   int
	LastHash    string
}

Site is used to store information about the sites to check

type ThreadSafeConfigWrapper

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

ThreadSafeConfigWrapper is a wrapper for reading and editing a configuration struct from multiple goroutines

func (*ThreadSafeConfigWrapper) Get

Get returns the stored config, threadsafe

func (*ThreadSafeConfigWrapper) Set

func (t *ThreadSafeConfigWrapper) Set(c Config)

Set sets the config, threadsafe

func (*ThreadSafeConfigWrapper) SetSite

func (t *ThreadSafeConfigWrapper) SetSite(pos int, s Site)

SetSite sets a specific site, threadsafe

Jump to

Keyboard shortcuts

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