publish

package
v0.0.19-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) (int64, error)

func CreateDir

func CreateDir(path string) error

func DownloadFile

func DownloadFile(url string, filepath string) error

DownloadFile will download a url and store it in local filepath. It writes to the destination file as it downloads it, without loading the entire file into memory.

func ReadFile

func ReadFile(filePath string) ([]string, error)

func WriteArchitectureFile

func WriteArchitectureFile(filePath string, arch Architecture) error

Types

type Architecture

type Architecture struct {
	Protocols           []string   `json:"protocols"`
	OS                  string     `json:"os"`
	Arch                string     `json:"arch"`
	FileName            string     `json:"filename"`
	DownloadUrl         string     `json:"download_url"`
	ShaSumsUrl          string     `json:"shasums_url"`
	ShaSumsSignatureUrl string     `json:"shasums_signature_url"`
	ShaSum              string     `json:"shasum"`
	SigningKeys         SigningKey `json:"signing_keys"`
}

type Data

type Data struct {
	Id       string    `json:"id,omitempty"`
	Versions []Version `json:"versions"`
}

func (*Data) AddVersion

func (d *Data) AddVersion(v Version) error

func (*Data) LoadFromFile

func (d *Data) LoadFromFile(filePath string) error

func (*Data) LoadFromUrl

func (d *Data) LoadFromUrl(uri string) error

func (*Data) Validate

func (d *Data) Validate() error

func (*Data) WriteToFile

func (d *Data) WriteToFile(filePath string) error

type GpgPublicKey

type GpgPublicKey struct {
	KeyId          string `json:"key_id"`
	AsciiArmor     string `json:"ascii_armor"`
	TrustSignature string `json:"trust_signature"`
	Source         string `json:"source"`
	SourceUrl      string `json:"source_url"`
}

type Platform

type Platform struct {
	OS   string `json:"os" yaml:"os"`
	Arch string `json:"arch" yaml:"arch"`
}

type Provider

type Provider struct {
	RootPath       string
	Namespace      string
	Provider       string
	DistPath       string
	RepoName       string
	Version        string
	GpgFingerprint string
	GpgPubKeyFile  string
	Domain         string
}

func (*Provider) CreateArchitectureFiles

func (p *Provider) CreateArchitectureFiles() error

func (*Provider) CreateV1Dir

func (p *Provider) CreateV1Dir() error

func (*Provider) CreateWellKnown

func (p *Provider) CreateWellKnown() error

func (*Provider) GetRoot

func (p *Provider) GetRoot() error

func (*Provider) GetShaSums

func (p *Provider) GetShaSums() (ShaSums, error)

func (*Provider) ReadGpgFile

func (p *Provider) ReadGpgFile() (string, error)

type ShaSum

type ShaSum struct {
	Sum  string
	Path string
}

type ShaSums

type ShaSums []ShaSum

func GetShaSumContents

func GetShaSumContents(distPath, repoName, version string) (ShaSums, error)

type SigningKey

type SigningKey struct {
	GpgPublicKeys []GpgPublicKey `json:"gpg_public_keys"`
}

type Version

type Version struct {
	Version   string     `json:"version"`
	Protocols []string   `json:"protocols"`
	Platforms []Platform `json:"platforms"`
}

func (*Version) AddPlatform

func (v *Version) AddPlatform(p Platform) error

func (*Version) AddProtocol

func (v *Version) AddProtocol(p string) error

func (*Version) Validate

func (v *Version) Validate() error

Jump to

Keyboard shortcuts

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