je: github.com/prologic/je Index | Files | Directories

package je

import "github.com/prologic/je"

Index

Package Files

bitcask_store.go bolt_store.go data.go handlers.go indexer.go init.go job.go memory_store.go metrics.go server.go state.go store.go utils.go version.go

Constants

const (
    DefaultDataPath = "./data"
    DefaultBacklog  = 32
    DefaultThreads  = 16
)

Variables

var (
    // Version release version
    Version = "1.0.0"

    // Build will be overwritten automatically by the build system
    Build = "dev"

    // GitCommit will be overwritten automatically by the build system
    GitCommit = "HEAD"
)
var DefObjectives = map[float64]float64{
    0.50: 0.05,
    0.90: 0.01,
    0.95: 0.005,
    0.99: 0.001,
}

DefObjectives ...

var (
    ErrNotExist = errors.New("key does not exist")
)

func FullVersion Uses

func FullVersion() string

FullVersion returns the full version, build and commit hash

func SafeParseInt Uses

func SafeParseInt(s string, d int) int

SafeParseInt ...

func SafeParseUint64 Uses

func SafeParseUint64(s string, d uint64) uint64

SafeParseUint64 ...

type BitcaskStore Uses

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

func (*BitcaskStore) All Uses

func (store *BitcaskStore) All() (jobs []*Job, err error)

func (*BitcaskStore) Close Uses

func (store *BitcaskStore) Close() error

func (*BitcaskStore) Find Uses

func (store *BitcaskStore) Find(ids ...ID) (jobs []*Job, err error)

func (*BitcaskStore) Get Uses

func (store *BitcaskStore) Get(id ID) (job *Job, err error)

func (*BitcaskStore) NextId Uses

func (store *BitcaskStore) NextId() ID

func (*BitcaskStore) Save Uses

func (store *BitcaskStore) Save(job *Job) error

func (*BitcaskStore) Search Uses

func (store *BitcaskStore) Search(q string) (jobs []*Job, err error)

type BoltStore Uses

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

func (*BoltStore) All Uses

func (store *BoltStore) All() (jobs []*Job, err error)

func (*BoltStore) Close Uses

func (store *BoltStore) Close() error

func (*BoltStore) Find Uses

func (store *BoltStore) Find(ids ...ID) (jobs []*Job, err error)

func (*BoltStore) Get Uses

func (store *BoltStore) Get(id ID) (*Job, error)

func (*BoltStore) NextId Uses

func (store *BoltStore) NextId() ID

func (*BoltStore) Save Uses

func (store *BoltStore) Save(job *Job) error

func (*BoltStore) Search Uses

func (store *BoltStore) Search(q string) (jobs []*Job, err error)

type Data Uses

type Data interface {
    Read(id ID, dtype DataType) (io.ReadCloser, error)
    Write(id ID, dtype DataType) (io.WriteCloser, error)
    Tail(id ID, dtype DataType, ctx context.Context) (chan string, chan error)
}

func InitData Uses

func InitData(path string) (Data, error)

func NewLocalData Uses

func NewLocalData(path string) (data Data, err error)

type DataType Uses

type DataType int
const (
    DATA_INPUT DataType = iota
    DATA_OUTPUT
    DATA_LOGS
)

func (DataType) String Uses

func (dt DataType) String() string

type ID Uses

type ID uint64

func ParseId Uses

func ParseId(s string) ID

func (ID) Bytes Uses

func (id ID) Bytes() []byte

func (ID) String Uses

func (id ID) String() string

type IdGenerator Uses

type IdGenerator struct {
    sync.Mutex
    // contains filtered or unexported fields
}

func (*IdGenerator) Next Uses

func (id *IdGenerator) Next() ID

type Job Uses

type Job struct {
    sync.RWMutex

    ID          ID        `json:"id"`
    Name        string    `json:"name"`
    Args        []string  `json:"args"`
    Interactive bool      `json:"interactive"`
    Worker      string    `json:"worker"`
    State       State     `json:"state"`
    Status      int       `json:"status"`
    CreatedAt   time.Time `json:"created"`
    StartedAt   time.Time `json:"started"`
    StoppedAt   time.Time `json:"stopped"`
    KilledAt    time.Time `json:"killed"`
    ErroredAt   time.Time `json:"errored"`
    // contains filtered or unexported fields
}

Job ...

func NewJob Uses

func NewJob(name string, args []string, interactive bool) (job *Job, err error)

func (*Job) Close Uses

func (j *Job) Close() error

func (*Job) Enqueue Uses

func (j *Job) Enqueue() error

func (*Job) Error Uses

func (j *Job) Error(err error) error

func (*Job) Execute Uses

func (j *Job) Execute() (err error)

func (*Job) Id Uses

func (j *Job) Id() ID

func (*Job) Kill Uses

func (j *Job) Kill(force bool) (err error)

func (*Job) Killed Uses

func (j *Job) Killed() bool

func (*Job) Log Uses

func (j *Job) Log(msg string) error

func (*Job) Start Uses

func (j *Job) Start(worker string) error

func (*Job) Stop Uses

func (j *Job) Stop() error

func (*Job) Wait Uses

func (j *Job) Wait()

func (*Job) Write Uses

func (j *Job) Write(input io.Reader) (int64, error)

type KeyError Uses

type KeyError struct {
    Key ID
    Err error
}

func (*KeyError) Error Uses

func (e *KeyError) Error() string

type LocalData Uses

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

func (*LocalData) Read Uses

func (d *LocalData) Read(id ID, dtype DataType) (io.ReadCloser, error)

func (*LocalData) Tail Uses

func (d *LocalData) Tail(id ID, dtype DataType, ctx context.Context) (lines chan string, errors chan error)

func (*LocalData) Write Uses

func (d *LocalData) Write(id ID, dtype DataType) (io.WriteCloser, error)

type MemoryStore Uses

type MemoryStore struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

func (*MemoryStore) All Uses

func (store *MemoryStore) All() (jobs []*Job, err error)

func (*MemoryStore) Close Uses

func (store *MemoryStore) Close() error

func (*MemoryStore) Find Uses

func (store *MemoryStore) Find(ids ...ID) (jobs []*Job, err error)

func (*MemoryStore) Get Uses

func (store *MemoryStore) Get(id ID) (job *Job, err error)

func (*MemoryStore) NextId Uses

func (store *MemoryStore) NextId() ID

func (*MemoryStore) Save Uses

func (store *MemoryStore) Save(job *Job) error

func (*MemoryStore) Search Uses

func (store *MemoryStore) Search(q string) (jobs []*Job, err error)

type Metrics Uses

type Metrics struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

Metrics ...

func InitMetrics Uses

func InitMetrics(name string) *Metrics

func NewMetrics Uses

func NewMetrics(namespace string) *Metrics

NewMetrics ...

func (*Metrics) Counter Uses

func (m *Metrics) Counter(subsystem, name string) prometheus.Counter

Counter ...

func (*Metrics) CounterVec Uses

func (m *Metrics) CounterVec(subsystem, name string) *prometheus.CounterVec

CounterVec ...

func (*Metrics) Gauge Uses

func (m *Metrics) Gauge(subsystem, name string) prometheus.Gauge

Gauge ...

func (*Metrics) GaugeVec Uses

func (m *Metrics) GaugeVec(subsystem, name string) *prometheus.GaugeVec

GaugeVec ...

func (*Metrics) Handler Uses

func (m *Metrics) Handler() http.Handler

Handler ...

func (*Metrics) NewCounter Uses

func (m *Metrics) NewCounter(subsystem, name, help string) prometheus.Counter

NewCounter ...

func (*Metrics) NewCounterFunc Uses

func (m *Metrics) NewCounterFunc(subsystem, name, help string, f func() float64) prometheus.CounterFunc

NewCounterFunc ...

func (*Metrics) NewCounterVec Uses

func (m *Metrics) NewCounterVec(subsystem, name, help string, labels []string) *prometheus.CounterVec

NewCounterVec ...

func (*Metrics) NewGauge Uses

func (m *Metrics) NewGauge(subsystem, name, help string) prometheus.Gauge

NewGauge ...

func (*Metrics) NewGaugeFunc Uses

func (m *Metrics) NewGaugeFunc(subsystem, name, help string, f func() float64) prometheus.GaugeFunc

NewGaugeFunc ...

func (*Metrics) NewGaugeVec Uses

func (m *Metrics) NewGaugeVec(subsystem, name, help string, labels []string) *prometheus.GaugeVec

NewGaugeVec ...

func (*Metrics) NewSummary Uses

func (m *Metrics) NewSummary(subsystem, name, help string) prometheus.Summary

NewSummary ...

func (*Metrics) NewSummaryVec Uses

func (m *Metrics) NewSummaryVec(subsystem, name, help string, labels []string) *prometheus.SummaryVec

NewSummaryVec ...

func (*Metrics) Run Uses

func (m *Metrics) Run(addr string)

Run ...

func (*Metrics) Summary Uses

func (m *Metrics) Summary(subsystem, name string) prometheus.Summary

Summary ...

func (*Metrics) SummaryVec Uses

func (m *Metrics) SummaryVec(subsystem, name string) *prometheus.SummaryVec

SummaryVec ...

type Options Uses

type Options struct {
    Data    string
    Backlog int
    Threads int
}

Options ...

type Server Uses

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

Server ...

func NewServer Uses

func NewServer(bind string, options *Options) *Server

NewServer ...

func (*Server) AddRoute Uses

func (s *Server) AddRoute(method, path string, handler http.Handler)

func (*Server) CloseHandler Uses

func (s *Server) CloseHandler() httprouter.Handle

CloseHandler ...

func (*Server) CreateHandler Uses

func (s *Server) CreateHandler() httprouter.Handle

CreateHandler ...

func (*Server) IndexHandler Uses

func (s *Server) IndexHandler() httprouter.Handle

IndexHandler ...

func (*Server) KillHandler Uses

func (s *Server) KillHandler() httprouter.Handle

KillHandler ...

func (*Server) ListenAndServe Uses

func (s *Server) ListenAndServe()

ListenAndServe ...

func (*Server) LogsHandler Uses

func (s *Server) LogsHandler() httprouter.Handle

LogsHandler ...

func (*Server) OutputHandler Uses

func (s *Server) OutputHandler() httprouter.Handle

OutputHandler ...

func (*Server) SearchHandler Uses

func (s *Server) SearchHandler() httprouter.Handle

SearchHandler ...

func (*Server) Shutdown Uses

func (s *Server) Shutdown()

func (*Server) WriteHandler Uses

func (s *Server) WriteHandler() httprouter.Handle

WriteHandler ...

type State Uses

type State int

State ...

const (
    STATE_CREATED State
    STATE_WAITING
    STATE_RUNNING
    STATE_STOPPED
    STATE_KILLED
    STATE_ERRORED
)

func ParseState Uses

func ParseState(s string) State

func (State) String Uses

func (s State) String() string

type Store Uses

type Store interface {
    Close() error
    NextId() ID
    Save(job *Job) error
    Get(id ID) (*Job, error)
    Find(id ...ID) ([]*Job, error)
    All() ([]*Job, error)
    Search(q string) ([]*Job, error)
}

func InitDB Uses

func InitDB(uri string) (Store, error)

func NewBitcaskStore Uses

func NewBitcaskStore(dbpath string) (Store, error)

func NewBoltStore Uses

func NewBoltStore(dbpath string) (Store, error)

func NewMemoryStore Uses

func NewMemoryStore() (Store, error)

type URI Uses

type URI struct {
    Type string
    Path string
}

func ParseURI Uses

func ParseURI(uri string) (*URI, error)

func (*URI) String Uses

func (u *URI) String() string

Directories

PathSynopsis
client
codecPackage codec contains sub-packages with different codecs that can be used to encode and decode entities in Storm.
codec/gobPackage gob contains a codec to encode and decode entities in Gob format
codec/jsonPackage json contains a codec to encode and decode entities in JSON format
codec/msgpackPackage msgpack contains a codec to encode and decode entities in msgpack format
worker

Package je imports 28 packages (graph) and is imported by 1 packages. Updated 2019-10-13. Refresh now. Tools for package owners.