tdb

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: Apache-2.0 Imports: 25 Imported by: 1

README

tdb Build Status Coverage Status

Documentation

Overview

Package tdb is a generated protocol buffer package.

It is generated from these files:

tdb.proto

It has these top-level messages:

Info

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPathNotFolder path is not a folder
	ErrPathNotFolder = errors.New("path for is not a folder")
	// ErrPathNotFile path is not a file
	ErrPathNotFile = errors.New("path is not a file")
	// ErrNotExist something not exist
	ErrNotExist = errors.New("not exist")
	// ErrRange the range is wrong
	ErrRange = errors.New("range is wrong")
	// ErrActionValue error for action value field
	ErrActionValue = errors.New("action value bytes wrong")
)

Functions

This section is empty.

Types

type Info

type Info struct {
	Fields map[string][]byte `` /* 139-byte string literal not displayed */
}

func (*Info) Descriptor

func (*Info) Descriptor() ([]byte, []int)

func (*Info) GetFields

func (m *Info) GetFields() map[string][]byte

func (*Info) ProtoMessage

func (*Info) ProtoMessage()

func (*Info) Reset

func (m *Info) Reset()

func (*Info) String

func (m *Info) String() string

type TDB

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

TDB is the entrance point.

func Open

func Open(p string) (*TDB, error)

Open creates an instance of TDB. "p" should be a path for folder, if not exist, create one.

func (*TDB) AddAction added in v0.2.0

func (db *TDB) AddAction(target string, ts uint32) error

AddAction used to add actions to database

func (*TDB) AddSlot

func (db *TDB) AddSlot(target string, start, howlong uint32) error

AddSlot to add a slot to database

func (*TDB) Arch

func (db *TDB) Arch() (string, error)

Arch info

func (*TDB) CheckExpirations added in v0.2.1

func (db *TDB) CheckExpirations() error

CheckExpirations to check expired actions

func (*TDB) CreateAt

func (db *TDB) CreateAt() (uint32, error)

CreateAt unixtime

func (*TDB) GetActions added in v0.2.0

func (db *TDB) GetActions() ([]string, []uint32, []uint32, error)

GetActions to get all actions. return targets, starts, lasts, error

func (*TDB) GetSlots added in v0.2.5

func (db *TDB) GetSlots(target string, start, end uint32) ([][]uint32, [][]uint32, error)

GetSlots to get slots of a target in certain range return unix time and slots

func (*TDB) GetTargets

func (db *TDB) GetTargets() []string

GetTargets to get all the targets

func (*TDB) Host

func (db *TDB) Host() (string, error)

Host name

func (*TDB) OS

func (db *TDB) OS() (string, error)

OS info

func (*TDB) Tag

func (db *TDB) Tag() (string, error)

Tag for database

func (*TDB) Username

func (db *TDB) Username() (string, error)

Username info

func (*TDB) Version

func (db *TDB) Version() (uint8, error)

Version for tdb.

func (*TDB) ZoneOffset

func (db *TDB) ZoneOffset() (int32, error)

ZoneOffset of local zone

Jump to

Keyboard shortcuts

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