types

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 5 Imported by: 0

README

Algotiqa Types

Datatypes common to all platform components

Documentation

Index

Constants

View Source
const NilValue int = 9999

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date int

func NewDate

func NewDate(year int, month int, day int) Date

func ParseIntDate

func ParseIntDate(value string, required bool) (Date, error)

func ToDate

func ToDate(t *time.Time) Date

func Today

func Today(loc *time.Location) Date

func (Date) AddDays

func (dt Date) AddDays(days int) Date

func (Date) Day

func (dt Date) Day() int

func (Date) Days

func (dt Date) Days(d Date) int

func (Date) IsNil

func (dt Date) IsNil() bool

func (Date) IsToday

func (dt Date) IsToday(loc *time.Location) bool

func (Date) IsValid

func (dt Date) IsValid() bool

func (Date) Month

func (dt Date) Month() int

func (Date) String

func (dt Date) String() string

func (Date) ToDateTime

func (dt Date) ToDateTime(endDay bool, loc *time.Location) time.Time

func (Date) Year

func (dt Date) Year() int

type Time

type Time int16

func NewTime

func NewTime(hours, mins int) Time

func ParseIntTime

func ParseIntTime(value string, required bool) (Time, error)

func ParseStringTime

func ParseStringTime(time string) (Time, error)

func (Time) Add

func (t Time) Add(time Time) Time

func (Time) AddMinutes

func (t Time) AddMinutes(mins int) Time

func (Time) Before added in v0.0.2

func (t Time) Before(time Time) bool

func (Time) Hour

func (t Time) Hour() int

func (Time) IsNil

func (t Time) IsNil() bool

func (Time) IsValid

func (t Time) IsValid() bool

func (Time) Minute

func (t Time) Minute() int

func (Time) String

func (t Time) String() string

func (Time) Sub

func (t Time) Sub(time Time) Time

type TradingSession

type TradingSession struct {
	Slots []*TradingSlot `json:"slots"`
}

func (*TradingSession) IsNewSession added in v0.0.2

func (ts *TradingSession) IsNewSession(prev time.Time, next time.Time) bool

type TradingSlot

type TradingSlot struct {
	Day        int  `json:"day"`
	Open       Time `json:"open"`
	Close      Time `json:"close"`
	EndSession bool `json:"end"`
}

Jump to

Keyboard shortcuts

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