simple

package
v0.0.0-...-0676795 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecondsOfOneDay = float32(24 * 3600)
)
View Source
const (
	TXCheckTime = time.Second * 2
)

Variables

View Source
var (
	AndroidVerUrl  = "%s/version.js"
	RuleDataUrl    = "%s/rule.txt"
	MustHitDataUrl = "%s/must_hit.txt"
	ByPassDataUrl  = "%s/bypass.txt"
	RuleVerUrl     = "%s/ruleVer.js"
	NodeConfigUrl  = "%s/nodeConfig.json"
	PriceConfigUrl = "%s/priceConfig.json"

	WebHookDomain     = "https://stripeaws.immeta.chat"
	TestWebHookDomain = "http://stripeaws.immeta.chat"
)

Functions

func Address

func Address() string

func AdvertiseList

func AdvertiseList() []byte

func AesKeyBase64ForMiner

func AesKeyBase64ForMiner(minerAddr string) string

func AesKeyForMiner

func AesKeyForMiner(minerAddr string) []byte

func AndroidApkVersion

func AndroidApkVersion() (ver string, err error)

func BalanceInDays

func BalanceInDays(val int64) float32

func ByPassDataLoad

func ByPassDataLoad() (string, error)

func GetPingVal

func GetPingVal(mid, minerIP string) float32

func ImportWallet

func ImportWallet(data, auth string) bool

func InitSystem

func InitSystem(cb UICallBack, payMode bool, confUrl string)

func IsOpen

func IsOpen() bool

func IsValidSubAddr

func IsValidSubAddr(addr string) bool

func LoadCustomerBasic

func LoadCustomerBasic(walletAddr, cusID string) (string, error)

func LoadWallet

func LoadWallet(walletJSOn string) bool

func MinerPort

func MinerPort(addr string) int32

func MustHitData

func MustHitData() (string, error)

func NewWallet

func NewWallet(auth string) []byte

func NodeConfigData

func NodeConfigData() (string, error)

func OpenWallet

func OpenWallet(auth string) bool

func PrepareCharge

func PrepareCharge(amountInDollar float64, chargeDays int, cusId, currency string) (string, error)

func PriKeyData

func PriKeyData() []byte

func PriceConfigData

func PriceConfigData() (string, error)

func RefreshHostByAddr

func RefreshHostByAddr(addr string) string

func RuleDataLoad

func RuleDataLoad() (string, error)

func RuleVerInt

func RuleVerInt() ([]byte, error)

func SubAddress

func SubAddress() string

func SubPriKeyData

func SubPriKeyData() []byte

func SyncServerList

func SyncServerList() []byte

func TestPing

func TestPing(mid string) []byte

func TransferToFriend

func TransferToFriend(from, to string, days int) error

func Verify

func Verify(data, sig []byte) []byte

Types

type AppHelper

type AppHelper struct {
	Wallet account.Wallet
	// contains filtered or unexported fields
}

type CustomerBasic

type CustomerBasic struct {
	CusID      string `json:"cus_id"`
	ExpireDay  int64  `json:"expire_day"`
	UpdateTime int64  `json:"update_time"`
}

type NodeConfig

type NodeConfig struct {
	Name          string `json:"location"`
	IconName      string `json:"icon"`
	IPAddr        string `json:"ip"`
	WalletAddress string `json:"address"`
	IsFree        bool   `json:"free"`
}

type PingResult

type PingResult struct {
	IP   string
	Ping float32
}

type PriceConfig

type PriceConfig struct {
	ID     string  `json:"id"`
	Days   int     `json:"days"`
	Price  float32 `json:"price"`
	Sum    float32 `json:"sum"`
	Tittle string  `json:"tittle"`
}

type RuleVer

type RuleVer struct {
	DnsVer      int    `json:"dns"`
	ByPassVer   int    `json:"by_pass"`
	MustHit     int    `json:"must_hit"`
	NodeConfig  int    `json:"config"`
	PriceConfig int    `json:"price"`
	Dollar      string `json:"dollar"`
}

type UICallBack

type UICallBack interface {
	Log(str string)
	SysExit(err error)
}

Jump to

Keyboard shortcuts

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