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 Dependent
- 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" description:"The output file name"`
Registry *SourceRegistry `yaml:"registry,omitempty" description:"The output registry location."`
Style *string `` // Oneof "standard", "readme" (default: standard) (see codesamples.go)
/* 126-byte string literal not displayed */
LangOverride *string `` // The value to use for the "lang" field of each codeSample (default: auto-detect)
/* 127-byte string literal not displayed */
LabelOverride *CodeSamplesLabelOverride `yaml:"labelOverride,omitempty" description:"Optional label override for the code sample. Default is to use the operationId."` // The value to use for the "label" field of each codeSample (default: operationId)
Blocking *bool `` // Default: true. If false, code samples failures will not consider the workflow as failed
/* 130-byte string literal not displayed */
Disabled *bool `yaml:"disabled,omitempty" description:"Optional flag to disable code samples."` // Default: false. If true, code samples will not be generated
// contains filtered or unexported fields
}
func (CodeSamples) Enabled ¶ added in v1.34.0
func (c CodeSamples) Enabled() bool
type CodeSamplesLabelOverride ¶ added in v1.23.0
type Dependent ¶ added in v1.33.0
type Dependent struct {
Location string `yaml:"location" description:"The local path to the repository" required:"true"`
CloneCommand string `yaml:"cloneCommand,omitempty" description:"Optional command to clone the repository"`
// contains filtered or unexported fields
}
Ensure you update schema/workflow.schema.json on changes
type Document ¶
type Document struct {
Location LocationString `` /* 151-byte string literal not displayed */
Auth *Auth `yaml:",inline"`
// contains filtered or unexported fields
}
func (Document) GetTempDownloadPath ¶
func (Document) GetTempRegistryDir ¶ added in v1.11.3
func (Document) IsSpeakeasyRegistry ¶ added in v1.11.3
func (Document) PrepareJSONSchema ¶ added in v1.41.0
type FallbackCodeSamples ¶ added in v1.15.1
type FallbackCodeSamples struct {
FallbackCodeSamplesLanguage string `yaml:"fallbackCodeSamplesLanguage,omitempty" required:"true"`
}
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" description:"Comma-separated list of operations to filter" required:"true"` // Comma-separated list of operations to filter
Include *bool `yaml:"include,omitempty" description:"Include the specified operations (mutually exclusive with exclude)"`
Exclude *bool `yaml:"exclude,omitempty" description:"Exclude the specified operations (mutually exclusive with include)"`
}
func (FilterOperationsOptions) ParseOperations ¶ added in v1.27.0
func (f FilterOperationsOptions) ParseOperations() []string
type Java ¶
type Java struct {
OSSRHUsername string `yaml:"ossrhUsername" required:"true"`
OSSHRPassword string `yaml:"ossrhPassword" required:"true"`
GPGSecretKey string `yaml:"gpgSecretKey" required:"true"`
GPGPassPhrase string `yaml:"gpgPassPhrase" required:"true"`
UseSonatypeLegacy bool `yaml:"useSonatypeLegacy,omitempty" required:"true"`
// contains filtered or unexported fields
}
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" description:"Defaults to true. If false, the mock API server will not be started."`
// contains filtered or unexported fields
}
Configuration for mockserver handling during testing.
type NPM ¶
type NPM struct {
Token string `yaml:"token" required:"true"`
// contains filtered or unexported fields
}
type NormalizeOptions ¶ added in v1.29.2
type NormalizeOptions struct {
PrefixItems *bool `yaml:"prefixItems,omitempty"`
}
type Nuget ¶
type Nuget struct {
APIKey string `yaml:"apiKey" required:"true"`
// contains filtered or unexported fields
}
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) PrepareJSONSchema ¶ added in v1.36.2
func (*Overlay) UnmarshalYAML ¶ added in v1.15.3
type Publishing ¶
type Publishing struct {
NPM *NPM `yaml:"npm,omitempty" description:"NPM (Typescript) publishing configuration."`
PyPi *PyPi `yaml:"pypi,omitempty" description:"PyPI (Python)publishing configuration."`
Packagist *Packagist `yaml:"packagist,omitempty" description:"Packagist (PHP) publishing configuration."`
Java *Java `yaml:"java,omitempty" description:"Maven (Java) publishing configuration."`
RubyGems *RubyGems `yaml:"rubygems,omitempty" description:"Rubygems (Ruby) publishing configuration."`
Nuget *Nuget `yaml:"nuget,omitempty" description:"NuGet (C#) publishing configuration."`
Terraform *Terraform `yaml:"terraform,omitempty"`
// contains filtered or unexported fields
}
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" required:"true"`
// contains filtered or unexported fields
}
type RubyGems ¶
type RubyGems struct {
Token string `yaml:"token" required:"true"`
// contains filtered or unexported fields
}
type Source ¶
type Source struct {
Inputs []Document `` /* 138-byte string literal not displayed */
Overlays []Overlay `yaml:"overlays,omitempty" description:"A list of overlay files (OpenAPI Overlay Specification)"`
Transformations []Transformation `yaml:"transformations,omitempty" description:"A list of transformations to apply to the OpenAPI document"`
Output *string `yaml:"output,omitempty" description:"The output file name (optional)"`
Ruleset *string `yaml:"ruleset,omitempty" description:"The linting ruleset to use (optional)"`
Registry *SourceRegistry `yaml:"registry,omitempty" description:"The openapi registry configuration"`
// contains filtered or unexported fields
}
Ensure you 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" description:"The registry location to use (for snapshotting/change tracking)" required:"true"`
Tags []string `yaml:"tags,omitempty" description:"The list of tags to use for the registry"`
// contains filtered or unexported fields
}
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" enum:"csharp,go,java,mcp-typescript,php,python,ruby,swift,terraform,typescript,unity,postman" required:"true"`
Source string `yaml:"source" required:"true"`
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"`
// contains filtered or unexported fields
}
Ensure you update schema/workflow.schema.json on changes
func (Target) CodeSamplesEnabled ¶ added in v1.34.0
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" description:"Defaults to false. If true, the target will be tested as part of the workflow."`
// Configuration for mockserver handling during testing. By default, the
// mockserver is enabled.
MockServer *MockServer `` /* 169-byte string literal not displayed */
// contains filtered or unexported fields
}
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" description:"Remove unused components from the OpenAPI document"`
FilterOperations *FilterOperationsOptions `yaml:"filterOperations,omitempty" description:"Filter operations from the OpenAPI document"`
Cleanup *bool `yaml:"cleanup,omitempty" description:"Clean up the OpenAPI document"`
Format *bool `yaml:"format,omitempty"`
JQSymbolicExecution *bool `yaml:"jqSymbolicExecution,omitempty"`
Normalize *NormalizeOptions `yaml:"normalize,omitempty"`
// contains filtered or unexported fields
}
func (Transformation) Validate ¶ added in v1.27.0
func (t Transformation) Validate() error
type Version ¶ added in v1.10.1
type Version string
func (Version) PrepareJSONSchema ¶ added in v1.36.2
type Workflow ¶
type Workflow struct {
Version string `yaml:"workflowVersion" description:"The version of the workflow schema" const:"1.0.0" required:"true"`
SpeakeasyVersion Version `yaml:"speakeasyVersion,omitempty" description:"The version of the speakeasy CLI"`
Sources map[string]Source `yaml:"sources" description:"A map of source names to source configurations, where the output is an OpenAPI document"`
Targets map[string]Target `` /* 126-byte string literal not displayed */
Dependents map[string]Dependent `` // Currently only used by one customer. Used to make rebuilding dependent SDKs that live elsewhere easier.
/* 152-byte string literal not displayed */
// contains filtered or unexported fields
}
Ensure you update schema/workflow.schema.json on changes