repository

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseRepositoryConfig string

Functions

This section is empty.

Types

type Config

type Config struct {
	RepositoryRoot  string `json:"repository_root"`
	Namespace       string `json:"namespace"`
	OutputDirectory string `json:"output_dir"`
}

Config stores information about the repository location

type Repository

type Repository struct {
	Root      string
	Namespace string
	Output    string
	Schemas   []*Schema
}

Repository is a group of schemas

func GetRepository

func GetRepository() (*Repository, error)

GetRepository returns the Repository described by the repository.cue file in the current directory

func NewRepository

func NewRepository(namespace, output, root string) (*Repository, error)

NewRepository creates a new repository root and writes the metadata information

func (*Repository) AddSchema

func (r *Repository) AddSchema(name string) error

AddSchema creates a new directory for a schema and creates the first version of the schema.

func (*Repository) AddVersion

func (r *Repository) AddVersion(schema string) error

AddVersion creates a new version for the specified schema

func (*Repository) Build

func (r *Repository) Build() error

Build serializes the Repository object into a json file in the `Output` directory.

type Schema

type Schema struct {
	Namespace string
	Name      string
	Versions  []*Version
}

Schema is a definition of a set of related models

type Version

type Version struct {
	Namespace  string
	Name       string
	Schema     string
	Definition string
}

Version represents a version of a schema

Jump to

Keyboard shortcuts

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