keybase

package
v0.5.0-rc10 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultHTTPClient is the default rate limited HTTP client
	DefaultHTTPClient = &RLHTTPClient{
		client:      http.DefaultClient,
		Ratelimiter: rate.NewLimiter(rate.Every(1*time.Second), 25),
	}
)

Functions

func GetAvatarURL

func GetAvatarURL(ctx context.Context, identity string) (string, error)

GetAvatarURL returns the avatar URL from the given identity. If no identity is found, it returns an empty string instead.

Types

type AccountDetails

type AccountDetails struct {
	Pictures *AccountPictures `json:"pictures"`
}

AccountDetails contains the data of a single account details

type AccountPictures

type AccountPictures struct {
	Primary *Picture `json:"primary"`
}

AccountPictures contains the info of an account's pictures

type IdentityQueryResponse

type IdentityQueryResponse struct {
	Status  QueryStatus      `json:"status"`
	Objects []AccountDetails `json:"them"`
}

IdentityQueryResponse represents the response to an identity query

type Picture

type Picture struct {
	URL string `json:"url"`
}

Picture contains the info of a single picture

type QueryStatus

type QueryStatus struct {
	ErrDesc string `json:"desc"`
	Code    int64  `json:"code"`
}

QueryStatus contains the details of the status of a request

type RLHTTPClient added in v0.0.3

type RLHTTPClient struct {
	Ratelimiter *rate.Limiter
	// contains filtered or unexported fields
}

RLHTTPClient Rate Limited HTTP Client

func (*RLHTTPClient) Do added in v0.0.3

func (c *RLHTTPClient) Do(ctx context.Context, req *http.Request) (*http.Response, error)

Do dispatches the HTTP request to the network

Jump to

Keyboard shortcuts

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