shared

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePipelineArg

func ParsePipelineArg(arg string) (int, bbrepo.Interface, error)

ParsePipelineArg parses a pipeline argument which can be a build number or URL

Types

type Links struct {
	HTML struct {
		Href string `json:"href"`
	} `json:"html"`
	Self struct {
		Href string `json:"href"`
	} `json:"self"`
	Steps struct {
		Href string `json:"href"`
	} `json:"steps,omitempty"`
}

type Pipeline

type Pipeline struct {
	UUID        string  `json:"uuid"`
	BuildNumber int     `json:"build_number"`
	Creator     *User   `json:"creator,omitempty"`
	Repository  *Repo   `json:"repository,omitempty"`
	Target      *Target `json:"target,omitempty"`
	Trigger     *struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"trigger,omitempty"`
	State       *State `json:"state,omitempty"`
	CreatedOn   string `json:"created_on"`
	CompletedOn string `json:"completed_on,omitempty"`
	DurationIn  int    `json:"duration_in_seconds,omitempty"`
	Links       Links  `json:"links"`
}

Pipeline represents a Bitbucket pipeline

func (*Pipeline) CommitHash

func (p *Pipeline) CommitHash() string

CommitHash returns the short commit hash

func (*Pipeline) HTMLURL

func (p *Pipeline) HTMLURL() string

HTMLURL returns the web URL for the pipeline

func (*Pipeline) IsRunning

func (p *Pipeline) IsRunning() bool

IsRunning returns true if the pipeline is currently running

func (*Pipeline) RefName

func (p *Pipeline) RefName() string

RefName returns the branch or tag name

func (*Pipeline) StatusString

func (p *Pipeline) StatusString() string

StatusString returns a human-readable status

type PipelineList

type PipelineList struct {
	Size     int        `json:"size"`
	Page     int        `json:"page"`
	PageLen  int        `json:"pagelen"`
	Next     string     `json:"next"`
	Previous string     `json:"previous"`
	Values   []Pipeline `json:"values"`
}

PipelineList represents a paginated list of pipelines

type Repo

type Repo struct {
	FullName string `json:"full_name"`
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Links    Links  `json:"links"`
}

type State

type State struct {
	Name   string `json:"name"`
	Type   string `json:"type"`
	Result *struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"result,omitempty"`
	Stage *struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"stage,omitempty"`
}

type Step

type Step struct {
	UUID        string `json:"uuid"`
	Name        string `json:"name"`
	State       *State `json:"state,omitempty"`
	StartedOn   string `json:"started_on,omitempty"`
	CompletedOn string `json:"completed_on,omitempty"`
	DurationIn  int    `json:"duration_in_seconds,omitempty"`
	Image       *struct {
		Name string `json:"name"`
	} `json:"image,omitempty"`
	ScriptCommands []struct {
		Name    string `json:"name"`
		Command string `json:"command"`
	} `json:"script_commands,omitempty"`
	Links Links `json:"links"`
}

Step represents a pipeline step

type StepList

type StepList struct {
	Size     int    `json:"size"`
	Page     int    `json:"page"`
	PageLen  int    `json:"pagelen"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Values   []Step `json:"values"`
}

StepList represents a paginated list of steps

type StepLog

type StepLog struct {
	Name string `json:"name"`
	Log  string `json:"log"`
}

StepLog represents logs for a step

type Target

type Target struct {
	Type     string `json:"type"`
	RefType  string `json:"ref_type,omitempty"`
	RefName  string `json:"ref_name,omitempty"`
	Selector *struct {
		Type    string `json:"type"`
		Pattern string `json:"pattern"`
	} `json:"selector,omitempty"`
	Commit *struct {
		Hash    string `json:"hash"`
		Message string `json:"message,omitempty"`
	} `json:"commit,omitempty"`
	PullRequest *struct {
		ID    int    `json:"id"`
		Title string `json:"title,omitempty"`
	} `json:"pullrequest,omitempty"`
}

type User

type User struct {
	DisplayName string `json:"display_name"`
	UUID        string `json:"uuid"`
	AccountID   string `json:"account_id"`
	Nickname    string `json:"nickname"`
	Links       Links  `json:"links"`
}

Jump to

Keyboard shortcuts

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