steplibrary

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	GetAllStepIDs(ctx context.Context) ([]string, error)
	GetLatestStepVersions(ctx context.Context, id string) (steplibindex.LatestPointer, error)
	// GetAllStepVersions returns all available versions of a step.
	// Mirrors `index/steps/<id>/versions.json` from the V2 inventory layout.
	GetAllStepVersions(ctx context.Context, id string) ([]string, error)
	// GetStepGroupInfo returns version-independent step metadata
	// (maintainer, deprecation, asset URLs). Mirrors `steps/<id>/step-info.json`.
	GetStepGroupInfo(ctx context.Context, id string) (steplibindex.StepInfo, error)
	// GetStepModel fetches the V2 per-version step manifest (mirrors
	// `steps/<id>/<version>/step.json`, which serializes models.StepModel).
	GetStepModel(ctx context.Context, step ResolvedStepVersion) (models.StepModel, error)
	// GetStepSourceDownloadLocations returns the inventory-wide base download locations
	// (mirrors meta.json's download_locations): a zip base and a git marker,
	// from which per-step source URLs are built.
	GetStepSourceDownloadLocations(ctx context.Context) ([]models.DownloadLocationModel, error)
}

type Client

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

func New

func New(log stepman.Logger, inventoryURL string) *Client

New builds a stepman.Client. inventoryURL: the base URL of the API where metadata is fetched from.

func (*Client) FetchStepMetadata added in v0.23.0

func (c *Client) FetchStepMetadata(ctx context.Context, stepRef stepid.CanonicalID) (models.StepInfoModel, error)

func (*Client) StepSourceDownloadLocations added in v0.24.0

func (c *Client) StepSourceDownloadLocations(ctx context.Context, id, version, sourceGit string) ([]models.DownloadLocationModel, error)

StepSourceDownloadLocations returns a priority order of step source zip download locations

type HTTPAPI

type HTTPAPI struct {
	BaseURL string
	Fetcher httpfetch.Client
}

HTTPAPI fetches the V2 inventory (step_ids/latest/versions/step-info/step.json) over HTTP from a base URL.

func NewHTTPAPI

func NewHTTPAPI(baseURL string, fetcher httpfetch.Client) *HTTPAPI

func (*HTTPAPI) GetAllStepIDs

func (h *HTTPAPI) GetAllStepIDs(ctx context.Context) ([]string, error)

func (*HTTPAPI) GetAllStepVersions

func (h *HTTPAPI) GetAllStepVersions(ctx context.Context, id string) ([]string, error)

func (*HTTPAPI) GetLatestStepVersions

func (h *HTTPAPI) GetLatestStepVersions(ctx context.Context, id string) (steplibindex.LatestPointer, error)

func (*HTTPAPI) GetStepGroupInfo

func (h *HTTPAPI) GetStepGroupInfo(ctx context.Context, id string) (steplibindex.StepInfo, error)

func (*HTTPAPI) GetStepModel

func (h *HTTPAPI) GetStepModel(ctx context.Context, step ResolvedStepVersion) (models.StepModel, error)

func (*HTTPAPI) GetStepSourceDownloadLocations added in v0.24.0

func (h *HTTPAPI) GetStepSourceDownloadLocations(ctx context.Context) ([]models.DownloadLocationModel, error)

type ResolvedStepVersion

type ResolvedStepVersion struct {
	ID, Version string
}

Directories

Path Synopsis
Package indexgen generates the V2 step library inventory tree from a bitrise-steplib source.
Package indexgen generates the V2 step library inventory tree from a bitrise-steplib source.
Package steplibindex defines the Go types for the V2 step library inventory wire format.
Package steplibindex defines the Go types for the V2 step library inventory wire format.

Jump to

Keyboard shortcuts

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