concourse

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

package concourse contains types compatible with the data structures in Concourse such as its pipeline schema and the inputs and outputs to and from Concourse Resources. Such types are used by Forge but are not specific to it.

Index

Constants

View Source
const (
	MethodGet   = "get"
	MethodPut   = "put"
	MethodCheck = "check"
)
View Source
const (
	EntrypointGet   = "/opt/resource/in"
	EntrypointPut   = "/opt/resource/out"
	EntrypointCheck = "/opt/resource/check"
)

Variables

View Source
var BuiltinResourceTypes = []ResourceType{
	{
		Name: "git",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/git-resource",
			Tag:        "1.15.0",
		},
	},
	{
		Name: "s3",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/s3-resource",
			Tag:        "1.3.0",
		},
	},
	{
		Name: "docker-image",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/docker-image-resource",
			Tag:        "1.8.0",
		},
	},
	{
		Name: "github-release",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/github-release-resource",
			Tag:        "1.9.0",
		},
	},
	{
		Name: "registry-image",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/registry-image-resource",
			Tag:        "1.9.0",
		},
	},
	{
		Name: "pool",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/pool-resource",
			Tag:        "1.4.0",
		},
	},
	{
		Name: "time",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/time-resource",
			Tag:        "1.7.0",
		},
	},
	{
		Name: "semver",
		Source: &ResourceTypeSource{
			Repository: "docker.io/concourse/semver-resource",
			Tag:        "1.7.0",
		},
	},
}

Functions

func GetEntrypoint added in v1.0.0

func GetEntrypoint(method string) []string

func WithResources

func WithResources(ctx context.Context, resources ...*Resource) context.Context

WithResources embeds the given resources into the given context.

Types

type Input

type Input struct {
	Params  map[string]any `json:"params,omitempty"`
	Source  map[string]any `json:"source,omitempty"`
	Version map[string]any `json:"version,omitempty"`
}

Input is the struct which has the JSON encoding which gets passed on stdin to a resource.

type Output

type Output struct {
	Version  map[string]string `json:"version,omitempty"`
	Metadata []struct {
		Name  string `json:"name,omitempty"`
		Value string `json:"value,omitempty"`
	} `json:"metadata,omitempty"`
}

Output has the JSON encoding which a resource outputs on stdout.

type Pipeline added in v0.7.0

type Pipeline struct {
	ResourceTypes []ResourceType `json:"resource_types,omitempty"`
	Resources     []Resource     `json:"resources,omitempty"`
}

Pipeline is the subset of a Concourse pipeline file relevant to finding resource_types.

type Resource

type Resource struct {
	Name   string         `json:"name,omitempty"`
	Type   string         `json:"type,omitempty"`
	Source map[string]any `json:"source,omitempty"`
}

Resource has the YAML encoding of a resource as it would appear in the `resource` array of a Concourse pipeline configuration file.

func ResourcesFrom

func ResourcesFrom(ctx context.Context) (resources []Resource, ok bool)

ResourcesFrom returns whatever resources have been embedded in given context.

type ResourceType

type ResourceType struct {
	Name       string              `json:"name,omitempty"`
	Privileged bool                `json:"privileged,omitempty"`
	Source     *ResourceTypeSource `json:"source,omitempty"`
}

ResourceType has the YAML encoding of a resource type as it would appear in the `resource_types` array of a Concourse pipeline configuration file.

type ResourceTypeSource added in v0.13.0

type ResourceTypeSource struct {
	Repository string `json:"repository,omitempty"`
	Tag        string `json:"tag,omitempty"`
}

Jump to

Keyboard shortcuts

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