Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfigChecksum(dir string, opts ...Option) (string, error)
- func GetTemplateVersion(dir, target string, opts ...Option) (string, error)
- func SaveConfig(dir string, cfg *Configuration, opts ...Option) error
- func SaveLockFile(dir string, lockFile *LockFile, opts ...Option) error
- type Config
- type Configuration
- type DevContainers
- type Fixes
- type Force
- type GenerateOn
- type GenerateWorkflow
- type Generation
- type GetLanguageDefaultFunc
- type Inputs
- type Job
- type Jobs
- type LanguageConfig
- type LockFile
- type Management
- type Option
- type OptionalPropertyRenderingOption
- type Permissions
- type PublishOn
- type PublishWorkflow
- type Push
- type ReadFileFunc
- type SDKGenConfigField
- type Schedule
- type TransformerFunc
- type UpgradeFunc
- type UsageSnippets
- type WorkflowDispatch
- type WriteFileFunc
Constants ¶
View Source
const ( Version = v2 GithubWritePermission = "write" // Constants to be used as keys in the config files Languages = "languages" Mode = "mode" GithubAccessToken = "github_access_token" SpeakeasyApiKey = "speakeasy_api_key" SpeakeasyServerURL = "speakeasy_server_url" OpenAPIDocAuthHeader = "openapi_doc_auth_header" OpenAPIDocAuthToken = "openapi_doc_auth_token" OpenAPIDocs = "openapi_docs" )
Variables ¶
View Source
var ErrFailedUpgrade = errors.New("failed to upgrade config")
View Source
var ErrNotFound = errors.New("could not find gen.yaml")
Functions ¶
func GetConfigChecksum ¶ added in v1.5.0
func GetTemplateVersion ¶ added in v1.6.1
func SaveConfig ¶ added in v1.5.0
func SaveConfig(dir string, cfg *Configuration, opts ...Option) error
Types ¶
type Config ¶
type Config struct { Config *Configuration LockFile *LockFile }
type Configuration ¶ added in v1.5.0
type Configuration struct { ConfigVersion string `yaml:"configVersion"` Generation Generation `yaml:"generation"` Languages map[string]LanguageConfig `yaml:",inline"` New map[string]bool `yaml:"-"` }
func GetDefaultConfig ¶
func GetDefaultConfig(newSDK bool, getLangDefaultFunc GetLanguageDefaultFunc, langs map[string]bool) (*Configuration, error)
func (*Configuration) GetGenerationFieldsMap ¶ added in v1.5.0
func (c *Configuration) GetGenerationFieldsMap() (map[string]any, error)
type DevContainers ¶ added in v0.8.2
type DevContainers struct { Enabled bool `yaml:"enabled"` // This can be a local path or a remote URL SchemaPath string `yaml:"schemaPath"` AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility }
type GenerateOn ¶ added in v0.4.2
type GenerateOn struct { WorkflowDispatch WorkflowDispatch `yaml:"workflow_dispatch"` Schedule []Schedule `yaml:"schedule,omitempty"` }
type GenerateWorkflow ¶ added in v0.4.2
type GenerateWorkflow struct { Name string `yaml:"name"` Permissions Permissions `yaml:"permissions"` On GenerateOn `yaml:"on"` Jobs Jobs `yaml:"jobs"` }
type Generation ¶
type Generation struct { DevContainers *DevContainers `yaml:"devContainers,omitempty"` BaseServerURL string `yaml:"baseServerUrl,omitempty"` SDKClassName string `yaml:"sdkClassName,omitempty"` MaintainOpenAPIOrder bool `yaml:"maintainOpenAPIOrder,omitempty"` UsageSnippets *UsageSnippets `yaml:"usageSnippets,omitempty"` UseClassNamesForArrayFields bool `yaml:"useClassNamesForArrayFields,omitempty"` Fixes *Fixes `yaml:"fixes,omitempty"` AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility }
type GetLanguageDefaultFunc ¶
type GetLanguageDefaultFunc func(string, bool) (*LanguageConfig, error)
type LanguageConfig ¶
type LockFile ¶ added in v1.5.0
type LockFile struct { LockVersion string `yaml:"lockVersion"` ID string `yaml:"id"` Management Management `yaml:"management"` Features map[string]map[string]string `yaml:"features,omitempty"` GeneratedFiles []string `yaml:"generatedFiles,omitempty"` AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility }
func NewLockFile ¶ added in v1.5.0
func NewLockFile() *LockFile
type Management ¶
type Management struct { DocChecksum string `yaml:"docChecksum,omitempty"` DocVersion string `yaml:"docVersion,omitempty"` SpeakeasyVersion string `yaml:"speakeasyVersion,omitempty"` GenerationVersion string `yaml:"generationVersion,omitempty"` ReleaseVersion string `yaml:"releaseVersion,omitempty"` ConfigChecksum string `yaml:"configChecksum,omitempty"` RepoURL string `yaml:"repoURL,omitempty"` RepoSubDirectory string `yaml:"repoSubDirectory,omitempty"` InstallationURL string `yaml:"installationURL,omitempty"` Published bool `yaml:"published,omitempty"` AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility }
type Option ¶
type Option func(*options)
func WithFileSystemFuncs ¶
func WithFileSystemFuncs(rf ReadFileFunc, wf WriteFileFunc) Option
func WithLanguageDefaultFunc ¶
func WithLanguageDefaultFunc(f GetLanguageDefaultFunc) Option
func WithLanguages ¶ added in v0.0.4
func WithTransformerFunc ¶ added in v0.8.4
func WithTransformerFunc(f TransformerFunc) Option
func WithUpgradeFunc ¶ added in v0.0.2
func WithUpgradeFunc(f UpgradeFunc) Option
type OptionalPropertyRenderingOption ¶ added in v1.2.0
type OptionalPropertyRenderingOption string
const ( OptionalPropertyRenderingOptionAlways OptionalPropertyRenderingOption = "always" OptionalPropertyRenderingOptionNever OptionalPropertyRenderingOption = "never" OptionalPropertyRenderingOptionWithExample OptionalPropertyRenderingOption = "withExample" )
type Permissions ¶ added in v0.4.2
type PublishWorkflow ¶ added in v0.4.2
type ReadFileFunc ¶
type SDKGenConfigField ¶ added in v1.0.0
type SDKGenConfigField struct { Name string `yaml:"name" json:"name"` Required bool `yaml:"required" json:"required"` RequiredForPublishing *bool `yaml:"requiredForPublishing,omitempty" json:"required_for_publishing,omitempty"` DefaultValue *any `yaml:"defaultValue,omitempty" json:"default_value,omitempty"` Description *string `yaml:"description,omitempty" json:"description,omitempty"` Language *string `yaml:"language,omitempty" json:"language,omitempty"` SecretName *string `yaml:"secretName,omitempty" json:"secret_name,omitempty"` ValidationRegex *string `yaml:"validationRegex,omitempty" json:"validation_regex,omitempty"` ValidationMessage *string `yaml:"validationMessage,omitempty" json:"validation_message,omitempty"` TestValue *any `yaml:"testValue,omitempty" json:"test_value,omitempty"` }
func GetGenerationDefaults ¶ added in v1.0.0
func GetGenerationDefaults(newSDK bool) []SDKGenConfigField
type TransformerFunc ¶ added in v0.8.4
type UpgradeFunc ¶
type UsageSnippets ¶ added in v1.2.0
type UsageSnippets struct { OptionalPropertyRendering OptionalPropertyRenderingOption `yaml:"optionalPropertyRendering"` AdditionalProperties map[string]any `yaml:",inline"` // Captures any additional properties that are not explicitly defined for backwards/forwards compatibility }
type WorkflowDispatch ¶ added in v0.4.2
type WorkflowDispatch struct {
Inputs Inputs `yaml:"inputs"`
}
Click to show internal directories.
Click to hide internal directories.