entities

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEntitiesToMap

func FromEntitiesToMap(entities []Candlestick) []map[string]interface{}

FromEntitiesToMap will convert a list of candlestick entities to a map.

func FromEntityListToModelList

func FromEntityListToModelList(entities []Candlestick) (*candlestick.List, error)

FromEntityListToModelList will convert a candlestick entity list to a candlestick model list.

Types

type Candlestick

type Candlestick struct {
	Exchange string    `db:"exchange"`
	Pair     string    `db:"pair"`
	Period   string    `db:"period"`
	Time     time.Time `db:"time"`
	Data     []byte    `db:"data"`
}

Candlestick is the entity for a candlestick.

func FromModelListToEntityList

func FromModelListToEntityList(list *candlestick.List) ([]Candlestick, error)

FromModelListToEntityList will convert a candlestick model list to a candlestick entity list.

func (*Candlestick) FromModel

func (c *Candlestick) FromModel(exchange, pair, period string, model candlestick.Candlestick) error

FromModel will convert a candlestick model to a candlestick entity.

func (Candlestick) ToModel

func (c Candlestick) ToModel() (exchange, pair, period string, model candlestick.Candlestick, err error)

ToModel will convert a candlestick entity to a candlestick model.

type CandlestickData

type CandlestickData struct {
	Open       float64 `json:"open"`
	High       float64 `json:"high"`
	Low        float64 `json:"low"`
	Close      float64 `json:"close"`
	Volume     float64 `json:"volume"`
	Uncomplete bool    `json:"uncomplete"`
}

CandlestickData is the entity for a candlestick data.

Jump to

Keyboard shortcuts

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