workflow

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

View Source
const (
	WorkflowVersion = "1.0.0"
)

Variables

This section is empty.

Functions

func GetTempDir

func GetTempDir() string

func SanitizeFilePath added in v1.7.2

func SanitizeFilePath(path string) string

func Save

func Save(dir string, workflow *Workflow) error

Save the workflow to the given directory, dir should generally be the root of the project, and the workflow will be saved to ${projectRoot}/.speakeasy/workflow.yaml

func SaveLockfile added in v1.11.0

func SaveLockfile(dir string, lockfile *LockFile) error

Save the workflow lockfile to the given directory, dir should generally be the root of the project, and the lockfile will be saved to ${projectRoot}/.speakeasy/workflow.lock

Types

type Auth

type Auth struct {
	Header string `yaml:"authHeader,omitempty"`
	Secret string `yaml:"authSecret,omitempty"`
}

type CodeSamples added in v1.9.0

type CodeSamples struct {
	Output   string          `yaml:"output"`
	Registry *SourceRegistry `yaml:"registry,omitempty"`
}

type Document

type Document struct {
	Location string `yaml:"location"`
	Auth     *Auth  `yaml:",inline"`
}

func (Document) GetTempDownloadPath

func (d Document) GetTempDownloadPath(tempDir string) string

func (Document) GetTempRegistryDir added in v1.11.3

func (d Document) GetTempRegistryDir(tempDir string) string

func (Document) IsRemote

func (d Document) IsRemote() bool

func (Document) IsSpeakeasyRegistry added in v1.11.3

func (d Document) IsSpeakeasyRegistry() bool

func (Document) Validate

func (d Document) Validate() error

type Java

type Java struct {
	OSSRHUsername     string `yaml:"ossrhUsername"`
	OSSHRPassword     string `yaml:"ossrhPassword"`
	GPGSecretKey      string `yaml:"gpgSecretKey"`
	GPGPassPhrase     string `yaml:"gpgPassPhrase"`
	UseSonatypeLegacy bool   `yaml:"useSonatypeLegacy,omitempty"`
}

type LockFile added in v1.11.0

type LockFile struct {
	SpeakeasyVersion string                `yaml:"speakeasyVersion"`
	Sources          map[string]SourceLock `yaml:"sources"`
	Targets          map[string]TargetLock `yaml:"targets"`

	Workflow Workflow `yaml:"workflow"`
}

func LoadLockfile added in v1.11.0

func LoadLockfile(dir string) (*LockFile, error)

type NPM

type NPM struct {
	Token string `yaml:"token"`
}

type Nuget

type Nuget struct {
	APIKey string `yaml:"apiKey"`
}

type Packagist

type Packagist struct {
	Username string `yaml:"username"`
	Token    string `yaml:"token"`
}

type Publishing

type Publishing struct {
	NPM       *NPM       `yaml:"npm,omitempty"`
	PyPi      *PyPi      `yaml:"pypi,omitempty"`
	Packagist *Packagist `yaml:"packagist,omitempty"`
	Java      *Java      `yaml:"java,omitempty"`
	RubyGems  *RubyGems  `yaml:"rubygems,omitempty"`
	Nuget     *Nuget     `yaml:"nuget,omitempty"`
	Terraform *Terraform `yaml:"terraform,omitempty"`
}

func (Publishing) IsPublished

func (p Publishing) IsPublished(target string) bool

func (Publishing) Validate

func (p Publishing) Validate(target string) error

type PyPi

type PyPi struct {
	Token string `yaml:"token"`
}

type RubyGems

type RubyGems struct {
	Token string `yaml:"token"`
}

type Source

type Source struct {
	Inputs   []Document      `yaml:"inputs"`
	Overlays []Document      `yaml:"overlays,omitempty"`
	Output   *string         `yaml:"output,omitempty"`
	Ruleset  *string         `yaml:"ruleset,omitempty"`
	Registry *SourceRegistry `yaml:"registry,omitempty"`
}

Ensure your update schema/workflow.schema.json on changes

func (Source) GetOutputLocation

func (s Source) GetOutputLocation() (string, error)

func (Source) GetTempMergeLocation

func (s Source) GetTempMergeLocation() string

func (Source) GetTempOverlayLocation

func (s Source) GetTempOverlayLocation() string

func (Source) Validate

func (s Source) Validate() error

type SourceLock added in v1.11.0

type SourceLock struct {
	SourceNamespace      string   `yaml:"sourceNamespace,omitempty"`
	SourceRevisionDigest string   `yaml:"sourceRevisionDigest,omitempty"`
	SourceBlobDigest     string   `yaml:"sourceBlobDigest,omitempty"`
	Tags                 []string `yaml:"tags,omitempty"`
}

type SourceRegistry added in v1.13.0

type SourceRegistry struct {
	Location SourceRegistryLocation `yaml:"location"`
	Tags     []string               `yaml:"tags,omitempty"`
}

func (*SourceRegistry) ParseRegistryLocation added in v1.13.0

func (p *SourceRegistry) ParseRegistryLocation() (string, string, string, error)

func (*SourceRegistry) SetNamespace added in v1.13.0

func (p *SourceRegistry) SetNamespace(namespace string) error

func (SourceRegistry) Validate added in v1.13.0

func (p SourceRegistry) Validate() error

type SourceRegistryLocation added in v1.13.0

type SourceRegistryLocation string

func (SourceRegistryLocation) Namespace added in v1.13.0

func (n SourceRegistryLocation) Namespace() string

@<org>/<workspace>/<namespace_name> => <org>/<workspace>/<namespace_name>

func (SourceRegistryLocation) NamespaceName added in v1.13.0

func (n SourceRegistryLocation) NamespaceName() string

@<org>/<workspace>/<namespace_name> => <namespace_name>

func (SourceRegistryLocation) String added in v1.13.0

func (n SourceRegistryLocation) String() string

type SpeakeasyRegistryDocument added in v1.11.3

type SpeakeasyRegistryDocument struct {
	OrganizationSlug string
	WorkspaceSlug    string
	NamespaceID      string
	NamespaceName    string
	// Reference could be tag or revision hash sha256:...
	Reference string
}

func ParseSpeakeasyRegistryReference added in v1.11.3

func ParseSpeakeasyRegistryReference(location string) *SpeakeasyRegistryDocument

Parse the location to extract the namespace ID, namespace name, and reference The location should be in the format registry.speakeasyapi.dev/org/workspace/name[:tag|@sha256:digest]

type Target

type Target struct {
	Target      string       `yaml:"target"`
	Source      string       `yaml:"source"`
	Output      *string      `yaml:"output,omitempty"`
	Publishing  *Publishing  `yaml:"publish,omitempty"`
	CodeSamples *CodeSamples `yaml:"codeSamples,omitempty"`
}

Ensure your update schema/workflow.schema.json on changes

func (Target) IsPublished added in v1.6.5

func (t Target) IsPublished() bool

func (Target) Validate

func (t Target) Validate(supportedLangs []string, sources map[string]Source) error

type TargetLock added in v1.11.0

type TargetLock struct {
	Source               string `yaml:"source"`
	SourceNamespace      string `yaml:"sourceNamespace,omitempty"`
	SourceRevisionDigest string `yaml:"sourceRevisionDigest,omitempty"`
	SourceBlobDigest     string `yaml:"sourceBlobDigest,omitempty"`
	OutLocation          string `yaml:"outLocation,omitempty"`
}

type Terraform added in v1.14.4

type Terraform struct {
	GPGPrivateKey string `yaml:"gpgPrivateKey"`
	GPGPassPhrase string `yaml:"gpgPassPhrase"`
}

type Version added in v1.10.1

type Version string

func (Version) String added in v1.10.1

func (v Version) String() string

type Workflow

type Workflow struct {
	Version          string            `yaml:"workflowVersion"`
	SpeakeasyVersion Version           `yaml:"speakeasyVersion,omitempty"`
	Sources          map[string]Source `yaml:"sources"`
	Targets          map[string]Target `yaml:"targets"`
}

Ensure your update schema/workflow.schema.json on changes

func Load

func Load(dir string) (*Workflow, string, error)

func (Workflow) GetTargetSource

func (w Workflow) GetTargetSource(target string) (*Source, string, error)

func (Workflow) Validate

func (w Workflow) Validate(supportLangs []string) error

Jump to

Keyboard shortcuts

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