indexfile

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const IndexFileName = "index.json"

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID   int64     `json:"id,omitempty"`
	URL  string    `json:"url"`
	Name string    `json:"name"`
	Base string    `json:"base,omitempty"`
	OS   AssetOS   `json:"os"`
	Arch AssetArch `json:"arch"`
	Type AssetType `json:"type"`
}

func MakeAsset

func MakeAsset(assetID int64, assetURL string, assetName string) Asset

func MakeSourceTarballAsset

func MakeSourceTarballAsset(assetURL string) Asset

func MakeSourceZipballAsset

func MakeSourceZipballAsset(assetURL string) Asset

func (Asset) CompareTo

func (a Asset) CompareTo(other Asset) CompareResult

func (Asset) ExtractBuildID

func (a Asset) ExtractBuildID(ctx context.Context, releaseDir string) (string, bool)

func (Asset) Mode

func (a Asset) Mode() fs.FileMode

type AssetArch

type AssetArch byte
const (
	UnknownAssetArch AssetArch = iota
	AnyArch
	AMD64Arch
	ARM64Arch
	NumAssetArches
)

func (AssetArch) CompareTo

func (value AssetArch) CompareTo(other AssetArch) CompareResult

func (AssetArch) Data

func (value AssetArch) Data() EnumData

func (AssetArch) GoString

func (value AssetArch) GoString() string

func (AssetArch) MarshalText

func (value AssetArch) MarshalText() ([]byte, error)

func (AssetArch) String

func (value AssetArch) String() string

func (*AssetArch) UnmarshalText

func (value *AssetArch) UnmarshalText(raw []byte) error

type AssetOS

type AssetOS byte
const (
	UnknownAssetOS AssetOS = iota
	AnyOS
	LinuxOS
	NumAssetOSes
)

func (AssetOS) CompareTo

func (value AssetOS) CompareTo(other AssetOS) CompareResult

func (AssetOS) Data

func (value AssetOS) Data() EnumData

func (AssetOS) GoString

func (value AssetOS) GoString() string

func (AssetOS) MarshalText

func (value AssetOS) MarshalText() ([]byte, error)

func (AssetOS) String

func (value AssetOS) String() string

func (*AssetOS) UnmarshalText

func (value *AssetOS) UnmarshalText(raw []byte) error

type AssetType

type AssetType byte
const (
	UnknownAssetType AssetType = iota
	SourceTarType
	SourceZipType
	ExecutableType
	ProvenanceType
	NumAssetTypes
)

func (AssetType) CompareTo

func (value AssetType) CompareTo(other AssetType) CompareResult

func (AssetType) Data

func (value AssetType) Data() EnumData

func (AssetType) GoString

func (value AssetType) GoString() string

func (AssetType) MarshalText

func (value AssetType) MarshalText() ([]byte, error)

func (AssetType) String

func (value AssetType) String() string

func (*AssetType) UnmarshalText

func (value *AssetType) UnmarshalText(raw []byte) error

type ComparableTo

type ComparableTo[T any] interface {
	CompareTo(T) CompareResult
}

type CompareResult

type CompareResult int
const (
	LT CompareResult = -1
	EQ CompareResult = 0
	GT CompareResult = 1
)

func CompareBigInt

func CompareBigInt(a *big.Int, b *big.Int) CompareResult

func CompareBool

func CompareBool[T ~bool](a T, b T) CompareResult

func CompareByte

func CompareByte[T ~byte](a T, b T) CompareResult

func CompareInt

func CompareInt[T ~int](a T, b T) CompareResult

func CompareInt64

func CompareInt64[T ~int64](a T, b T) CompareResult

func CompareRune

func CompareRune[T ~rune](a T, b T) CompareResult

func CompareString

func CompareString[T ~string](a T, b T) CompareResult

func CompareUint

func CompareUint[T ~uint](a T, b T) CompareResult

func CompareUint64

func CompareUint64[T ~uint64](a T, b T) CompareResult

func (CompareResult) CompareTo

func (value CompareResult) CompareTo(other CompareResult) CompareResult

func (CompareResult) Data

func (value CompareResult) Data() EnumData

func (CompareResult) GoString

func (value CompareResult) GoString() string

func (CompareResult) MarshalText

func (value CompareResult) MarshalText() ([]byte, error)

func (CompareResult) String

func (value CompareResult) String() string

func (*CompareResult) UnmarshalText

func (value *CompareResult) UnmarshalText(raw []byte) error

type EnumData

type EnumData struct {
	GoName  string
	Name    string
	Aliases []string
}

type Release

type Release struct {
	ID      int64   `json:"id,omitempty"`
	Tag     string  `json:"tag"`
	Name    string  `json:"name,omitempty"`
	Body    string  `json:"body,omitempty"`
	Version Version `json:"version"`
	Assets  []Asset `json:"assets,omitempty"`
}

func (Release) CompareTo

func (r Release) CompareTo(other Release) CompareResult

func (Release) FirstMatchingAsset added in v0.4.0

func (r Release) FirstMatchingAsset(fn func(Asset) bool) (Asset, bool)

func (Release) MatchingAssets added in v0.4.0

func (r Release) MatchingAssets(fn func(Asset) bool) []Asset

type SortableList

type SortableList[T ComparableTo[T]] []T

func (SortableList[T]) Len

func (list SortableList[T]) Len() int

func (SortableList[T]) Less

func (list SortableList[T]) Less(i, j int) bool

func (SortableList[T]) Sort

func (list SortableList[T]) Sort()

func (SortableList[T]) Swap

func (list SortableList[T]) Swap(i, j int)

type Version

type Version struct {
	Major      uint   `json:"major"`
	Minor      uint   `json:"minor"`
	Patch      uint   `json:"patch"`
	Prerelease string `json:"prerelease,omitempty"`
	BuildID    string `json:"buildID,omitempty"`
}

func (Version) AppendTo

func (v Version) AppendTo(out []byte) []byte

func (Version) CompareTo

func (v Version) CompareTo(other Version) CompareResult

func (Version) GoAppendTo

func (v Version) GoAppendTo(out []byte) []byte

func (Version) GoString

func (v Version) GoString() string

func (*Version) Parse

func (v *Version) Parse(str string) bool

func (Version) String

func (v Version) String() string

type VersionElement

type VersionElement struct {
	Type     VersionElementType
	IntValue *big.Int
	StrValue string
}

func (VersionElement) CompareTo

func (elem VersionElement) CompareTo(other VersionElement) CompareResult

type VersionElementList

type VersionElementList []VersionElement

func ParseVersionString

func ParseVersionString(str string) VersionElementList

func ParseVersionStringRaw

func ParseVersionStringRaw(str string) VersionElementList

func ParseVersionStrings

func ParseVersionStrings(inList []string) []VersionElementList

func (VersionElementList) CompareTo

func (list VersionElementList) CompareTo(other VersionElementList) CompareResult

type VersionElementType

type VersionElementType byte
const (
	UnknownVET VersionElementType = iota
	SymbolsVET
	DigitsVET
	LettersVET
	NumVersionElementTypes
)

func (VersionElementType) CompareTo

func (value VersionElementType) CompareTo(other VersionElementType) CompareResult

func (VersionElementType) Data

func (value VersionElementType) Data() EnumData

func (VersionElementType) GoString

func (value VersionElementType) GoString() string

func (VersionElementType) MarshalText

func (value VersionElementType) MarshalText() ([]byte, error)

func (VersionElementType) String

func (value VersionElementType) String() string

func (*VersionElementType) UnmarshalText

func (value *VersionElementType) UnmarshalText(raw []byte) error

Jump to

Keyboard shortcuts

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