client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetUserAPIUsage(ctx context.Context, req *GetUserAPIUsageReq) (*GetUserAPIUsageRes, error)
	GetGroupAPIUsage(ctx context.Context, req *GetGroupAPIUsageReq) (*GetGroupAPIUsageRes, error)
}

func New

func New(key string) Client

type Date

type Date struct {
	time.Time
}

func (Date) EncodeValues

func (d Date) EncodeValues(key string, v *url.Values) error

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func (Error) Error

func (e Error) Error() string

type ErrorRes

type ErrorRes struct {
	Error Error `json:"error"`
}

type GetGroupAPIUsageReq

type GetGroupAPIUsageReq struct {
	Group     string `url:"-"`
	StartDate *Date  `url:"start_date,omitempty"`
	EndDate   *Date  `url:"end_date,omitempty"`
}

type GetGroupAPIUsageRes

type GetGroupAPIUsageRes struct {
	Data map[string]any `json:"data"`
}

type GetUserAPIUsageReq

type GetUserAPIUsageReq struct {
	User      string `url:"-"`
	StartDate *Date  `url:"start_date,omitempty"`
	EndDate   *Date  `url:"end_date,omitempty"`
}

type GetUserAPIUsageRes

type GetUserAPIUsageRes struct {
	Data map[string]any `json:"data"`
}

Jump to

Keyboard shortcuts

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