cargo

package
v2.34.0-2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT 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 struct {
	// contains filtered or unexported fields
}

func NewClient added in v2.16.3

func NewClient(client *http.Client) *Client

func (*Client) GetCrate

func (c *Client) GetCrate(ctx context.Context, crate string) (*CratePayload, error)

func (*Client) GetLatestVersion

func (c *Client) GetLatestVersion(ctx context.Context, crate string) (string, error)

func (*Client) ListVersions

func (c *Client) ListVersions(ctx context.Context, crate string) ([]string, error)

type Crate

type Crate struct {
	Homepage    string `json:"homepage"`
	Description string `json:"description"`
	Repository  string `json:"repository"`
}

type CratePayload

type CratePayload struct {
	Crate *Crate `json:"crate"`
}

type MockClient

type MockClient struct {
	Versions     []string
	Err          error
	CratePayload *CratePayload
}

func (*MockClient) GetCrate

func (m *MockClient) GetCrate(ctx context.Context, crate string) (*CratePayload, error)

func (*MockClient) GetLatestVersion

func (m *MockClient) GetLatestVersion(ctx context.Context, crate string) (string, error)

func (*MockClient) ListVersions

func (m *MockClient) ListVersions(ctx context.Context, crate string) ([]string, error)

type Payload

type Payload struct {
	Versions []*PayloadVersion `json:"versions"`
}

type PayloadVersion

type PayloadVersion struct {
	Num string `json:"num"`
}

Jump to

Keyboard shortcuts

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