schema

package
v0.0.0-...-59b38b2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComposeConfigFilename        = "compose_config"
	ComposeConfigLinkDstFilename = ".env"
	ComposeNameKey               = "COMPOSE_NAME"
)
View Source
const (
	DockerComposeFileName        = "docker-compose.yml"
	DockerComposeVolumeDelimiter = ":"
)
View Source
const (
	SeedFilename                = "seed.yml"
	DevContainerFileName string = "devcontainer.json"
)
View Source
const (
	SkeletonFilename    = "skeleton.yml"
	DockerFileDirectory = "./docker"
)
View Source
const (
	COMMON_COLLECTION_NAME_KEY               = "common"
	ARGUMENTS_KEY                            = "arguments"
	VSCODE_DEVCONTAINER_KEY                  = ARGUMENTS_KEY + ".vscode_devcontainer"
	DEVCONTAINER_PROJECT_NAME_KEY            = VSCODE_DEVCONTAINER_KEY + ".project_name"
	DEVCONTAINER_ATTACH_SERVICE_KEY          = VSCODE_DEVCONTAINER_KEY + ".attach_service"
	DEVCONTAINER_SOURCE_PATH_KEY             = VSCODE_DEVCONTAINER_KEY + ".source_path"
	DOCKER_COMPOSE_KEY                       = ARGUMENTS_KEY + ".docker_compose"
	DOCKER_COMPOSE_PROJECT_PREFIX_KEY        = DOCKER_COMPOSE_KEY + ".project_prefix"
	DOCKER_COMPOSE_FILES_KEY                 = DOCKER_COMPOSE_KEY + ".files"
	VSCODE_EXTENSION_VOLUMES_KEY             = DOCKER_COMPOSE_KEY + ".vscode_extension_volumes"
	VSCODE_NORMAL_EXTENSION_VOLUME_NAME_KEY  = VSCODE_EXTENSION_VOLUMES_KEY + ".normal"
	VSCODE_INSIDER_EXTENSION_VOLUME_NAME_KEY = VSCODE_EXTENSION_VOLUMES_KEY + ".insider"
)

TODO: rename const names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments yaml.Node

func (*Arguments) GetAttachServiceName

func (self *Arguments) GetAttachServiceName() (string, error)

func (*Arguments) GetKey

func (self *Arguments) GetKey() *yaml.Node

func (*Arguments) UnmarshalYAML

func (self *Arguments) UnmarshalYAML(n *yaml.Node) error

type Collection

type Collection struct {
	Name string `yaml:"name,omitempty"`
	Path string `yaml:"path"`
	// TODO: default value is false
	NoCompose bool `yaml:"no_compose"`
}

type Collections

type Collections struct {
	Path string       `yaml:"path"`
	List []Collection `yaml:"list"`
}

type Configs

type Configs struct {
	VSCodeDevcontainer yaml.Node `yaml:"vscode_devcontainer"`
	DockerCompose      yaml.Node `yaml:"docker_compose,omitempty"`
}

type DockerCompose

type DockerCompose struct {
	Version  string                          `yaml:"version"`
	Services map[string]DockerComposeService `yaml:"services"`
	Volumes  DockerComposeRootVolume         `yaml:"volumes,omitempty"`
}

func ConvertDockerComposeYamlToStruct

func ConvertDockerComposeYamlToStruct(root *yaml.Node) (*DockerCompose, error)

func (*DockerCompose) ConvertRelPathToAbs

func (self *DockerCompose) ConvertRelPathToAbs(dirPath string) (*DockerCompose, error)

func (*DockerCompose) Write

func (self *DockerCompose) Write(dirPath string) error

type DockerComposeConfig

type DockerComposeConfig struct {
	ComposeName string
}

func CreateComposeConfig

func CreateComposeConfig(composeName string) *DockerComposeConfig

func (*DockerComposeConfig) GetFilepath

func (self *DockerComposeConfig) GetFilepath(dirPath string) string

func (*DockerComposeConfig) Write

func (self *DockerComposeConfig) Write(dirPath string) error

type DockerComposeRootVolume

type DockerComposeRootVolume map[string]map[string]interface{}

type DockerComposeService

type DockerComposeService struct {
	Build      DockerComposeServiceBuild    `yaml:"build,omitempty"`
	WorkingDir string                       `yaml:"working_dir,omitempty"`
	Volumes    []DockerComposeServiceVolume `yaml:"volumes,omitempty"`
	EntryPoint string                       `yaml:"entrypoint,omitempty"`
	Command    string                       `yaml:"command,omitempty"`
	User       string                       `yaml:"user,omitempty"`
}

type DockerComposeServiceBuild

type DockerComposeServiceBuild struct {
	Context    string   `yaml:"context,omitempty"`
	Dockerfile string   `yaml:"dockerfile,omitempty"`
	Args       []string `yaml:"args,omitempty"`
	Target     string   `yaml:"target,omitempty"`
}

type DockerComposeServiceVolume

type DockerComposeServiceVolume string

type Seed

type Seed struct {
	Version   string    `yaml:"version"`
	Variables yaml.Node `yaml:"variables"`
	Configs   Configs   `yaml:"configs"`
}

func GetCommonSeedData

func GetCommonSeedData(variables *yaml.Node) (*Seed, error)

func LoadSeed

func LoadSeed(dirPath string) (*Seed, error)

func (*Seed) FilterDockerCompose

func (self *Seed) FilterDockerCompose()

func (*Seed) GetComposeProjectPrefix

func (self *Seed) GetComposeProjectPrefix() (string, error)

func (*Seed) WriteDevcontainer

func (self *Seed) WriteDevcontainer(dirPath string) error

func (*Seed) WriteDockerCompose

func (self *Seed) WriteDockerCompose(dirPath string) error

func (*Seed) WriteToFile

func (self *Seed) WriteToFile(dirPath string) error

type Skeleton

type Skeleton struct {
	Version     string      `yaml:"version"`
	Arguments   Arguments   `yaml:"arguments"`
	Collections Collections `yaml:"collections"`
}

func LoadSkeleton

func LoadSkeleton(dirPath string) (*Skeleton, error)

Jump to

Keyboard shortcuts

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