asset

package module
v0.0.0-...-2fd9363 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 3 Imported by: 37

Documentation

Index

Constants

View Source
const (
	Spot                   = Item("spot")
	Margin                 = Item("margin")
	MarginFunding          = Item("marginfunding")
	Index                  = Item("index")
	Binary                 = Item("binary")
	PerpetualContract      = Item("perpetualcontract")
	PerpetualSwap          = Item("perpetualswap")
	Futures                = Item("futures")
	UpsideProfitContract   = Item("upsideprofitcontract")
	DownsideProfitContract = Item("downsideprofitcontract")
	CoinMarginedFutures    = Item("coinmarginedfutures")
	USDTMarginedFutures    = Item("usdtmarginedfutures")
)

Const vars for asset package

Variables

View Source
var (
	// ErrNotSupported is an error for an unsupported asset type
	ErrNotSupported = errors.New("received unsupported asset type")
)

Functions

This section is empty.

Types

type Item

type Item string

Item stores the asset type

func New

func New(input string) (Item, error)

New takes an input matches to relevant package assets

func UseDefault

func UseDefault() Item

UseDefault returns default asset type

func (Item) IsValid

func (a Item) IsValid() bool

IsValid returns whether or not the supplied asset type is valid or not

func (Item) String

func (a Item) String() string

returns an Item to string

type Items

type Items []Item

Items stores a list of assets types

func Supported

func Supported() Items

Supported returns a list of supported asset types

func (Items) Contains

func (a Items) Contains(i Item) bool

Contains returns whether or not the supplied asset exists in the list of Items

func (Items) JoinToString

func (a Items) JoinToString(separator string) string

JoinToString joins an asset type array and converts it to a string with the supplied separator

func (Items) Strings

func (a Items) Strings() []string

Strings converts an asset type array to a string array

Jump to

Keyboard shortcuts

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