schema

package
v1.0.0-rc18 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const FileTag = ":file"

FileTag indicates the link should "use" the input file as source

View Source
const SingleFileTag = ":single"

SingleFileTag is a magic key indicating that a directory is actually a single file

Variables

View Source
var ErrBadJsonSchema = errors.New("json schema is not valid")

ErrBadJsonSchema indicates json schema is invalid

View Source
var ErrEmptySchema = errors.New("schema does not create any files")

ErrEmptySchema indicates a schema is empty

View Source
var ErrFileValidationFailed = errors.New("file failed schema validation")

ErrFileValidationFailed indicates dag schema validation failed

View Source
var ErrLinkOrderNotSolvable = errors.New("link order is not solvable")

ErrLinkOrderNotSolvable

View Source
var ErrMissingJsonSchema = errors.New("json mill requires a json schema")

ErrMissingJsonSchema indicates json schema is missing

View Source
var ErrSchemaInvalidMill = errors.New("schema contains an invalid mill")

ErrSchemaInvalidMill indicates a schema has an invalid mill entry

Functions

func LinkByName

func LinkByName(links []*ipld.Link, name string) *ipld.Link

LinkByName find a link w/ the given name in the provided list

func ValidateMill

func ValidateMill(mill string) bool

ValidateMill is false if mill is not one of the built in tags

Types

type Link struct {
	Use        string                 `json:"use,omitempty"`
	Pin        bool                   `json:"pin"`
	Plaintext  bool                   `json:"plaintext"`
	Mill       string                 `json:"mill,omitempty"`
	Opts       map[string]string      `json:"opts,omitempty"`
	JsonSchema map[string]interface{} `json:"json_schema,omitempty"`
}

Link is a sub-node which can "use" input from other sub-nodes

type Node

type Node struct {
	Name       string                 `json:"name,omitempty"`
	Pin        bool                   `json:"pin"`
	Plaintext  bool                   `json:"plaintext"`
	Mill       string                 `json:"mill,omitempty"`
	Opts       map[string]string      `json:"opts,omitempty"`
	JsonSchema map[string]interface{} `json:"json_schema,omitempty"`
	Links      map[string]*Link       `json:"links,omitempty"`
}

Node describes a DAG node

type Step

type Step struct {
	Name string
	Link *Link
}

Step is an ordered name-link pair

func Steps

func Steps(links map[string]*Link) ([]Step, error)

Steps returns link steps in the order they should be processed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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