koji

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKojiTransport

func CreateKojiTransport(relaxTimeout uint) http.RoundTripper

func CreateRetryableTransport

func CreateRetryableTransport() *rh.RoundTripper

Types

type BuildRoot

type BuildRoot struct {
	ID               uint64           `json:"id"`
	Host             Host             `json:"host"`
	ContentGenerator ContentGenerator `json:"content_generator"`
	Container        Container        `json:"container"`
	Tools            []Tool           `json:"tools"`
	RPMs             []rpmmd.RPM      `json:"components"`
}

type CGImportResult

type CGImportResult struct {
	BuildID int `xmlrpc:"build_id"`
}

type CGInitBuildResult

type CGInitBuildResult struct {
	BuildID int    `xmlrpc:"build_id"`
	Token   string `xmlrpc:"token"`
}

type Container

type Container struct {
	Type string `json:"type"`
	Arch string `json:"arch"`
}

type ContentGenerator

type ContentGenerator struct {
	Name    string `json:"name"` // Must be 'osbuild'.
	Version string `json:"version"`
}

type GSSAPICredentials

type GSSAPICredentials struct {
	Principal string
	KeyTab    string
}

func GSSAPICredentialsFromEnv

func GSSAPICredentialsFromEnv() (*GSSAPICredentials, error)

type Host

type Host struct {
	Os   string `json:"os"`
	Arch string `json:"arch"`
}

type Image

type Image struct {
	BuildRootID  uint64      `json:"buildroot_id"`
	Filename     string      `json:"filename"`
	FileSize     uint64      `json:"filesize"`
	Arch         string      `json:"arch"`
	ChecksumType string      `json:"checksum_type"` // must be 'md5'
	MD5          string      `json:"checksum"`
	Type         string      `json:"type"`
	RPMs         []rpmmd.RPM `json:"components"`
	Extra        ImageExtra  `json:"extra"`
}

type ImageBuild

type ImageBuild struct {
	BuildID   uint64          `json:"build_id"`
	TaskID    uint64          `json:"task_id"`
	Name      string          `json:"name"`
	Version   string          `json:"version"`
	Release   string          `json:"release"`
	Source    string          `json:"source"`
	StartTime int64           `json:"start_time"`
	EndTime   int64           `json:"end_time"`
	Extra     ImageBuildExtra `json:"extra"`
}

type ImageBuildExtra

type ImageBuildExtra struct {
	TypeInfo TypeInfo `json:"typeinfo"`
}

type ImageExtra

type ImageExtra struct {
	Info ImageExtraInfo `json:"image"`
}

type ImageExtraInfo

type ImageExtraInfo struct {
	// TODO: Ideally this is where the pipeline would be passed.
	Arch string `json:"arch"` // TODO: why?
}

type Koji

type Koji struct {
	// contains filtered or unexported fields
}

func NewFromGSSAPI

func NewFromGSSAPI(server string, credentials *GSSAPICredentials, transport http.RoundTripper) (*Koji, error)

NewFromGSSAPI creates a new Koji session authenticated using GSSAPI. Principal and keytab used for the session is passed using credentials parameter.

func NewFromPlain

func NewFromPlain(server, user, password string, transport http.RoundTripper) (*Koji, error)

NewFromPlain creates a new Koji sessions =authenticated using the plain username/password method. If you want to speak to a public koji instance, you probably cannot use this method.

func (*Koji) CGCancelBuild

func (k *Koji) CGCancelBuild(buildID int, token string) error

CGCancelBuild marks an in-progress build as cancelled, and

func (*Koji) CGFailBuild

func (k *Koji) CGFailBuild(buildID int, token string) error

CGFailBuild marks an in-progress build as failed

func (*Koji) CGImport

func (k *Koji) CGImport(build ImageBuild, buildRoots []BuildRoot, images []Image, directory, token string) (*CGImportResult, error)

CGImport imports previously uploaded content, by specifying its metadata, and the temporary directory where it is located.

func (*Koji) CGInitBuild

func (k *Koji) CGInitBuild(name, version, release string) (*CGInitBuildResult, error)

CGInitBuild reserves a build ID and initializes a build

func (*Koji) GetAPIVersion

func (k *Koji) GetAPIVersion() (int, error)

GetAPIVersion gets the version of the API of the remote Koji instance

func (*Koji) Logout

func (k *Koji) Logout() error

Logout ends the session

func (*Koji) Upload

func (k *Koji) Upload(file io.Reader, filepath, filename string) (string, uint64, error)

Upload uploads file to the temporary filepath on the kojiserver under the name filename The md5sum and size of the file is returned on success.

type LeveledLogrus

type LeveledLogrus struct {
	*logrus.Logger
}

func (*LeveledLogrus) Debug

func (l *LeveledLogrus) Debug(msg string, keysAndValues ...interface{})

func (*LeveledLogrus) Error

func (l *LeveledLogrus) Error(msg string, keysAndValues ...interface{})

func (*LeveledLogrus) Info

func (l *LeveledLogrus) Info(msg string, keysAndValues ...interface{})

func (*LeveledLogrus) Warn

func (l *LeveledLogrus) Warn(msg string, keysAndValues ...interface{})

type Metadata

type Metadata struct {
	MetadataVersion int         `json:"metadata_version"` // must be '0'
	ImageBuild      ImageBuild  `json:"build"`
	BuildRoots      []BuildRoot `json:"buildroots"`
	Images          []Image     `json:"output"`
}

type Tool

type Tool struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func (*Transport) RoundTrip

func (rt *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface, using the default transport. When a session has been established, also pass along the session credentials. This may not be how the RoundTripper interface is meant to be used, but the underlying XML-RPC helpers don't allow us to adjust the URL per-call (these arguments should really be in the body).

type TypeInfo

type TypeInfo struct {
	Image struct{} `json:"image"`
}

Jump to

Keyboard shortcuts

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