gobs

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildResultQueryViewStatus     = "status"
	BuildResultQueryViewBinaryList = "binarylist"
	BuildResultQueryViewSummary    = "summary"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type About

type About struct {
	Title          string `xml:"title"`
	Description    string `xml:"description"`
	Revision       string `xml:"revision"`
	LastDeployment string `xml:"last_deployment"`
	Commit         string `xml:"commit"`
}

type BuildBinary

type BuildBinary struct {
	FileName string `xml:"filename,attr"`
	Size     string `xml:"size,attr"`
	MTime    string `xml:"mtime,attr"`
}

type BuildBinaryList

type BuildBinaryList struct {
	Package string        `xml:"package,attr"`
	Binary  []BuildBinary `xml:"binary"`
}

type BuildDimension

type BuildDimension struct {
	Unit  string `xml:"unit,attr"`
	Value string `xml:",chardata"`
}

func (BuildDimension) String

func (b BuildDimension) String() string

type BuildInfo

type BuildInfo struct {
	Project     string `xml:"project,attr"`
	Repository  string `xml:"repository,attr"`
	Package     string `xml:"package,attr"`
	DownloadUrl string `xml:"downloadurl,attr"`

	Arch               string   `xml:"arch"`
	SrcMD5             string   `xml:"srcmd5"`
	VerifyMD5          string   `xml:"VerifyMD5"`
	Rev                int      `xml:"rev"`
	Specfile           string   `xml:"specfile"`
	Release            string   `xml:"release"`
	VersRel            string   `xml:"versrel"`
	SubPackages        []string `xml:"subpack"`
	BinaryDependencies []struct {
		Name       string `xml:"name,attr"`
		Version    string `xml:"version,attr"`
		Release    string `xml:"release,attr"`
		Arch       string `xml:"arch,attr"`
		Project    string `xml:"project,attr"`
		Repository string `xml:"repository,attr"`
	} `xml:"bdep"`
}

type BuildJobStatus

type BuildJobStatus struct {
	Code         string `xml:"code,attr"`
	StartTime    string `xml:"starttime"`
	LastDuration string `xml:"lastduration"`
	HostArch     string `xml:"hostarch"`
	Uri          string `xml:"uri"`
	JobId        string `xml:"jobid"`
}

type BuildReason

type BuildReason struct {
	Explain   string `xml:"explain"`
	Time      string `xml:"time"`
	OldSource string `xml:"oldsource"`
}

type BuildResult

type BuildResult struct {
	Project    string            `xml:"project,attr"`
	Repository string            `xml:"repository,attr"`
	Arch       string            `xml:"arch,attr"`
	Code       string            `xml:"code,attr"`
	State      string            `xml:"state,attr"`
	Status     []BuildStatus     `xml:"status"`
	BinaryList []BuildBinaryList `xml:"binarylist"`
	Summary    BuildSummary      `xml:"summary"`
}

type BuildResultList

type BuildResultList struct {
	State   string        `xml:"state,attr"`
	Results []BuildResult `xml:"result"`
}

type BuildResultQuery

type BuildResultQuery struct {
	// View specifies which sections should be included in the result list.
	//  - [BuildResultQueryViewStatus]: Include detailed infos about the build status.
	//  - [BuildResultQueryViewSummary]: Include the summary of the status values.
	//  - [BuildResultQueryViewBinaryList]: Include a list of generated binary files.
	// If not specified the default value is [BuildResultQueryViewStatus].
	View       string `url:"view,omitempty"`
	Package    string `url:"package,omitempty"`
	Arch       string `url:"arch,omitempty"`
	Repository string `url:"repository,omitempty"`
	LastBuild  bool   `url:"lastbuild,omitempty"`
	LocalLink  bool   `url:"locallink,omitempty"`
	MultiBuild bool   `url:"multibuild,omitempty"`
}

type BuildStatistics

type BuildStatistics struct {
	Disk struct {
		Usage struct {
			Size       BuildDimension `xml:"size"`
			IoRequests string         `xml:"io_requests"`
			IoSectors  string         `xml:"io_sectors"`
		} `xml:"usage"`
	} `xml:"disk"`
	Memory struct {
		Usage struct {
			Size BuildDimension `xml:"size"`
		} `xml:"usage"`
	} `xml:"memory"`
	Times struct {
		Total struct {
			Time BuildDimension `xml:"time"`
		} `xml:"total"`
		Preinstall struct {
			Time BuildDimension `xml:"time"`
		} `xml:"preinstall"`
	} `xml:"times"`
	Download struct {
		Size      BuildDimension `xml:"size"`
		Binaries  int            `xml:"binaries"`
		CacheHits int            `xml:"cachehits"`
	} `xml:"download"`
}

type BuildStatus

type BuildStatus struct {
	Package string `xml:"package,attr"`
	Code    string `xml:"code,attr"`
	Details string `xml:",chardata"`
}

type BuildSummary

type BuildSummary struct {
	StatusCount []struct {
		Code  string `xml:"code,attr"`
		Count string `xml:"count,attr"`
	} `xml:"statuscount"`
}

type Client

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

func NewClient

func NewClient(host string, username string, password string) *Client

func (*Client) GetAbout

func (c *Client) GetAbout() (about About, err error)

func (*Client) GetArchitectures

func (c *Client) GetArchitectures(proj string, repo string) ([]string, error)

GetArchitectures returns a list of enabled architectures for a specific repository in a specific project

func (*Client) GetBuild

func (c *Client) GetBuild(proj string) ([]string, error)

GetBuild returns a simple listing of all repositories for the specified project.

If project is an empty string, returns a listing of ALL repositories in ALL projects.

func (*Client) GetBuildInfo

func (c *Client) GetBuildInfo(proj, repo, arch, pkg string) (*BuildInfo, error)

func (*Client) GetBuildResult

func (c *Client) GetBuildResult(proj string, q BuildResultQuery) (*BuildResultList, error)

func (*Client) GetBuildStatistics

func (c *Client) GetBuildStatistics(proj, repo, arch, pkg string) (*BuildStatistics, error)

func (*Client) GetPackageBinaries

func (c *Client) GetPackageBinaries(proj, repo, arch, pkg string) (*BuildBinaryList, error)

func (*Client) GetPackageBuildLog

func (c *Client) GetPackageBuildLog(proj, repo, arch, pkg string) (*string, error)

func (*Client) GetPackageBuildReason

func (c *Client) GetPackageBuildReason(proj, repo, arch, pkg string) (*BuildReason, error)

func (*Client) GetPackageBuildStatus

func (c *Client) GetPackageBuildStatus(proj, repo, arch, pkg string) (*BuildStatus, error)

func (*Client) GetPackageJobStatus

func (c *Client) GetPackageJobStatus(proj, repo, arch, pkg string) (*BuildJobStatus, error)

func (*Client) GetPackages

func (c *Client) GetPackages(proj string) ([]string, error)

func (*Client) GetRaw

func (c *Client) GetRaw(url string) (io.ReadCloser, error)

GetRaw returns the raw response body for a given URL

This is useful for downloading files or other content without parsing it into the corresponding struct.

The request is authenticated using the credentials provided when creating the client.

func (*Client) GetRequest

func (c *Client) GetRequest(id string) (*Request, error)

func (*Client) GetRequestCollection

func (c *Client) GetRequestCollection(q RequestCollectionQuery) (*RequestCollection, error)

func (*Client) GetRequests

func (c *Client) GetRequests() ([]string, error)

func (*Client) GetSourceFile

func (c *Client) GetSourceFile(project string, pkg string, file string) ([]byte, error)

type Directory

type Directory struct {
	Count   int16   `xml:"count,attr"`
	Entries []Entry `xml:"entry"`
}

func (Directory) GetEntryNames

func (dir Directory) GetEntryNames() (names []string)

type Entry

type Entry struct {
	Name string `xml:"name,attr"`
}

type Issue

type Issue struct {
	Change    string     `xml:"change,attr"`
	CreatedAt string     `xml:"created_at"`
	UpdatedAt string     `xml:"updated_at"`
	Name      string     `xml:"name"`
	Tracker   string     `xml:"tracker"`
	Label     string     `xml:"label"`
	Url       string     `xml:"url"`
	State     string     `xml:"state"`
	Summary   string     `xml:"summary"`
	Owner     IssueOwner `xml:"owner"`
}

type IssueOwner

type IssueOwner struct {
	RealName string `xml:"realname"`
	Email    string `xml:"email"`
	Login    string `xml:"login"`
}

type Package

type Package struct {
	Project string `xml:"project,attr"`
	Name    string `xml:"name,attr"`

	Issues []Issue `xml:"issue"`
}

type PackageRef

type PackageRef struct {
	Package string `xml:"package,attr"`
	Project string `xml:"project,attr"`
	Rev     string `xml:"rev,attr"`
}

type Request

type Request struct {
	Id          string           `xml:"id,attr"`
	Creator     string           `xml:"creator,attr"`
	Action      []RequestAction  `xml:"action"`
	State       RequestState     `xml:"state"`
	Review      []Review         `xml:"review"`
	History     []RequestHistory `xml:"history"`
	Description string           `xml:"description"`
}

type RequestAction

type RequestAction struct {
	Type   string     `xml:"type,attr"`
	Source PackageRef `xml:"source"`
	Target PackageRef `xml:"target"`
}

type RequestCollection

type RequestCollection struct {
	Requests []Request `xml:"request"`
	Matches  int       `xml:"matches,attr"`
}

type RequestCollectionQuery

type RequestCollectionQuery struct {
	User            string   `url:"user,omitempty"`
	Project         string   `url:"project,omitempty"`
	Package         string   `url:"package,omitempty"`
	States          []string `url:"states,omitempty" del:","`
	Types           []string `url:"types,omitempty" del:","`
	Roles           []string `url:"roles,omitempty" del:","`
	WithHistory     bool     `url:"withhistory,int,omitempty"`
	WithFullHistory bool     `url:"withfullhistory,int,omitempty"`
	Limit           int      `url:"limit,omitempty"`
	Offset          int      `url:"offset,omitempty"`
	Ids             []string `url:"ids,omitempty" del:","`
}

type RequestHistory

type RequestHistory struct {
	Who         string `xml:"who,attr"`
	When        string `xml:"when,attr"`
	Description string `xml:"description"`
	Comment     string `xml:"comment"`
}

type RequestState

type RequestState struct {
	Name    string `xml:"name,attr"`
	Who     string `xml:"who,attr"`
	When    string `xml:"when,attr"`
	Comment string `xml:",chardata"`
}

type Review

type Review struct {
	State  string `xml:"state,attr"`
	Who    string `xml:"who,attr"`
	When   string `xml:"when,attr"`
	ByUser string `xml:"by_user,attr"`
}

Jump to

Keyboard shortcuts

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