flypkgs

package
v0.2.52 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConflictError

func IsConflictError(err error) bool

func IsNotFoundErr

func IsNotFoundErr(err error) bool

Types

type Asset

type Asset struct {
	ID          uint64 `json:"id"`
	Name        string `json:"name"`
	Size        uint64 `json:"size"`
	SHA256      string `json:"sha256"`
	OS          string `json:"os"`
	Arch        string `json:"arch"`
	ContentType string `json:"content_type"`
	InsertedAt  string `json:"inserted_at"`
	UpdatedAt   string `json:"updated_at"`
}

type Channel

type Channel struct {
	ID         uint64    `json:"id"`
	Name       string    `json:"name"`
	Status     string    `json:"status"`
	Stable     bool      `json:"stable"`
	InsertedAt time.Time `json:"inserted_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type Client

type Client struct {
	BaseURL string

	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint, apiKey string) *Client

func (*Client) GetReleaseByVersion

func (c *Client) GetReleaseByVersion(ctx context.Context, v version.Version) (*Release, error)

func (*Client) PublishRelease

func (c *Client) PublishRelease(ctx context.Context, v version.Version) (*Release, error)

func (*Client) URL

func (c *Client) URL(path string, params ...any) string

func (*Client) UploadRelease

func (c *Client) UploadRelease(ctx context.Context, v version.Version, r io.Reader) (*Release, error)

type ErrorResponse

type ErrorResponse struct {
	Code     int
	Message  string   `json:"error"`
	Messages []string `json:"errors"`
}

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

type Release

type Release struct {
	ID             uint64          `json:"id"`
	Channel        Channel         `json:"channel"`
	Version        version.Version `json:"version"`
	GitCommit      string          `json:"git_commit"`
	GitBranch      string          `json:"git_branch"`
	GitTag         string          `json:"git_tag"`
	GitPreviousTag string          `json:"git_previous_tag"`
	GitDirty       bool            `json:"git_dirty"`
	Status         string          `json:"status"`
	InsertedAt     time.Time       `json:"inserted_at"`
	UpdatedAt      time.Time       `json:"updated_at"`
	PublishedAt    time.Time       `json:"published_at"`
	Assets         []Asset         `json:"assets"`
}

Jump to

Keyboard shortcuts

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