ord

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApiBase = "http://localhost:8080"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	BaseURL string
	Client  *http.Client
}

func NewAPIClient

func NewAPIClient(baseURL string) *APIClient

func (*APIClient) GetAllRunes

func (c *APIClient) GetAllRunes() ([]Entry, error)

type Details

type Details struct {
	Block        int64   `json:"block"`
	Burned       int64   `json:"burned"`
	Divisibility int64   `json:"divisibility"`
	Etching      string  `json:"etching"`
	Mints        int64   `json:"mints"`
	Number       int64   `json:"number"`
	Premine      float64 `json:"premine"`
	SpacedRune   string  `json:"spaced_rune"`
	Symbol       string  `json:"symbol"`
	Terms        Terms   `json:"terms"`
	Timestamp    int64   `json:"timestamp"`
	Turbo        bool    `json:"turbo"`
}

type Entry

type Entry struct {
	ID      string  `json:"id"`
	Details Details `json:"details"`
}

Define the structs according to the JSON structure

type Response

type Response struct {
	Entries [][]interface{} `json:"entries"` // Use interface{} because the first element is string and second is Details
	More    bool            `json:"more"`
	Prev    interface{}     `json:"prev"` // Use interface{} because it can be null or other types
	Next    interface{}     `json:"next"`
}

type Terms

type Terms struct {
	Amount float64       `json:"amount"`
	Cap    uint64        `json:"cap"`
	Height []int         `json:"height"`
	Offset []interface{} `json:"offset"` // Use interface{} for mixed types (null, int)
}

Jump to

Keyboard shortcuts

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