common

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2016 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// SchemaVersion contains the schema version.
	SchemaVersion string `yaml:"schema_version"`
}

Base is the common struct that all schemas must have.

func (Base) GetSchemaVersion

func (b Base) GetSchemaVersion() string

GetSchemaVersion is a simple getter function of the schema version.

type BaseSchema

type BaseSchema interface {
	Parse(data []byte) error
	GetSchemaVersion() string
	GetResources(string, string, *ConfigWorker) error
}

BaseSchema is an interface that every schema should implement.

type ConfigWorker

type ConfigWorker struct {
	Parser      SchemaParser
	Downloader  EntryDownloader
	ResourceMap mapset.MapSet
	FSUtil      fs.Util
}

ConfigWorker is a container of all COMMON things needed to do work on the configs.

type Entry

type Entry struct {
	URL      string `yaml:"url"`
	Revision string `yaml:"revision"`
	Path     string `yaml:"path"`
}

Entry is a generic holder for handling the specific location and revision of a resource.

func (Entry) GetConfigFile

func (e Entry) GetConfigFile() string

GetConfigFile is a getter for the config file name. Will return DefaultConfigYaml value if none has been set.

type EntryDownloader

type EntryDownloader interface {
	DownloadEntry(Entry, string) error
}

EntryDownloader is a generic interface for how to download entries.

func NewVCSDownloader

func NewVCSDownloader() EntryDownloader

NewVCSDownloader is a constructor for downloading entries using VCS methods.

type SchemaParser

type SchemaParser interface {
	ParseV1_0_0(data []byte) (BaseSchema, error)
}

SchemaParser is a generic interface that knows how parse different schema_versions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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