uploader

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMap

type CMap []*CMapShard

A "thread" safe map of type string:Anything. To avoid lock bottlenecks this map is dived to several (shardCount) map shards.

func NewCMap

func NewCMap() CMap

Creates a new concurrent map.

func (CMap) Add

func (m CMap) Add(key string)

Sets the given value under the specified key.

func (CMap) Clear added in v0.3.1

func (m CMap) Clear() int

func (CMap) Count

func (m CMap) Count() int

Returns the number of elements within the map.

func (CMap) Exists

func (m CMap) Exists(key string) bool

Retrieves an element from map under given key.

func (CMap) GetShard

func (m CMap) GetShard(key string) *CMapShard

Returns shard under given key

type CMapShard

type CMapShard struct {
	sync.RWMutex // Read Write mutex, guards access to internal map.
	// contains filtered or unexported fields
}

A "thread" safe string to anything map.

type Option

type Option func(u *Uploader)

func ClickHouse

func ClickHouse(dsn string) Option

func DataTable

func DataTable(t string) Option

func DataTimeout

func DataTimeout(t time.Duration) Option

func InProgressCallback

func InProgressCallback(cb func(string) bool) Option

func Logger

func Logger(logger zap.Logger) Option

func Path

func Path(path string) Option

func Threads

func Threads(t int) Option

func TreeDate

func TreeDate(t time.Time) Option

func TreeTable

func TreeTable(t string) Option

func TreeTimeout

func TreeTimeout(t time.Duration) Option

type Tree added in v0.3.0

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

func (*Tree) Success added in v0.3.0

func (tree *Tree) Success()

type Uploader

type Uploader struct {
	stop.Struct
	sync.Mutex
	// contains filtered or unexported fields
}

Uploader upload files from local directory to clickhouse

func New

func New(options ...Option) *Uploader

func (*Uploader) ClearTreeExistsCache added in v0.3.1

func (u *Uploader) ClearTreeExistsCache()

func (*Uploader) MakeTree

func (u *Uploader) MakeTree(filename string) (*Tree, error)

func (*Uploader) Start

func (u *Uploader) Start() error

func (*Uploader) Stat

func (u *Uploader) Stat(send func(metric string, value float64))

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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