v1

package
v0.0.0-...-f42d900 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIPathPrefix = "/api/v1"
)
View Source
const (
	StatusAvailable = "available"
)

Response constants

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthZResponse

type HealthZResponse struct {
	Status string `json:"status" yaml:"status"`
	Oracle struct {
		LastSync string `json:"last_sync"`
	} `json:"oracle"`
}

HealthZResponse defines the response type for the healthy API handler.

type Metrics

type Metrics interface {
	Gather(format string) (telemetry.GatherResponse, error)
}

type Oracle

type Oracle interface {
	GetLastPriceSyncTimestamp() time.Time
	GetPrices() sdk.DecCoins
}

Oracle defines the Oracle interface contract that the v1 router depends on.

type PricesResponse

type PricesResponse struct {
	Prices map[string]sdk.Dec `json:"prices"`
}

PricesResponse defines the response type for getting the latest exchange rates from the oracle.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router defines a router wrapper used for registering v1 API routes.

func New

func New(logger zerolog.Logger, cfg config.Config, oracle Oracle, metrics Metrics) *Router

func (*Router) RegisterRoutes

func (r *Router) RegisterRoutes(rtr *mux.Router, prefix string)

RegisterRoutes register v1 API routes on the provided sub-router.

Jump to

Keyboard shortcuts

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