timy

package module
v0.0.0-...-c5551f6 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 7 Imported by: 0

README

timy

Timy is a tool to record different events and process this insights with machine learning algorithms

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BagEngine

type BagEngine interface {
	RegisterNewEventRoot(c context.Context, eventRoot *EventRoot) error
	UpdateEventRoot(c context.Context, eventRootID string, update *EventRootUpdate) error
	RegisterNewEventType(c context.Context, eventType *EventType) error
	UpdateEventType(c context.Context, eventTypeID string, update *EventTypeUpdate) error
	RegisterNewEntry(c context.Context, entry *Entry) error
	VerifyIfEventRootExist(c context.Context, eventRootID string) error
	VerifyIfEventTypeExist(c context.Context, eventTypeID string) error
	Close() error
}

BagEngine represents a way to store persistently your events and logs

type Entry

type Entry struct {
	ID        string
	At        time.Time
	TypeID    string
	Modifiers map[string]interface{}
	Value     int64
}

Entry define a simple entry of your event

type EventRoot

type EventRoot struct {
	ID   string
	Name string
}

EventRoot describes a simple event root name

type EventRootUpdate

type EventRootUpdate struct {
	Name *string
}

EventRootUpdate is a payload to update your event root

type EventType

type EventType struct {
	ID          string
	Name        string
	RootID      string
	Identifier  string
	CreatedAt   time.Time
	Occurrences int64
}

EventType represents a type of event, it has a parent

type EventTypeUpdate

type EventTypeUpdate struct {
	Name        *string
	RootID      *string
	Identifier  *string
	CreatedAt   *time.Time
	Occurrences *int64
}

EventTypeUpdate is a payload to update your event root type

type InfluxBag

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

InfluxBag is an influx bag implementation

func NewInfluxBag

func NewInfluxBag(config *InfluxBagConfig) (*InfluxBag, error)

NewInfluxBag generates a new bag instance

func (*InfluxBag) Close

func (bag *InfluxBag) Close() error

Close implements the bag interface

func (*InfluxBag) RegisterNewEntry

func (bag *InfluxBag) RegisterNewEntry(c context.Context, entry *Entry) error

RegisterNewEntry implements the bag interface

func (*InfluxBag) RegisterNewEventRoot

func (bag *InfluxBag) RegisterNewEventRoot(c context.Context, eventRoot *EventRoot) error

RegisterNewEventRoot implements the bag interface

func (*InfluxBag) RegisterNewEventType

func (bag *InfluxBag) RegisterNewEventType(c context.Context, eventType *EventType) error

RegisterNewEventType implements the bag interface

func (*InfluxBag) UpdateEventRoot

func (bag *InfluxBag) UpdateEventRoot(c context.Context, eventRootID string, update *EventRootUpdate) error

UpdateEventRoot implements the bag interface

func (*InfluxBag) UpdateEventType

func (bag *InfluxBag) UpdateEventType(c context.Context, eventTypeID string, update *EventTypeUpdate) error

UpdateEventType implements the bag interface

func (*InfluxBag) VerifyIfEventRootExist

func (bag *InfluxBag) VerifyIfEventRootExist(c context.Context, eventRootID string) error

VerifyIfEventRootExist implements the bag interface

func (*InfluxBag) VerifyIfEventTypeExist

func (bag *InfluxBag) VerifyIfEventTypeExist(c context.Context, eventTypeID string) error

VerifyIfEventTypeExist implements the bag interface

type InfluxBagConfig

type InfluxBagConfig struct {
	InfluxConnection string
	InfluxToken      string
	BadgerFilepath   string
}

InfluxBagConfig is a wrapper for your bag configurations TODO: Improve the config of badger dictionary, accept more options

func DefaultInfluxBagConfig

func DefaultInfluxBagConfig(influxConn, influxToken string) *InfluxBagConfig

DefaultInfluxBagConfig creates a new default configuration for your influx bag

type Variable

type Variable struct {
	ID   string
	Name string
	Type VariableType
}

Variable is a simple variable struct, with this you can create a simple fuzzy algorithm

type VariableType

type VariableType string

VariableType can be anything

Jump to

Keyboard shortcuts

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