common

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TickerName = "TICKER"
	DateIdx    = "DATE"
)

Variables

View Source
var (
	ErrAuth0               = errors.New("cannot get Auth0 Management API access token request")
	ErrAuth0AccountRequest = errors.New("User account request failed")
)

Functions

func ArrToUpper

func ArrToUpper(arr []string)

ArrToUpper uppercase every string in array

func Compress

func Compress(in []byte) ([]byte, error)

func Decompress

func Decompress(in []byte) ([]byte, error)

func Decrypt

func Decrypt(data []byte) ([]byte, error)

Decrypt data and return using PV_SECRET key

func DoEvery

func DoEvery(d time.Duration, f func())

DoEvery execute function every d duration

func Encrypt

func Encrypt(data []byte) ([]byte, error)

Encrypt an array of byte data using the PV_SECRET key

func GetTimezone

func GetTimezone() *time.Location

func MaxTime added in v0.5.0

func MaxTime(a, b time.Time) time.Time

func MinTime added in v0.5.0

func MinTime(a, b time.Time) time.Time

func SetupLogging

func SetupLogging()

Types

type Auth0User

type Auth0User struct {
	UserID        string                 `json:"user_id"`
	Name          string                 `json:"name"`
	Email         string                 `json:"email"`
	EmailVerified bool                   `json:"email_verified"`
	UserMetaData  map[string]interface{} `json:"user_metadata"`
}

func GetAuth0User

func GetAuth0User(userID string) (*Auth0User, error)

type Pair

type Pair struct {
	Key   string
	Value float64
}

Struct used for sorting tickers by a float64 value (i.e. momentum)

type PairList

type PairList []Pair

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	Scope       string `json:"scope"`
	ExpiresIn   int    `json:"expires_in"`
	TokenType   string `json:"token_type"`
}

Jump to

Keyboard shortcuts

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