bundle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const ArtifactsSchemaFilename = "schema-artifacts.json"
View Source
const ConnectionsSchemaFilename = "schema-connections.json"
View Source
const ParamsSchemaFilename = "schema-params.json"
View Source
const UISchemaFilename = "schema-ui.json"

Variables

This section is empty.

Functions

func AddSetIDToObjectArrays added in v0.1.0

func AddSetIDToObjectArrays(schema map[string]interface{}) error

func ApplyTransformations

func ApplyTransformations(schema map[string]interface{}, transformations []func(map[string]interface{}) error) error

func DisableAdditionalPropertiesInObjects

func DisableAdditionalPropertiesInObjects(schema map[string]interface{}) error

func Generate added in v0.0.8

func Generate(data *TemplateData) error

func GenerateSchema

func GenerateSchema(schema map[string]interface{}, metadata map[string]string, buffer io.Writer) error

generateSchema generates a specific schema-*.json file

func PackageBundle added in v0.0.3

func PackageBundle(filePath string, buf io.Writer) error

func RunPrompt added in v0.0.8

func RunPrompt(t *TemplateData) error

func UploadToPresignedS3URL

func UploadToPresignedS3URL(url string, object io.Reader) error

Types

type Bundle

type Bundle struct {
	Schema      string                 `json:"schema" yaml:"schema"`
	Name        string                 `json:"name" yaml:"name"`
	Description string                 `json:"description" yaml:"description"`
	Ref         string                 `json:"ref" yaml:"ref"`
	Type        string                 `json:"type" yaml:"type"`
	Access      string                 `json:"access" yaml:"access"`
	Steps       []Step                 `json:"steps" yaml:"steps"`
	Artifacts   map[string]interface{} `json:"artifacts" yaml:"artifacts"`
	Params      map[string]interface{} `json:"params" yaml:"params"`
	Connections map[string]interface{} `json:"connections" yaml:"connections"`
	UI          map[string]interface{} `json:"ui" yaml:"ui"`
}

func Parse

func Parse(path string, overrides map[string]interface{}) (*Bundle, error)

ParseBundle parses a bundle from a YAML file overrides allow the CLI to override specific bundle metadata. This is useful in a CI/CD scenario when you want to change the `access` if you are deploying to a sandbox org.

func (*Bundle) GenerateSchemas

func (b *Bundle) GenerateSchemas(dir string) error

Build generates all bundle files in the given bundle

func (*Bundle) Hydrate

func (b *Bundle) Hydrate(path string, c *client.MassdriverClient) error

func (*Bundle) Metadata

func (b *Bundle) Metadata(schemaType string) map[string]string

Metadata returns common metadata fields for each JSON Schema

func (*Bundle) Publish

func (b *Bundle) Publish(c *client.MassdriverClient) (string, error)

type Overrides added in v0.1.0

type Overrides struct {
	Access string
}

type PublishPost added in v0.1.0

type PublishPost struct {
	Name              string `json:"name"`
	Description       string `json:"description"`
	Type              string `json:"type"`
	Ref               string `json:"ref"`
	Access            string `json:"access"`
	ArtifactsSchema   string `json:"artifacts_schema"`
	ConnectionsSchema string `json:"connections_schema"`
	ParamsSchema      string `json:"params_schema"`
	UISchema          string `json:"ui_schema"`
}

type PublishResponse added in v0.1.0

type PublishResponse struct {
	UploadLocation string `json:"upload_location"`
}

type S3PresignEndpointResponse

type S3PresignEndpointResponse struct {
	Error                 xml.Name `xml:"Error"`
	Code                  string   `xml:"Code"`
	Message               string   `xml:"Message"`
	AWSAccessKeyID        string   `xml:"AWSAccessKeyId"`
	StringToSign          string   `xml:"StringToSign"`
	SignatureProvided     string   `xml:"SignatureProvided"`
	StringToSignBytes     []byte   `xml:"StringToSignBytes"`
	CanonicalRequest      string   `xml:"CanonicalRequest"`
	CanonicalRequestBytes []byte   `xml:"CanonicalRequestBytes"`
	RequestID             string   `xml:"RequestId"`
	HostID                string   `xml:"HostId"`
}

type Step added in v0.1.0

type Step struct {
	Path        string `json:"path" yaml:"path"`
	Provisioner string `json:"provisioner" yaml:"provisioner"`
}

type TemplateData added in v0.0.8

type TemplateData struct {
	Name        string
	Description string
	Access      string
	Type        string
	OutputDir   string
}

Jump to

Keyboard shortcuts

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