Documentation ¶
Index ¶
- type Transaction
- type Transactions
- func (ts *Transactions) Add(t *Transaction)
- func (ts *Transactions) DeleteFromCache(ctx context.Context) error
- func (ts *Transactions) FromJSON(d []byte) error
- func (ts *Transactions) GetAddress() string
- func (ts *Transactions) GetFromCache(ctx context.Context) error
- func (ts *Transactions) SaveToCache(ctx context.Context) error
- func (ts *Transactions) SaveToDB(c *fiber.Ctx) error
- func (ts *Transactions) ToJSON() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Transaction ¶
type Transaction struct { database.Model Hash string `json:"hash" gorm:"hash;index;not null" redis:"-"` UserID string `json:"user_id" gorm:"user_id;index;not null" redis:"-"` Broker string `json:"broker" gorm:"broker" redis:"broker"` Symbol string `json:"symbol" gorm:"symbol;not null" redis:"symbol"` Date time.Time `json:"date" gorm:"date;not null" redis:"date"` Quantity int `json:"quantity" gorm:"quantity;not null" redis:"quantity"` Price float64 `json:"price" gorm:"price;not null" redis:"price"` TypeCode int `json:"type_code" gorm:"type_code;not null" redis:"type_code"` Import bool `json:"import" gorm:"-" redis:"-"` Duplicated bool `json:"duplicated" gorm:"-" redis:"-"` }
func NewTransaction ¶
func NewTransaction(uid uuid.UUID, broker string) *Transaction
func (*Transaction) FromImport ¶
func (t *Transaction) FromImport(in *broker.Transaction)
type Transactions ¶
type Transactions struct { Items []Transaction `json:"items" redis:"items"` // contains filtered or unexported fields }
func NewTransactions ¶
func NewTransactions(key string) *Transactions
func (*Transactions) Add ¶
func (ts *Transactions) Add(t *Transaction)
func (*Transactions) DeleteFromCache ¶
func (ts *Transactions) DeleteFromCache(ctx context.Context) error
func (*Transactions) FromJSON ¶
func (ts *Transactions) FromJSON(d []byte) error
func (*Transactions) GetAddress ¶
func (ts *Transactions) GetAddress() string
func (*Transactions) GetFromCache ¶
func (ts *Transactions) GetFromCache(ctx context.Context) error
func (*Transactions) SaveToCache ¶
func (ts *Transactions) SaveToCache(ctx context.Context) error
func (*Transactions) SaveToDB ¶
func (ts *Transactions) SaveToDB(c *fiber.Ctx) error
func (*Transactions) ToJSON ¶
func (ts *Transactions) ToJSON() []byte
Click to show internal directories.
Click to hide internal directories.