v15.11.0+incompatible Latest Latest

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 21 Imported by: 88




View Source
const (
	VersionVariantStable = "stable"
	VersionVariantHead   = "head"


This section is empty.


func GetFujiSettings

func GetFujiSettings() *fuji.Settings

func IsTerminal

func IsTerminal() bool


type ContainerResult

type ContainerResult struct {
	Type             string   `json:"type"`
	Spell            []string `json:"spell"`
	NumFiles         int      `json:"numFiles"`
	NumDirs          int      `json:"numDirs"`
	NumSymlinks      int      `json:"numSymlinks"`
	UncompressedSize int64    `json:"uncompressedSize"`

A ContainerResult is sent in json mode by the file command

For command `file`

type Context

type Context struct {
	App      *kingpin.Application
	Commands map[string]DoCommand

	// Identity is the path to the credentials file
	Identity string

	// String to include in our user-agent
	UserAgentAddition string

	// VersionString is the complete version string
	VersionString string

	// Version is just the version number, as a string
	Version string

	// The git commit hash
	Commit string

	// Quiet silences all output
	Quiet bool

	// Verbose enables chatty output
	Verbose bool

	// Verbose enables JSON output
	JSON bool

	// Path to the local sqlite database
	DBPath string

	CompressionAlgorithm string
	CompressionQuality   int

	HTTPClient    *http.Client
	HTTPTransport *http.Transport
	// contains filtered or unexported fields

func NewContext

func NewContext(app *kingpin.Application) *Context

func (*Context) APIAddress

func (ctx *Context) APIAddress() string

func (*Context) AuthenticateViaOauth

func (ctx *Context) AuthenticateViaOauth() (*itchio.Client, error)

func (*Context) CompressionSettings

func (ctx *Context) CompressionSettings() pwr.CompressionSettings

func (*Context) CurrentVariant

func (ctx *Context) CurrentVariant() VersionVariant

func (*Context) CurrentVersion

func (ctx *Context) CurrentVersion() *Version

func (*Context) DoVersionCheck

func (ctx *Context) DoVersionCheck()

func (*Context) HasSavedCredentials

func (ctx *Context) HasSavedCredentials() bool

func (*Context) Must

func (ctx *Context) Must(err error)

func (*Context) NewClient

func (ctx *Context) NewClient(key string) *itchio.Client

func (*Context) QueryLatestVersion

func (ctx *Context) QueryLatestVersion(variant VersionVariant) (*VersionCheckResult, error)

func (*Context) Register

func (ctx *Context) Register(clause *kingpin.CmdClause, do DoCommand)

func (*Context) SetAddress

func (ctx *Context) SetAddress(address string)

func (*Context) UpdateBaseURL

func (ctx *Context) UpdateBaseURL(variant VersionVariant) string

func (*Context) UserAgent

func (ctx *Context) UserAgent() string

func (*Context) WebAddress

func (ctx *Context) WebAddress() string

type DoCommand

type DoCommand func(ctx *Context)

type ElfPropsResult

type ElfPropsResult struct {
	Arch      string   `json:"arch"`
	Libraries []string `json:"libraries"`

ElfPropsResult contains the architecture of a binary file, and optionally a list of libraries it depends on

For command `elfprops`

type FileExtractedResult

type FileExtractedResult struct {
	Type string `json:"type"`
	Path string `json:"path"`

FileExtractedResult is sent as json so the consumer can know what we extracted It is sent even if we're resuming an extract.

For command `unzip`

type FileMirroredResult

type FileMirroredResult struct {
	Type string `json:"type"`
	Path string `json:"path"`

FileMirroredResult is sent as json so the consumer can know what we mirrored

For command `ditto`

type UserAgentSetter

type UserAgentSetter struct {
	OriginalTransport http.RoundTripper
	Context           *Context

func (*UserAgentSetter) RoundTrip

func (uas *UserAgentSetter) RoundTrip(req *http.Request) (*http.Response, error)

type Version

type Version struct {
	Name    string
	Variant VersionVariant

func (*Version) Equal

func (v *Version) Equal(v2 *Version) bool

func (*Version) String

func (v *Version) String() string

type VersionCheckResult

type VersionCheckResult struct {
	Current *Version
	Latest  *Version

type VersionVariant

type VersionVariant string

type WalkResult

type WalkResult struct {
	Type string `json:"type"`
	Path string `json:"path,omitempty"`
	Size int64  `json:"size,omitempty"`

WalkResult is sent for each item that's walked

For command `walk`

Jump to

Keyboard shortcuts

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