info

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Urls             Aux    = "urls"
	Description      Aux    = "description"
	Tags             Aux    = "tags"
	Platform         Aux    = "platform"
	DateAdded        Aux    = "date_added"
	Notice           Aux    = "notice"
	MetadataEndpoint string = "/v2/cryptocurrency/info"
)

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(booleanValue bool) string

BoolToString converts a boolean value to its string representation. Returns "true" if booleanValue is true, otherwise "false".

func SliceToString

func SliceToString(array []string, separator string) (string, error)

SliceToString concatenates a slice of strings into a single string separated by the specified separator. Returns the concatenated string and an error if the array is empty.

Types

type Aux

type Aux string

type CryptoCurrency

type CryptoCurrency struct {
	Urls         UrlData  `json:"urls"`
	ID           int      `json:"id"`
	Name         string   `json:"name"`
	Symbol       string   `json:"symbol"`
	Slug         string   `json:"slug"`
	Description  string   `json:"description"`
	DateAdded    string   `json:"date_added"`
	DateLaunched string   `json:"date_launched"`
	Tags         []string `json:"tags"`
	Platform     string   `json:"platform"`
	Category     string   `json:"category"`
	Notice       string   `json:"notice"`
}

type Metadata

type Metadata struct {
	Params *Params
	// contains filtered or unexported fields
}

func New

func New(c *c.Client) *Metadata

func (*Metadata) GetMetadata

func (m *Metadata) GetMetadata(params *Params) (map[string]CryptoCurrency, error)

type Params

type Params struct {
	Id          *string  `json:"id,omitempty"`
	Slugs       []string `json:"slugs,omitempty"`
	Symbols     []string `json:"symbols,omitempty"`
	Address     *string  `json:"address,omitempty"`
	SkipInvalid *bool    `json:"skip_invalid,omitempty"`
	Aux         []string `json:"aux,omitempty"`
}

Params represents the query parameters for fetching data.

type Response

type Response struct {
	Data   map[string]CryptoCurrency `json:"data"`
	Status StatusData                `json:"status"`
}

type StatusData

type StatusData struct {
	Timestamp    string `json:"timestamp"`
	ErrorCode    int    `json:"error_code"`
	ErrorMessage string `json:"error_message"`
	Elapsed      int    `json:"elapsed"`
	CreditCount  int    `json:"credit_count"`
	Notice       string `json:"notice"`
}

type UrlData

type UrlData struct {
	Website      []string `json:"website"`
	TechnicalDoc []string `json:"technical_doc"`
	Twitter      []string `json:"twitter"`
	Reddit       []string `json:"reddit"`
	MessageBoard []string `json:"message_board"`
	Announcement []string `json:"announcement"`
	Chat         []string `json:"chat"`
	Explorer     []string `json:"explorer"`
	SourceCode   []string `json:"source_code"`
}

Jump to

Keyboard shortcuts

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