Documentation ¶
Index ¶
- Constants
- Variables
- func GetTempDir() string
- func SanitizeFilePath(path string) string
- func Save(dir string, workflow *Workflow) error
- func SaveLockfile(dir string, lockfile *LockFile) error
- type Auth
- type CodeSamples
- type CodeSamplesLabelOverride
- type Document
- type FallbackCodeSamples
- type FilterOperationsOptions
- type Java
- type LocationString
- type LockFile
- type MockServer
- type NPM
- type NormalizeOptions
- type Nuget
- type Overlay
- type Packagist
- type Publishing
- type PyPi
- type RubyGems
- type Source
- type SourceLock
- type SourceRegistry
- type SourceRegistryLocation
- type SpeakeasyRegistryDocument
- type Target
- type TargetLock
- type Terraform
- type Testing
- type Transformation
- type Version
- type Workflow
Constants ¶
const (
WorkflowVersion = "1.0.0"
)
Variables ¶
var SupportedLanguagesUsageSnippets = []string{
"go",
"typescript",
"python",
"java",
"php",
"swift",
"ruby",
"csharp",
"unity",
}
Functions ¶
func GetTempDir ¶
func GetTempDir() string
func SanitizeFilePath ¶ added in v1.7.2
func Save ¶
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
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 CodeSamples ¶ added in v1.9.0
type CodeSamples struct { Output string `yaml:"output,omitempty"` Registry *SourceRegistry `yaml:"registry,omitempty"` Style *string `yaml:"style,omitempty"` // Oneof "standard", "readme" (default: standard) (see codesamples.go) LangOverride *string `yaml:"langOverride,omitempty"` // The value to use for the "lang" field of each codeSample (default: auto-detect) LabelOverride *CodeSamplesLabelOverride `yaml:"labelOverride,omitempty"` // The value to use for the "label" field of each codeSample (default: operationId) Blocking *bool `yaml:"blocking,omitempty"` // Default: true. If false, code samples failures will not consider the workflow as failed }
type CodeSamplesLabelOverride ¶ added in v1.23.0
type Document ¶
type Document struct { Location LocationString `yaml:"location"` Auth *Auth `yaml:",inline"` }
func (Document) GetTempDownloadPath ¶
func (Document) GetTempRegistryDir ¶ added in v1.11.3
func (Document) IsSpeakeasyRegistry ¶ added in v1.11.3
type FallbackCodeSamples ¶ added in v1.15.1
type FallbackCodeSamples struct {
FallbackCodeSamplesLanguage string `yaml:"fallbackCodeSamplesLanguage,omitempty"`
}
func (FallbackCodeSamples) Validate ¶ added in v1.15.4
func (f FallbackCodeSamples) Validate() error
type FilterOperationsOptions ¶ added in v1.27.0
type FilterOperationsOptions struct { Operations string `yaml:"operations"` // Comma-separated list of operations to filter Include *bool `yaml:"include,omitempty"` Exclude *bool `yaml:"exclude,omitempty"` }
func (FilterOperationsOptions) ParseOperations ¶ added in v1.27.0
func (f FilterOperationsOptions) ParseOperations() []string
type LocationString ¶ added in v1.22.0
type LocationString string
func (LocationString) Reference ¶ added in v1.22.0
func (l LocationString) Reference() string
func (LocationString) Resolve ¶ added in v1.22.0
func (l LocationString) Resolve() string
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
type MockServer ¶ added in v1.28.1
type MockServer struct { // When enabled, the mockserver will be started during testing. Enabled *bool `yaml:"enabled,omitempty"` }
Configuration for mockserver handling during testing.
type NormalizeOptions ¶ added in v1.29.2
type NormalizeOptions struct {
PrefixItems *bool `yaml:"prefixItems,omitempty"`
}
type Overlay ¶ added in v1.15.1
type Overlay struct { FallbackCodeSamples *FallbackCodeSamples `yaml:"fallbackCodeSamples,omitempty"` Document *Document `yaml:"document,omitempty"` }
Either FallBackCodeSamples or Document
func (Overlay) MarshalYAML ¶ added in v1.15.3
func (*Overlay) UnmarshalYAML ¶ added in v1.15.3
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 Source ¶
type Source struct { Inputs []Document `yaml:"inputs"` Overlays []Overlay `yaml:"overlays,omitempty"` Transformations []Transformation `yaml:"transformations,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 (Source) GetTempMergeLocation ¶
func (Source) GetTempOverlayLocation ¶
func (Source) GetTempTransformLocation ¶ added in v1.27.1
func (Source) IsSingleInput ¶ added in v1.27.2
type SourceLock ¶ added in v1.11.0
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 (*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"` // Configuration for target testing. By default, target testing is disabled. Testing *Testing `yaml:"testing,omitempty"` }
Ensure your update schema/workflow.schema.json on changes
func (Target) IsPublished ¶ added in v1.6.5
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"` CodeSamplesNamespace string `yaml:"codeSamplesNamespace,omitempty"` CodeSamplesRevisionDigest string `yaml:"codeSamplesRevisionDigest,omitempty"` CodeSamplesBlobDigest string `yaml:"codeSamplesBlobDigest,omitempty"` }
type Testing ¶ added in v1.28.1
type Testing struct { // When enabled, the target will be tested as part of the workflow. Enabled *bool `yaml:"enabled,omitempty"` // Configuration for mockserver handling during testing. By default, the // mockserver is enabled. MockServer *MockServer `yaml:"mockServer,omitempty"` }
Configuration for target testing, such as `go test` for Go targets.
type Transformation ¶ added in v1.27.0
type Transformation struct { RemoveUnused *bool `yaml:"removeUnused,omitempty"` FilterOperations *FilterOperationsOptions `yaml:"filterOperations,omitempty"` Cleanup *bool `yaml:"cleanup,omitempty"` Format *bool `yaml:"format,omitempty"` Normalize *NormalizeOptions `yaml:"normalize,omitempty"` }
func (Transformation) Validate ¶ added in v1.27.0
func (t Transformation) Validate() error
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