workflow

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const (
	WorkflowVersion = "1.0.0"
)

Variables

View Source
var ErrNotFound = errors.New("could not find workflow.yaml")

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

Types

type Auth

type Auth struct {
	Header string `yaml:"authHeader,omitempty"`
	Secret string `yaml:"authSecret,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) IsRemote

func (d Document) IsRemote() 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 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"`
}

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"`
}

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 Target

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

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 Workflow

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

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