Versions in this module Expand all Collapse all v0 v0.6.0 Feb 20, 2026 Changes in this version + const MinMajorVersion + const MinMinorVersion + var AgentFields = FieldSpec + var BuildFields = FieldSpec + var BuildTypeFields = FieldSpec + var ErrAuthentication = errors.New("authentication failed: invalid or expired credentials") + var LongRetry = RetryConfig + var NoRetry = RetryConfig + var PoolFields = FieldSpec + var ProjectFields = FieldSpec + var QueuedBuildFields = FieldSpec + var ReadRetry = RetryConfig + func FormatTeamCityTime(t time.Time) string + func ParseTeamCityTime(s string) (time.Time, error) + func ParseUserDate(input string) (string, error) + func ToAPIFields(fields []string) string + func ToAPIFieldsEncoded(fields []string) string + type APIError struct + Message string + type APIErrorResponse struct + Errors []APIError + type Agent struct + Authorized bool + Build *Build + Connected bool + Enabled bool + Href string + ID int + Name string + Pool *Pool + TypeID int + WebURL string + type AgentList struct + Agents []Agent + Count int + Href string + NextHref string + type AgentRef struct + ID int + Name string + type AgentsOptions struct + Authorized bool + Connected bool + Enabled bool + Fields []string + Limit int + Pool string + type ApprovalInfo struct + CanBeApprovedByCurrentUser bool + ConfigurationValid bool + Status string + type Artifact struct + Children *Artifacts + Content *Content + Href string + ModTime string + Name string + Size int64 + type Artifacts struct + Count int + File []Artifact + type Build struct + Agent *Agent + BranchName string + BuildType *BuildType + BuildTypeID string + DefaultBranch bool + FinishDate string + Href string + ID int + LastChanges *ChangeList + Number string + PercentageComplete int + Personal bool + Pinned bool + QueuedDate string + StartDate string + State string + Status string + StatusText string + Tags *TagList + Triggered *Triggered + WebURL string + type BuildComment struct + Text string + type BuildList struct + Builds []Build + Count int + Href string + NextHref string + type BuildQueue struct + Builds []QueuedBuild + Count int + Href string + type BuildStep struct + ID string + Name string + Properties PropertyList + Type string + type BuildType struct + Href string + ID string + Name string + Paused bool + Project *Project + ProjectID string + ProjectName string + WebURL string + type BuildTypeList struct + BuildTypes []BuildType + Count int + type BuildTypeRef struct + ID string + type BuildTypesOptions struct + Fields []string + Limit int + Project string + type BuildsOptions struct + Branch string + BuildTypeID string + Fields []string + Limit int + Number string + Project string + SinceDate string + State string + Status string + UntilDate string + User string + type Change struct + Comment string + Date string + Files *Files + ID int + Username string + Version string + WebURL string + type ChangeList struct + Change []Change + Count int + type Client struct + APIVersion string + BaseURL string + DebugFunc func(format string, args ...any) + HTTPClient *http.Client + Token string + func NewClient(baseURL, token string, opts ...ClientOption) *Client + func NewClientWithBasicAuth(baseURL, username, password string, opts ...ClientOption) *Client + func (c *Client) AddBuildTags(buildID string, tags []string) error + func (c *Client) AddProjectToPool(poolID int, projectID string) error + func (c *Client) ApproveQueuedBuild(buildID string) error + func (c *Client) AuthorizeAgent(id int, authorized bool) error + func (c *Client) BuildTypeExists(id string) bool + func (c *Client) CancelBuild(buildID string, comment string) error + func (c *Client) CheckVersion() error + func (c *Client) CreateAPIToken(name string) (*Token, error) + func (c *Client) CreateBuildStep(buildTypeID string, step BuildStep) error + func (c *Client) CreateBuildType(projectID string, req CreateBuildTypeRequest) (*BuildType, error) + func (c *Client) CreateProject(req CreateProjectRequest) (*Project, error) + func (c *Client) CreateSecureToken(projectID, value string) (string, error) + func (c *Client) CreateUser(req CreateUserRequest) (*User, error) + func (c *Client) DeleteAPIToken(name string) error + func (c *Client) DeleteBuildComment(buildID string) error + func (c *Client) DeleteBuildTypeParameter(buildTypeID, name string) error + func (c *Client) DeleteProjectParameter(projectID, name string) error + func (c *Client) DownloadArtifact(buildID, artifactPath string) ([]byte, error) + func (c *Client) DownloadArtifactTo(ctx context.Context, buildID, artifactPath string, w io.Writer) (int64, error) + func (c *Client) EnableAgent(id int, enabled bool) error + func (c *Client) ExportProjectSettings(projectID, format string, useRelativeIds bool) ([]byte, error) + func (c *Client) GetAgent(id int) (*Agent, error) + func (c *Client) GetAgentByName(name string) (*Agent, error) + func (c *Client) GetAgentCompatibleBuildTypes(id int) (*BuildTypeList, error) + func (c *Client) GetAgentIncompatibleBuildTypes(id int) (*CompatibilityList, error) + func (c *Client) GetAgentPool(id int) (*Pool, error) + func (c *Client) GetAgentPools(requestedFields []string) (*PoolList, error) + func (c *Client) GetAgents(opts AgentsOptions) (*AgentList, error) + func (c *Client) GetArtifacts(buildID string, subpath string) (*Artifacts, error) + func (c *Client) GetBuild(ref string) (*Build, error) + func (c *Client) GetBuildChanges(buildID string) (*ChangeList, error) + func (c *Client) GetBuildComment(buildID string) (string, error) + func (c *Client) GetBuildLog(buildID string) (string, error) + func (c *Client) GetBuildProblems(buildID string) (*ProblemOccurrences, error) + func (c *Client) GetBuildQueue(opts QueueOptions) (*BuildQueue, error) + func (c *Client) GetBuildTags(buildID string) (*TagList, error) + func (c *Client) GetBuildTests(buildID string, failedOnly bool, limit int) (*TestOccurrences, error) + func (c *Client) GetBuildType(id string) (*BuildType, error) + func (c *Client) GetBuildTypeParameter(buildTypeID, name string) (*Parameter, error) + func (c *Client) GetBuildTypeParameters(buildTypeID string) (*ParameterList, error) + func (c *Client) GetBuildTypes(opts BuildTypesOptions) (*BuildTypeList, error) + func (c *Client) GetBuilds(opts BuildsOptions) (*BuildList, error) + func (c *Client) GetCurrentUser() (*User, error) + func (c *Client) GetParameterValue(path string) (string, error) + func (c *Client) GetProject(id string) (*Project, error) + func (c *Client) GetProjectParameter(projectID, name string) (*Parameter, error) + func (c *Client) GetProjectParameters(projectID string) (*ParameterList, error) + func (c *Client) GetProjects(opts ProjectsOptions) (*ProjectList, error) + func (c *Client) GetQueuedBuildApprovalInfo(buildID string) (*ApprovalInfo, error) + func (c *Client) GetSecureValue(projectID, token string) (string, error) + func (c *Client) GetServer() (*Server, error) + func (c *Client) GetUser(username string) (*User, error) + func (c *Client) GetVcsRootEntries(buildTypeID string) (*VcsRootEntries, error) + func (c *Client) GetVersionedSettingsConfig(projectID string) (*VersionedSettingsConfig, error) + func (c *Client) GetVersionedSettingsStatus(projectID string) (*VersionedSettingsStatus, error) + func (c *Client) MoveQueuedBuildToTop(buildID string) error + func (c *Client) PinBuild(buildID string, comment string) error + func (c *Client) ProjectExists(id string) bool + func (c *Client) RawRequest(method, path string, body io.Reader, headers map[string]string) (*RawResponse, error) + func (c *Client) RebootAgent(ctx context.Context, id int, afterBuild bool) error + func (c *Client) RemoveBuildTag(buildID string, tag string) error + func (c *Client) RemoveFromQueue(id string) error + func (c *Client) RemoveProjectFromPool(poolID int, projectID string) error + func (c *Client) ResolveBuildID(ref string) (string, error) + func (c *Client) RunBuild(buildTypeID string, opts RunBuildOptions) (*Build, error) + func (c *Client) ServerVersion() (*Server, error) + func (c *Client) SetAgentPool(agentID int, poolID int) error + func (c *Client) SetBuildComment(buildID string, comment string) error + func (c *Client) SetBuildTypeParameter(buildTypeID, name, value string, secure bool) error + func (c *Client) SetBuildTypePaused(id string, paused bool) error + func (c *Client) SetBuildTypeSetting(buildTypeID, setting, value string) error + func (c *Client) SetProjectParameter(projectID, name, value string, secure bool) error + func (c *Client) SetQueuedBuildPosition(buildID string, position int) error + func (c *Client) SupportsFeature(feature string) bool + func (c *Client) UnpinBuild(buildID string) error + func (c *Client) UploadDiffChanges(patch []byte, description string) (string, error) + func (c *Client) UserExists(username string) bool + type ClientInterface interface + AddBuildTags func(buildID string, tags []string) error + AddProjectToPool func(poolID int, projectID string) error + ApproveQueuedBuild func(buildID string) error + AuthorizeAgent func(id int, authorized bool) error + BuildTypeExists func(id string) bool + CancelBuild func(buildID string, comment string) error + CheckVersion func() error + CreateAPIToken func(name string) (*Token, error) + CreateBuildStep func(buildTypeID string, step BuildStep) error + CreateBuildType func(projectID string, req CreateBuildTypeRequest) (*BuildType, error) + CreateProject func(req CreateProjectRequest) (*Project, error) + CreateSecureToken func(projectID, value string) (string, error) + CreateUser func(req CreateUserRequest) (*User, error) + DeleteAPIToken func(name string) error + DeleteBuildComment func(buildID string) error + DeleteBuildTypeParameter func(buildTypeID, name string) error + DeleteProjectParameter func(projectID, name string) error + DownloadArtifact func(buildID, artifactPath string) ([]byte, error) + DownloadArtifactTo func(ctx context.Context, buildID, artifactPath string, w io.Writer) (int64, error) + EnableAgent func(id int, enabled bool) error + ExportProjectSettings func(projectID, format string, useRelativeIds bool) ([]byte, error) + GetAgent func(id int) (*Agent, error) + GetAgentByName func(name string) (*Agent, error) + GetAgentCompatibleBuildTypes func(id int) (*BuildTypeList, error) + GetAgentIncompatibleBuildTypes func(id int) (*CompatibilityList, error) + GetAgentPool func(id int) (*Pool, error) + GetAgentPools func(fields []string) (*PoolList, error) + GetAgents func(opts AgentsOptions) (*AgentList, error) + GetArtifacts func(buildID string, path string) (*Artifacts, error) + GetBuild func(ref string) (*Build, error) + GetBuildChanges func(buildID string) (*ChangeList, error) + GetBuildComment func(buildID string) (string, error) + GetBuildLog func(buildID string) (string, error) + GetBuildProblems func(buildID string) (*ProblemOccurrences, error) + GetBuildQueue func(opts QueueOptions) (*BuildQueue, error) + GetBuildTags func(buildID string) (*TagList, error) + GetBuildTests func(buildID string, failedOnly bool, limit int) (*TestOccurrences, error) + GetBuildType func(id string) (*BuildType, error) + GetBuildTypeParameter func(buildTypeID, name string) (*Parameter, error) + GetBuildTypeParameters func(buildTypeID string) (*ParameterList, error) + GetBuildTypes func(opts BuildTypesOptions) (*BuildTypeList, error) + GetBuilds func(opts BuildsOptions) (*BuildList, error) + GetCurrentUser func() (*User, error) + GetParameterValue func(path string) (string, error) + GetProject func(id string) (*Project, error) + GetProjectParameter func(projectID, name string) (*Parameter, error) + GetProjectParameters func(projectID string) (*ParameterList, error) + GetProjects func(opts ProjectsOptions) (*ProjectList, error) + GetQueuedBuildApprovalInfo func(buildID string) (*ApprovalInfo, error) + GetSecureValue func(projectID, token string) (string, error) + GetServer func() (*Server, error) + GetUser func(username string) (*User, error) + GetVcsRootEntries func(buildTypeID string) (*VcsRootEntries, error) + GetVersionedSettingsConfig func(projectID string) (*VersionedSettingsConfig, error) + GetVersionedSettingsStatus func(projectID string) (*VersionedSettingsStatus, error) + MoveQueuedBuildToTop func(buildID string) error + PinBuild func(buildID string, comment string) error + ProjectExists func(id string) bool + RawRequest func(method, path string, body io.Reader, headers map[string]string) (*RawResponse, error) + RebootAgent func(ctx context.Context, id int, afterBuild bool) error + RemoveBuildTag func(buildID string, tag string) error + RemoveFromQueue func(id string) error + RemoveProjectFromPool func(poolID int, projectID string) error + ResolveBuildID func(ref string) (string, error) + RunBuild func(buildTypeID string, opts RunBuildOptions) (*Build, error) + ServerVersion func() (*Server, error) + SetAgentPool func(agentID int, poolID int) error + SetBuildComment func(buildID string, comment string) error + SetBuildTypeParameter func(buildTypeID, name, value string, secure bool) error + SetBuildTypePaused func(id string, paused bool) error + SetBuildTypeSetting func(buildTypeID, setting, value string) error + SetProjectParameter func(projectID, name, value string, secure bool) error + SetQueuedBuildPosition func(buildID string, position int) error + SupportsFeature func(feature string) bool + UnpinBuild func(buildID string) error + UploadDiffChanges func(patch []byte, description string) (string, error) + UserExists func(username string) bool + type ClientOption func(*Client) + func WithAPIVersion(version string) ClientOption + func WithDebugFunc(f func(format string, args ...any)) ClientOption + func WithTimeout(timeout time.Duration) ClientOption + type Compatibility struct + Agent *Agent + BuildType *BuildType + Compatible bool + Reasons *IncompatibleReasons + type CompatibilityList struct + Compatibility []Compatibility + Count int + type Content struct + Href string + type CreateBuildTypeRequest struct + ID string + Name string + type CreateProjectRequest struct + ID string + Name string + ParentProjectID string + type CreateUserRequest struct + Email string + Name string + Password string + Roles RoleList + Username string + type FieldSpec struct + Available []string + Default []string + func (fs *FieldSpec) Help() string + func (fs *FieldSpec) ParseFields(input string) ([]string, error) + type FileChange struct + ChangeType string + File string + type Files struct + File []FileChange + type IncompatibleReasons struct + Reasons []string + type LastChanges struct + Change []PersonalChange + type Locator struct + func NewLocator() *Locator + func (l *Locator) Add(key, value string) *Locator + func (l *Locator) AddInt(key string, value int) *Locator + func (l *Locator) AddIntDefault(key string, value, defaultVal int) *Locator + func (l *Locator) AddRaw(key, value string) *Locator + func (l *Locator) AddUpper(key, value string) *Locator + func (l *Locator) Encode() string + func (l *Locator) IsEmpty() bool + func (l *Locator) String() string + type NetworkError struct + Cause error + URL string + func (e *NetworkError) Error() string + func (e *NetworkError) Unwrap() error + type NotFoundError struct + ID string + Message string + Resource string + func (e *NotFoundError) Error() string + type Parameter struct + Name string + Type *ParameterType + Value string + type ParameterList struct + Count int + Property []Parameter + type ParameterType struct + RawValue string + type PermissionError struct + Action string + func (e *PermissionError) Error() string + type PersonalChange struct + ID string + Personal bool + type Pool struct + Agents *AgentList + Href string + ID int + MaxAgents int + Name string + Projects *ProjectList + type PoolList struct + Count int + Pools []Pool + type ProblemOccurrence struct + Details string + ID string + Identity string + Type string + type ProblemOccurrences struct + Count int + ProblemOccurrence []ProblemOccurrence + type Project struct + Description string + Href string + ID string + Name string + ParentProjectID string + WebURL string + type ProjectList struct + Count int + Projects []Project + type ProjectsOptions struct + Fields []string + Limit int + Parent string + type Property struct + Name string + Value string + type PropertyList struct + Property []Property + type QueueOptions struct + BuildTypeID string + Fields []string + Limit int + type QueuedBuild struct + BranchName string + BuildType *BuildType + BuildTypeID string + Href string + ID int + QueuedDate string + State string + Triggered *Triggered + WebURL string + type RawResponse struct + Body []byte + Headers http.Header + StatusCode int + type RetryConfig struct + Interval time.Duration + MaxRetries uint64 + type Revision struct + VcsBranchName string + VcsRootInstance *VcsRootInstanceRef + Version string + type Revisions struct + Revision []Revision + type Role struct + RoleID string + Scope string + type RoleList struct + Role []Role + type RunBuildOptions struct + AgentID int + Branch string + CleanSources bool + Comment string + EnvVars map[string]string + Params map[string]string + Personal bool + PersonalChangeID string + QueueAtTop bool + RebuildDependencies bool + RebuildFailedDependencies bool + Revision string + SystemProps map[string]string + Tags []string + type Server struct + BuildNumber string + Version string + VersionMajor int + VersionMinor int + WebURL string + type Tag struct + Name string + type TagList struct + Tag []Tag + type TestOccurrence struct + Details string + Duration int + Href string + ID string + Ignored bool + Name string + Status string + type TestOccurrences struct + Count int + Failed int + Ignored int + Passed int + TestOccurrence []TestOccurrence + type Token struct + Name string + Value string + type TriggerBuildRequest struct + Agent *AgentRef + BranchName string + BuildType BuildTypeRef + Comment *BuildComment + LastChanges *LastChanges + Personal bool + Properties *PropertyList + Revisions *Revisions + Tags *TagList + TriggeringOptions *TriggeringOptions + type Triggered struct + Date string + Type string + User *User + type TriggeringOptions struct + CleanSources bool + QueueAtTop bool + RebuildAllDependencies bool + RebuildFailedOrIncomplete bool + type User struct + Email string + Href string + ID int + Name string + Username string + type VcsRootEntries struct + Count int + VcsRootEntry []VcsRootEntry + type VcsRootEntry struct + ID string + VcsRoot *VcsRootRef + type VcsRootInstanceRef struct + VcsRootID string + type VcsRootRef struct + ID string + Name string + type VersionedSettingsConfig struct + AllowUIEditing bool + BuildSettingsMode string + Format string + SettingsPath string + ShowSettingsChanges bool + SynchronizationMode string + VcsRootID string + type VersionedSettingsStatus struct + DslOutdated bool + Message string + Timestamp string + Type string