core

package
v0.0.0-...-9e6d8ee Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 19 Imported by: 35

Documentation

Index

Constants

View Source
const (
	//ProxyHTTP -
	ProxyHTTP = 0
	//ProxySOCKS4 -
	ProxySOCKS4 = 4
	//ProxySOCKS5 -
	ProxySOCKS5 = 5
	//ProxySOCKS4A -
	ProxySOCKS4A = 6

	//OptAUTOREFERER -
	OptAUTOREFERER = 58
	//OptFOLLOWLOCATION -
	OptFOLLOWLOCATION = 52
	//OptCONNECTTIMEOUT -
	OptCONNECTTIMEOUT = 78
	//OptCONNECTTIMEOUTMS -
	OptCONNECTTIMEOUTMS = 156
	//OptMAXREDIRS -
	OptMAXREDIRS = 68
	//OptPROXYTYPE -
	OptPROXYTYPE = 101
	//OptTIMEOUT -
	OptTIMEOUT = 13
	//OptTIMEOUTMS -
	OptTIMEOUTMS = 155
	//OptCOOKIEJAR -
	OptCOOKIEJAR = 10082
	//OptINTERFACE -
	OptINTERFACE = 10062
	//OptPROXY -
	OptPROXY = 10004
	//OptREFERER -
	OptREFERER = 10016
	//OptUSERAGENT -
	OptUSERAGENT = 10018

	//OptREDIRECTPOLICY -
	OptREDIRECTPOLICY = 100000
	//OptPROXYFUNC -
	OptPROXYFUNC = 100001
	//OptDEBUG -
	OptDEBUG = 100002
	//OptUNSAFETLS -
	OptUNSAFETLS = 100004
	//OptCONTEXT -
	OptCONTEXT = 100005
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Apps

type Apps struct {
	IApps
}

Apps -

type BrokerOption

type BrokerOption struct {
	Name            string
	Version         string
	Strategy        IStrategy
	LogStore        *logging.LogStore
	Counter         *counter.RateCounter
	DBLocation      string
	Proxy           func() []database.Proxy
	Accounts        func() (data []accounts.Accounts)
	Tasks           func() (data []tasks.Tasks)
	AssetData       func() interface{}
	GetPoints       func(rates.CandleRequest) (map[int][]rates.Points, error)
	OnBrokersUpdate func(id string, data []brokers.SendStatus)
}

BrokerOption -

type Brokers

type Brokers struct {
	IBrokers
}

Brokers -

type BrokersCallback

type BrokersCallback struct {
	GetStatsTasksTransactions func(opt controllers.GetTasksTransactions) (data tasks.StatsTask, err error)
	GetTasksTransactions      func(opt controllers.GetTasksTransactions) (data []brokers.Transactions, err error)
	GetTasksTest              func(opt controllers.GetTasksTestOption) (data []tasks.TestTasks, err error)
	ResetTasks                func(opt controllers.ResetTasks) (err error)
	TestTasks                 func(opt tasks.TestTasks) (err error)
	RunTestTasks              func(opt tasks.TestTasks) (err error)
	DeleteTestTasks           func(opt tasks.TestTasks) (err error)
	ResetTestTasks            func(opt tasks.TestTasks) (err error)
	OnSignal                  func(strategy.SendingSignal)
}

BrokersCallback -

type Calculation

type Calculation struct {
	ICalculation
}

Calculation -

type Components

type Components struct {
	IComponents
}

Components -

type Control

type Control struct {
	IControl
}

Control -

type Database

type Database struct {
	IDatabase
}

Database -

type HTTPClient

type HTTPClient struct {
	IHTTPClient
}

HTTPClient -

type HTTPClientResponse

type HTTPClientResponse struct {
	IHTTPClientResponse
	StatusCode int
}

HTTPClientResponse -

type IApps

type IApps interface {
	Run(func() *HTTPClient, func() *interfaces.WebsocketClient) bool
	SetCallback(data interface{})
	GetCallback() interface{}
}

IApps -

type IBrokers

type IBrokers interface {
	Name() string
	Version() string
	Run() bool
	Create(*IBrokersCallback) error
	GetAccounts(id string) ([]accounts.Accounts, error)
	CreateAccounts(controllers.CreateAccounts) error
	EditAccounts(controllers.CreateAccounts) error
	SetAccountActive(controllers.SetAccountActive) error
	DeleteAccount(controllers.DeleteAccount) error
	AddTasks(controllers.AddTasks) error
	EditTasks(controllers.EditTasks) error
	DeleteTasks(controllers.DeleteTasks) error
	ResetTasks(controllers.ResetTasks) error
	TestTasks(tasks.TestTasks) error
	GetTasks() (data []tasks.Tasks, err error)
	RunTestTasks(tasks.TestTasks) error
	DeleteTestTasks(tasks.TestTasks) error
	ResetTestTasks(tasks.TestTasks) error
	GetTasksTest(controllers.GetTasksTestOption) (data []tasks.TestTasks, err error)
	GetTasksTransactions(controllers.GetTasksTransactions) (data []brokers.Transactions, err error)
	GetStatsTasksTransactions(controllers.GetTasksTransactions) (data tasks.StatsTask, err error)
	RegisterOnSignal() func(strategy.SendingSignal)
}

IBrokers -

type IBrokersCallback

type IBrokersCallback struct {
	Strategy        IStrategy
	Logger          *logging.Logger
	LogStore        *logging.LogStore
	Database        *Database
	HTTPClient      func() *HTTPClient
	Counter         *counter.RateCounter
	GwAddress       controllers.GatewayAddress
	Config          []config.BrokersModules
	Components      *Components
	Stores          *brokers.Stores
	DBLocation      string
	GetAssetData    func(string) interface{}
	GetPoints       func(string, rates.CandleRequest) (map[int][]rates.Points, error)
	OnBrokersUpdate func(id string, data []brokers.SendStatus)
}

IBrokersCallback -

type ICalculation

type ICalculation interface {
	New()
	GetValue(int, int) []float64
	GetValues(int, int) []rates.Points
	GetCurrent(int) rates.Points
	GetServerTime() time.Time
	GetSendTime() time.Time
	GetLogger() *logging.Logger
	GetAssetID() string
	GetAsset() database.Assets
	GetPoints(opt rates.CandleRequest) (map[int][]rates.Points, error)
	GetIndicator(string) IIndicator
}

ICalculation -

type IComponents

type IComponents interface {
	GetStatsCache() (items []components.AllStats)
	GetAllStats() (items []components.AllStats)
	UpdateNetworkStats(msg monitor.IOCount)
	Register(items *components.Items)
	SetActive(name string, active bool)
	Run(ID string, exc string, opts []string, callback func())
	Stores() *components.Stores
	SetLogsLocation(string)
	OnLogsUpdate(string, func(string, logging.LogsValue))
	StoreLog(key string, msg interface{})
	GetLog(id string, start int64, limit int) []logging.LogsValue
	ClearLogs(id string, ts []int64)
	OnNewLogs(*logging.PushLogs)
}

IComponents -

type IControl

type IControl interface {
	Run()
	SetConfig(config.Config)
	SetLogger(*logging.Logger)
	SetLogStore(*logging.LogStore)
	OnNewLogs(*logging.PushLogs)
}

IControl -

type IDatabase

type IDatabase interface {
	InsertAssetsProvider(opt database.AssetProvider) error
	GetAssets() map[string]database.Assets
	Init() (err error)
	Load() (err error)
	GetAll(bucket string) (res interface{})
	InsertToken(opt database.Token) error
	GenerateToken() string
	GetLocation() string
	SetLocation(string)
	UpdateUserAgent()
	GetUserAgent() map[string]utility.UserAgent
	UpdateUsers(database.Users) error
	InsertUsers(database.Users) error
	Stores() *database.Stores
	InsertProxy(opt database.Proxy) error
	EditProxy(opt database.Proxy) error
	DeleteProxy(opt database.Proxy) error
	AddProxyUsedBy(ID string, us database.ProxyUsed) error
	RemoveProxyUsedBy(ID string, UsedID string) error
}

IDatabase -

type IHTTPClient

type IHTTPClient interface {
	WithHeader(k, v string) *HTTPClient
	WithOption(k int, v interface{}) *HTTPClient
	Post(url string, params interface{}) (res *HTTPClientResponse, err error)
}

IHTTPClient -

type IHTTPClientResponse

type IHTTPClientResponse interface {
	ReadAll() ([]byte, error)
}

IHTTPClientResponse -

type IIndicator

type IIndicator interface {
	Name() string
	Version() string
	Title() string
	Init(IndicatorOptions)
	Trigger() map[int]string
	Calculation(string, *Calculation, map[string]interface{}) (indicator.Result, error)
	IsValid(*Calculation, map[string]interface{}, string) bool
}

IIndicator -

type IRates

type IRates interface {
	Name() string
	Version() string
	Run() bool
	Create(*IRatesCallback) error
	SetRatesAsset(controllers.SetRatesAsset) error
	SetRatesProviderConfig(databasetype.ProviderConfig) error
	SetRatesProviderConfigIgnores() map[string]bool
	EnableAsset(string) bool
	GetAssetData() (data interface{})
	GetPoints(rates.CandleRequest) (map[int][]rates.Points, error)
}

IRates -

type IRatesCallback

type IRatesCallback struct {
	Logger        *logging.Logger
	LogStore      *logging.LogStore
	Database      *Database
	HTTPClient    func() *HTTPClient
	Stores        *rates.Stores
	Counter       *counter.RateCounter
	GwAddress     controllers.GatewayAddress
	Config        []config.RatesModules
	Components    *Components
	Strategy      IStrategy
	OnRatesUpdate func(string, []rates.SendStatus)
}

IRatesCallback -

type IStrategy

type IStrategy interface {
	GetIndicatorList() ([]indicator.Indicator, error)
	GetStrategy(string) (data []strategy.Strategy, err error)
	AddStrategy(string, strategy.Strategy) (err error)
	EditStrategy(string, strategy.Strategy) (err error)
	DeleteStrategy(string, strategy.Strategy) (err error)
	OnBrokersRegister(data strategy.BrokersRegister)
	MultiCalculation(req []rates.SendPoints)
	Calculation(req rates.SendPoints, reqMulti []rates.SendPoints)
	EnableAssets() (assetData []rates.AssetCandleRequest)
}

IStrategy -

type IWebapp

type IWebapp interface {
	Create(*mux.Router)
	Render(*http.Request) []byte
}

IWebapp -

type Indicator

type Indicator struct {
	IIndicator
}

Indicator -

type IndicatorOptions

type IndicatorOptions struct {
	DBLocation string
	Logger     *logging.Logger
}

IndicatorOptions -

type ProxyURL

type ProxyURL struct {
	Host     string
	Scheme   string
	Path     string
	Port     int
	Origin   string
	Username string
	Password string
	WithAuth bool
}

ProxyURL -

type Rates

type Rates struct {
	IRates
}

Rates -

type RatesCallback

type RatesCallback struct {
	AssetData func() iqoption.AssetsData
	GetPoints func(rates.CandleRequest) (map[int][]rates.Points, error)
}

RatesCallback -

type RatesOption

type RatesOption struct {
	Name          string
	Version       string
	Strategy      IStrategy
	LogStore      *logging.LogStore
	Counter       *counter.RateCounter
	DBLocation    string
	Config        func() database.ProviderConfig
	Assets        func() []database.Assets
	Proxy         func() []database.Proxy
	SendStatus    func([]rates.SendStatus)
	OnRatesUpdate func(id string, data []rates.SendStatus)
	ResetToken    func(callback func()) (err error)
}

RatesOption -

type StrategyOption

type StrategyOption struct {
	DatabaseLocation string
	LogStore         *logging.LogStore
	AssetProvider    func() map[string]string
	OnSignal         func([]string, strategy.SendingSignal)
}

StrategyOption -

type Webapp

type Webapp struct {
	IWebapp
}

Webapp -

Jump to

Keyboard shortcuts

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