Documentation ¶
Index ¶
- Constants
- Variables
- func BufferProcessOutput(output chan interface{}, mq *MessageQueue)
- func IsRunning(pid uint32) bool
- func NewPID() uint32
- func NewProcess(run func(chan interface{}, chan interface{}), parentContext context.Context) (pid uint32)
- type BgWorkerSetting
- type CandleDuration
- func (cd *CandleDuration) Ceil(ts time.Time) time.Time
- func (cd *CandleDuration) Duration() time.Duration
- func (cd *CandleDuration) IsWithin(ts, start time.Time) bool
- func (cd *CandleDuration) QueryableNrecords(tf string, nrecords int) int
- func (cd *CandleDuration) QueryableTimeframe() string
- func (cd *CandleDuration) Truncate(ts time.Time) time.Time
- type MessageQueue
- type MktsConfig
- type Process
- type Timeframe
- type TriggerSetting
Constants ¶
View Source
const Day = 24 * time.Hour
View Source
const Week = 7 * Day
View Source
const Year = 365 * Day
Variables ¶
View Source
var ( Tag string GitHash string BuildStamp string )
Functions ¶
func BufferProcessOutput ¶
func BufferProcessOutput(output chan interface{}, mq *MessageQueue)
func NewProcess ¶
Types ¶
type BgWorkerSetting ¶
type CandleDuration ¶
type CandleDuration struct { String string // contains filtered or unexported fields }
func CandleDurationFromString ¶
func CandleDurationFromString(tf string) (cd *CandleDuration)
func (*CandleDuration) Ceil ¶
func (cd *CandleDuration) Ceil(ts time.Time) time.Time
Ceil returns the upper boundary time of this candle window that ts belongs to.
func (*CandleDuration) Duration ¶
func (cd *CandleDuration) Duration() time.Duration
func (*CandleDuration) QueryableNrecords ¶
func (cd *CandleDuration) QueryableNrecords(tf string, nrecords int) int
func (*CandleDuration) QueryableTimeframe ¶
func (cd *CandleDuration) QueryableTimeframe() string
type MessageQueue ¶
func NewMessageQueue ¶
func NewMessageQueue(length int) *MessageQueue
func (*MessageQueue) AddMessage ¶
func (mq *MessageQueue) AddMessage(msg interface{})
func (*MessageQueue) GetMessages ¶
func (mq *MessageQueue) GetMessages() (times []time.Time, messages []interface{})
func (*MessageQueue) Len ¶
func (mq *MessageQueue) Len() int
func (*MessageQueue) Less ¶
func (mq *MessageQueue) Less(i, j int) bool
func (*MessageQueue) Swap ¶
func (mq *MessageQueue) Swap(i, j int)
type MktsConfig ¶
type MktsConfig struct { RootDirectory string ListenPort string Timezone *time.Location Queryable bool StopGracePeriod time.Duration WALRotateInterval int EnableAdd bool EnableRemove bool EnableLastKnown bool StartTime time.Time Triggers []*TriggerSetting BgWorkers []*BgWorkerSetting }
var InstanceConfig MktsConfig
func (*MktsConfig) Parse ¶
func (m *MktsConfig) Parse(data []byte) error
type Process ¶
type Process struct { PID uint32 Context context.Context Messages *MessageQueue // contains filtered or unexported fields }
func GetProcFromPID ¶
type Timeframe ¶
func NewTimeframe ¶
func NewTimeframe(arg interface{}) (tf *Timeframe)
func TimeframeFromDuration ¶
func TimeframeFromString ¶
func (*Timeframe) PeriodsPerDay ¶
type TriggerSetting ¶
Click to show internal directories.
Click to hide internal directories.