Documentation ¶
Index ¶
- Constants
- Variables
- func Client(insecure bool) *http.Client
- func DefaultConfig() (string, error)
- func DefectsURI(domain, project string, defect int) string
- func ReadEnv(prefix string, a *Instance)
- func ReleasesURI(domain, project string, release string) string
- type Defect
- type DefectsResponse
- type Delivery
- type Domain
- type DomainsResponse
- type Instance
- func (a *Instance) Defects(domain, project string) ([]Defect, error)
- func (a *Instance) Domains() ([]Domain, error)
- func (a *Instance) GetDefect(defect int) (*Defect, error)
- func (a *Instance) GetRelease(ID string) (*Release, error)
- func (a *Instance) NewReleases(releaseIDs []string) error
- func (a *Instance) PutDefect(d Defect) (*Defect, error)
- func (a *Instance) SignIn() error
- func (a *Instance) SignOut() error
- func (a *Instance) URL(uri string) string
- func (a *Instance) UpdateDefects(defects []string) error
- type Release
- type Tmt
Constants ¶
const ( // SignInURL according to ALM REST documentation SignInURL = "/api/authentication/sign-in" // SignOutURL according to ALM REST documentation SignOutURL = "/api/authentication/sign-out" )
Variables ¶
var ( // ErrMissingTmt indicates a missing root entry /tmt ErrMissingTmt = errors.New("missing required element tmt") // ErrEmptyTmt indicates root entry /tmt exists, but has no embedded // information. ErrEmptyTmt = errors.New("empty tmt:, missing required elements") // ErrMissingDomain indicates absence of tmt/domain ErrMissingDomain = errors.New("missing required element /tmt/domain") // ErrMissingProject indicates absence of tmt/project ErrMissingProject = errors.New("missing required element /tmt/project") )
A couple of parsing errors
Functions ¶
func DefaultConfig ¶
DefaultConfig returns the fully qualified filename of the config file, i.e. `${HOME}/.alm.yaml`
func DefectsURI ¶
DefectsURI returns the relative, constant REST API path for given defect.
func ReadEnv ¶
ReadEnv updates members in an ALM instance with values from corresponding environment variables, useful for twelve-factor apps.
func ReleasesURI ¶
ReleasesURI returns relative, constant REST API for given parameter set.
Types ¶
type Defect ¶
type Defect struct { ID int `json:"id"` Subject int `json:"subject"` Status string `json:"status"` Type string `json:"type"` }
Defect represents a subset of an ALM defect
func ParseDefect ¶
ParseDefect tries to convert bytes in JSON format into a Defect.
type DefectsResponse ¶
type DefectsResponse struct {
Defects []Defect `json:"results"`
}
DefectsResponse represents a REST api call request.
type DomainsResponse ¶
type DomainsResponse struct {
Domains []Domain `json:"results"`
}
DomainsResponse contains a list of all available domains in ALM.
type Instance ¶
type Instance struct { Protocol string Server string Port int Context string Username string Password string Domain string Project string FromStatus, IntoStatus string Client http.Client Dryrun bool }
Instance represents one remote service instance.
func (*Instance) Defects ¶
Defects issues a REST call to retrieve a list of defects for given parameter set.
func (*Instance) Domains ¶
Domains issues a REST call to retrieve a list of all available ALM domains.
func (*Instance) GetRelease ¶
GetRelease issues a REST call to retrieve a Release.
func (*Instance) NewReleases ¶
NewReleases logs existing releases to stdout.
func (*Instance) SignIn ¶
SignIn authenticates against ALM. https://admhelp.microfocus.com/alm/en/12.55/api_refs/REST/Content/REST_API/sign_in.htm
func (*Instance) UpdateDefects ¶
UpdateDefects issues a REST call to update status of defects.