Documentation ¶
Index ¶
- type Analysis
- type GORMClient
- func (c *GORMClient) AutoMigrateAll()
- func (c *GORMClient) AutoMigrateAnalyses()
- func (c *GORMClient) AutoMigrateOrders()
- func (c *GORMClient) AutoMigrateSettings()
- func (c *GORMClient) DropAll()
- func (c *GORMClient) GetAllOrders() ([]Order, error)
- func (c *GORMClient) GetAllSettings() (map[string]Setting, error)
- func (c *GORMClient) GetLastOrder(strategy, symbol string) (*Order, error)
- func (c *GORMClient) GetSetting(name string) (Setting, error)
- func (c *GORMClient) StoreAnalyses(analyses map[string]Analysis) error
- func (c *GORMClient) StoreOrder(order *Order) error
- func (c *GORMClient) StoreSetting(name, value string) error
- func (c *GORMClient) UpdateSetting(name, value string) (Setting, error)
- type InMemoryClient
- func (c *InMemoryClient) AutoMigrateAll()
- func (c *InMemoryClient) AutoMigrateAnalyses()
- func (c *InMemoryClient) AutoMigrateOrders()
- func (c *InMemoryClient) AutoMigrateSettings()
- func (c *InMemoryClient) DropAll()
- func (c *InMemoryClient) GetAllOrders() ([]Order, error)
- func (c *InMemoryClient) GetAllSettings() (map[string]Setting, error)
- func (c *InMemoryClient) GetLastOrder(strategy, symbol string) (*Order, error)
- func (c *InMemoryClient) GetSetting(name string) (Setting, error)
- func (c *InMemoryClient) StoreAnalyses(analyses map[string]Analysis) error
- func (c *InMemoryClient) StoreOrder(order *Order) error
- func (c *InMemoryClient) StoreSetting(name, value string) error
- func (c *InMemoryClient) UpdateSetting(name, value string) (Setting, error)
- type Order
- type Setting
- type StorageClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analysis ¶
type Analysis struct { ID uint `json:"id" gorm:"primary_key;auto_increment"` Strategy string `json:"strategy" validate:"required"` Symbol string `json:"symbol" validate:"required"` Buys uint `json:"buys"` Sells uint `json:"sells"` SuccessfulSells uint `json:"successfulSells"` ProfitUSD float64 `json:"profitUSD"` SuccessRate float64 `json:"successRate"` Timeframe string `json:"timeframe"` Start time.Time `json:"start"` End time.Time `json:"end"` CreatedAt time.Time `json:"createdAt"` }
type GORMClient ¶
func NewGORMClient ¶
func NewGORMClient(dialect gorm.Dialector) (*GORMClient, error)
func (*GORMClient) AutoMigrateAll ¶
func (c *GORMClient) AutoMigrateAll()
func (*GORMClient) AutoMigrateAnalyses ¶
func (c *GORMClient) AutoMigrateAnalyses()
func (*GORMClient) AutoMigrateOrders ¶
func (c *GORMClient) AutoMigrateOrders()
func (*GORMClient) AutoMigrateSettings ¶
func (c *GORMClient) AutoMigrateSettings()
func (*GORMClient) DropAll ¶
func (c *GORMClient) DropAll()
func (*GORMClient) GetAllOrders ¶
func (c *GORMClient) GetAllOrders() ([]Order, error)
func (*GORMClient) GetAllSettings ¶
func (c *GORMClient) GetAllSettings() (map[string]Setting, error)
func (*GORMClient) GetLastOrder ¶
func (c *GORMClient) GetLastOrder(strategy, symbol string) (*Order, error)
func (*GORMClient) GetSetting ¶
func (c *GORMClient) GetSetting(name string) (Setting, error)
func (*GORMClient) StoreAnalyses ¶
func (c *GORMClient) StoreAnalyses(analyses map[string]Analysis) error
func (*GORMClient) StoreOrder ¶
func (c *GORMClient) StoreOrder(order *Order) error
func (*GORMClient) StoreSetting ¶
func (c *GORMClient) StoreSetting(name, value string) error
func (*GORMClient) UpdateSetting ¶
func (c *GORMClient) UpdateSetting(name, value string) (Setting, error)
type InMemoryClient ¶
type InMemoryClient struct {
// contains filtered or unexported fields
}
func NewInMemoryClient ¶
func NewInMemoryClient() *InMemoryClient
func (*InMemoryClient) AutoMigrateAll ¶
func (c *InMemoryClient) AutoMigrateAll()
func (*InMemoryClient) AutoMigrateAnalyses ¶
func (c *InMemoryClient) AutoMigrateAnalyses()
func (*InMemoryClient) AutoMigrateOrders ¶
func (c *InMemoryClient) AutoMigrateOrders()
func (*InMemoryClient) AutoMigrateSettings ¶
func (c *InMemoryClient) AutoMigrateSettings()
func (*InMemoryClient) DropAll ¶
func (c *InMemoryClient) DropAll()
func (*InMemoryClient) GetAllOrders ¶
func (c *InMemoryClient) GetAllOrders() ([]Order, error)
func (*InMemoryClient) GetAllSettings ¶
func (c *InMemoryClient) GetAllSettings() (map[string]Setting, error)
func (*InMemoryClient) GetLastOrder ¶
func (c *InMemoryClient) GetLastOrder(strategy, symbol string) (*Order, error)
func (*InMemoryClient) GetSetting ¶
func (c *InMemoryClient) GetSetting(name string) (Setting, error)
func (*InMemoryClient) StoreAnalyses ¶
func (c *InMemoryClient) StoreAnalyses(analyses map[string]Analysis) error
func (*InMemoryClient) StoreOrder ¶
func (c *InMemoryClient) StoreOrder(order *Order) error
func (*InMemoryClient) StoreSetting ¶
func (c *InMemoryClient) StoreSetting(name, value string) error
func (*InMemoryClient) UpdateSetting ¶
func (c *InMemoryClient) UpdateSetting(name, value string) (Setting, error)
type Order ¶
type Order struct { ID uint `json:"id" gorm:"primary_key;auto_increment"` Strategy string `json:"strategy"` Symbol string `json:"symbol"` Decision string `json:"decision"` Quantity float64 `json:"quantity"` Price float64 `json:"price"` Indicators map[string]string `json:"indicators" gorm:"serializer:json"` Timeframe string `json:"timeframe"` Successful bool `json:"successful"` CreatedAt time.Time `json:"createdAt"` }
type StorageClient ¶
type StorageClient interface { AutoMigrateAll() AutoMigrateOrders() AutoMigrateSettings() AutoMigrateAnalyses() DropAll() GetAllSettings() (map[string]Setting, error) GetSetting(name string) (Setting, error) UpdateSetting(name, value string) (Setting, error) StoreSetting(name, value string) error GetAllOrders() ([]Order, error) GetLastOrder(strategy, symbol string) (*Order, error) StoreOrder(order *Order) error StoreAnalyses(analyses map[string]Analysis) error }
Click to show internal directories.
Click to hide internal directories.