rateit

package
v0.0.0-...-66eeed4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUpstream = "http://localhost:3000"
	DefaultRetries  = 3
	DefaultTimeout  = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(opts ...Option) (*Client, error)

func (*Client) Rate

func (c *Client) Rate(ctx context.Context, route string) (models.Rate, error)

type ErrorRsp

type ErrorRsp struct {
	Code    int    `json:"err_code"`
	Message string `json:"err_message"`
}

type Option

type Option func(*Client)

func WithUpstream

func WithUpstream(upstream string) Option

func WithVerbose

func WithVerbose(verbose bool) Option

type RateRsp

type RateRsp struct {
	Rate float64 `json:"rate"`
}

Jump to

Keyboard shortcuts

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