api

package
v0.0.0-...-4cb4d4a Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Enabled                 bool     `json:"enabled"`
	Listen                  string   `json:"listen"`
	PoolChartsNum           int64    `json:"poolChartsNum"`
	MinerChartsNum          int64    `json:"minerChartsNum"`
	PoolChartInterval       string   `json:"poolChartInterval"`
	MinerChartCheckInterval string   `json:"minerChartCheckInterval"`
	MinerChartInterval      string   `json:"minerChartInterval"`
	DeleteCheckInterval     string   `json:"deleteCheckInterval"`
	DeleteMaxRecord         int64    `json:"deleteMaxRecord"`
	DeleteKeepRecord        int64    `json:"deleteKeepRecord"`
	MinerPoolTimeout        string   `json:"minerPoolTimeout"`
	StatsCollectInterval    string   `json:"statsCollectInterval"`
	HashrateWindow          string   `json:"hashrateWindow"`
	HashrateLargeWindow     string   `json:"hashrateLargeWindow"`
	LuckWindow              []int    `json:"luckWindow"`
	Payments                int64    `json:"payments"`
	Blocks                  int64    `json:"blocks"`
	PurgeOnly               bool     `json:"purgeOnly"`
	PurgeInterval           string   `json:"purgeInterval"`
	AllowedOrigins          []string `json:"AllowedOrigins"`
	Coin                    string
	Name                    string
	Depth                   int64
	Alarm                   *alarm.Config `json:"alarm"`
	// In Shannon
	Threshold    int64  `json:"threshold"`
	AccessSecret string `json:"AccessSecret"`
}

type ApiServer

type ApiServer struct {
	// contains filtered or unexported fields
}

func NewApiServer

func NewApiServer(cfg *ApiConfig, coin string, name string, backend *redis.RedisClient, db *mysql.Database) *ApiServer

func (*ApiServer) AccountExIndex

func (s *ApiServer) AccountExIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) AccountIndex

func (s *ApiServer) AccountIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) AddAccountIndex

func (s *ApiServer) AddAccountIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ApplyInboundIDIndex

func (s *ApiServer) ApplyInboundIDIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ApplyInboundIPIndex

func (s *ApiServer) ApplyInboundIPIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ApplyMinerSbuIndex

func (s *ApiServer) ApplyMinerSbuIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) BlocksIndex

func (s *ApiServer) BlocksIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ChangeAccessIndex

func (s *ApiServer) ChangeAccessIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ChangeAlarmIndex

func (s *ApiServer) ChangeAlarmIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ChangeDescIndex

func (s *ApiServer) ChangeDescIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ChangePasswordIndex

func (s *ApiServer) ChangePasswordIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) CheckJwtToken

func (s *ApiServer) CheckJwtToken(r *http.Request, requestURI string) (bool, string)

func (*ApiServer) CreateToken

func (s *ApiServer) CreateToken(devId, access string, expirationMin int64) (string, error)

func (*ApiServer) CreateUserToken

func (s *ApiServer) CreateUserToken(id, access string, expirationMin int64) (string, error)

func (*ApiServer) DelAccounIndex

func (s *ApiServer) DelAccounIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) DelIDboundIndex

func (s *ApiServer) DelIDboundIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) DelInboundIndex

func (s *ApiServer) DelInboundIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) DelSubIdIndex

func (s *ApiServer) DelSubIdIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) DevIdInboundListIndex

func (s *ApiServer) DevIdInboundListIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ErrorWrite

func (s *ApiServer) ErrorWrite(w http.ResponseWriter, errorStr string)

func (*ApiServer) GetAccountListIndex

func (s *ApiServer) GetAccountListIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) GetLikeDevSubListIndex

func (s *ApiServer) GetLikeDevSubListIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) GetTokenIndex

func (s *ApiServer) GetTokenIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Health

func (s *ApiServer) Health(w http.ResponseWriter, r *http.Request)

func (*ApiServer) InboundListIndex

func (s *ApiServer) InboundListIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) MinersIndex

func (s *ApiServer) MinersIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) PaymentsIndex

func (s *ApiServer) PaymentsIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) PayoutLimitIndex

func (s *ApiServer) PayoutLimitIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) RedisMessage

func (s *ApiServer) RedisMessage(payload string)

func (*ApiServer) SaveDevIdInboundIndex

func (s *ApiServer) SaveDevIdInboundIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) SaveInboundIndex

func (s *ApiServer) SaveInboundIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) SaveSubIdIndex

func (s *ApiServer) SaveSubIdIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ServerError

func (s *ApiServer) ServerError(w http.ResponseWriter, r *http.Request, errMsg string)

func (*ApiServer) SignInIndex

func (s *ApiServer) SignInIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) SignupIndex

func (s *ApiServer) SignupIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Start

func (s *ApiServer) Start()

func (*ApiServer) StatsIndex

func (s *ApiServer) StatsIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) TokenValid

func (s *ApiServer) TokenValid(accessToken string) (*jwt.Token, error)

func (*ApiServer) VerifyToken

func (s *ApiServer) VerifyToken(accessToken string) (*jwt.Token, error)

func (*ApiServer) WirteResponseData

func (s *ApiServer) WirteResponseData(w http.ResponseWriter, status int, format string, v ...interface{})

type DbIPInbound

type DbIPInbound struct {
	Ip    string `json:"ip"`
	Rule  string `json:"rule"`
	Alarm string `json:"alarm"`
	Desc  string `json:"desc"`
}

type DevSubList

type DevSubList struct {
	DevId   string `json:"devid"`
	SubId   string `json:"subid"`
	Amount  string `json:"amount"`
	AllowId bool   `json:"allowid"`
}

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

type User

type User struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Access   string `json:"access"`
}

type UserToken

type UserToken struct {
	Username string `json:"username"`
	Password string `json:"password"`
	DevId    string `json:"devid"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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