dal

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeChannelTelegram

func ChangeChannelTelegram(username interface{}, telegram int64, channel interface{}) *gorm.DB

func ChangeUserAndPassword

func ChangeUserAndPassword(oldName, newName, newPassword string) *gorm.DB

func ChangeUserName

func ChangeUserName(oldName, newName string) *gorm.DB

func ChangeUserPassword

func ChangeUserPassword(username, newPassword string) *gorm.DB

func CreateChannel

func CreateChannel(channel *Channel) *gorm.DB

func CreateSignal

func CreateSignal(s *TVSignal) *gorm.DB

func CreateStrategy

func CreateStrategy(strategy interface{}) *gorm.DB

func CreateUser

func CreateUser(user *User) *gorm.DB

func DeleteChannelFromUser

func DeleteChannelFromUser(username interface{}, channel interface{}) *gorm.DB

func DeleteSignal

func DeleteSignal(channelID uint, symbol string) *gorm.DB

func DeleteStrategy

func DeleteStrategy(channelID string, symbol string) *gorm.DB

func DeleteUser

func DeleteUser(username interface{}) *gorm.DB

func FindAllChannelsFromUser

func FindAllChannelsFromUser(dest interface{}, username interface{}) *gorm.DB

func FindAllStrategiesFromChannel

func FindAllStrategiesFromChannel(dest interface{}, channelID interface{}) *gorm.DB

func FindChannel

func FindChannel(dest interface{}, query string, args ...interface{}) *gorm.DB

func FindChannelByTelegramId

func FindChannelByTelegramId(dest interface{}, telegramID int64) *gorm.DB

func FindChannelFromUser

func FindChannelFromUser(dest interface{}, username interface{}, channel interface{}) *gorm.DB

func FindDefaultStrategy

func FindDefaultStrategy(dest interface{}, channelID uint) *gorm.DB

func FindSignalBySymbol

func FindSignalBySymbol(dest interface{}, channelID uint, symbol string) *gorm.DB

func FindStrategy

func FindStrategy(dest interface{}, conds ...interface{}) *gorm.DB

func FindStrategyByID

func FindStrategyByID(dest interface{}, channelID interface{}, strategyID interface{}) *gorm.DB

func FindStrategyBySymbol

func FindStrategyBySymbol(dest interface{}, channelID uint, symbol string) *gorm.DB

func FindStrategyBySymbolSimple

func FindStrategyBySymbolSimple(dest interface{}, symbol string, channelID interface{}) *gorm.DB

func FindUser

func FindUser(dest interface{}, conds ...interface{}) *gorm.DB

func FindUserByName

func FindUserByName(dest interface{}, username interface{}) *gorm.DB

func FindUserByUUID

func FindUserByUUID(dest interface{}, username interface{}, uuid interface{}) *gorm.DB

func UpdateChannel

func UpdateChannel(username interface{}, update map[string]interface{}, channel interface{}) *gorm.DB

func UpdateUser

func UpdateUser(dest interface{}, update map[string]interface{}, user string) *gorm.DB

Types

type Channel

type Channel struct {
	gorm.Model
	Telegram int64
	TVSignal []*TVSignal `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Strategy []*Strategy `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	UserID   uint
}

type Entry

type Entry struct {
	gorm.Model
	Diff             float64
	TargetStrategyID uint
}

type SL

type SL struct {
	gorm.Model
	Diff             float64
	TargetStrategyID *uint
	ZoneStrategyID   *uint
}

type Strategy

type Strategy struct {
	gorm.Model
	AllowCounter   bool
	Symbol         string
	TargetStrategy *TargetStrategy `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	ZoneStrategy   *ZoneStrategy   `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Leverage       uint
	ChannelID      uint
}

type TP

type TP struct {
	gorm.Model
	Diff             float64
	TargetStrategyID *uint
	ZoneStrategyID   *uint
}

type TVSignal

type TVSignal struct {
	gorm.Model
	Symbol    string
	Price     float64
	Direction string
	Exchange  string
	ChannelID uint
}

type TargetStrategy

type TargetStrategy struct {
	gorm.Model
	Entries    []*Entry `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	TPs        []*TP    `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	SL         *SL      `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	IsBreakout bool
	StrategyID uint
}

type User

type User struct {
	gorm.Model
	Name     string
	Password string
	UUID     string
	Channels []*Channel `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type ZoneStrategy

type ZoneStrategy struct {
	gorm.Model
	EntryStart float64
	EntryStop  float64
	TPs        []*TP `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	SL         *SL   `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	IsBreakout bool
	StrategyID uint
}

Jump to

Keyboard shortcuts

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