modules

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// STDRepo is the default module repository
	STDRepo = "build.antipy.com/std"

	// NoRepositorySpecified is when you dont pass the -m flag
	NoRepositorySpecified = ""
)

Variables

View Source
var (
	//ErrNotExist means the module does not exist in the repository
	ErrNotExist = errors.NewError("module does not exist in the repository", 1)
	//ErrNoLatestSpecified means the module binary download failed
	ErrNoLatestSpecified = errors.NewError("the module repository did not specify a latest version", 2)
	//ErrFailedModuleBinaryDownload means the module binary download failed
	ErrFailedModuleBinaryDownload = errors.NewError("failed downloading module binary from repository server", 3)
	//ErrUnkownSourceRepositoryType means that source repository type was not recognized
	ErrUnkownSourceRepositoryType = errors.NewError("source repository code is unknown", 10)
	//ErrFailedGitRepositoryDownload means that the git repository could not be cloned
	ErrFailedGitRepositoryDownload = errors.NewError("failed to clone the git repository", 11)
	//ErrFailedModuleBuild means that the module could not be built
	ErrFailedModuleBuild = errors.NewError("failed to build the module from repository source", 21)
	//ErrFailedModuleRepositoryDownload means the module repository list download failed
	ErrFailedModuleRepositoryDownload = errors.NewError("failed downloading the module repository list", 22)
	//ErrFailedGlobalConfigLoad means loading the global config failed
	ErrFailedGlobalConfigLoad = errors.NewError("failed to load global config", 31)
)
View Source
var (

	//ErrModuleFailedStarting means a module failed to start
	ErrModuleFailedStarting = errors.NewError("module failed to start", 1)
	//ErrModuleFailedObtainStdin means we could not obtain stdin
	ErrModuleFailedObtainStdin = errors.NewError("failed to obtain stdin", 2)
	//ErrModuleFailedObtainStdout means we could not obtain stdout
	ErrModuleFailedObtainStdout = errors.NewError("failed to obtain stdout", 3)
	//ErrModuleFailedObtainFunctions means we could not obtain the registered functions
	ErrModuleFailedObtainFunctions = errors.NewError("failed to obtain registered functions", 4)
	//ErrModuleFailedConfigure means we could not configure module
	ErrModuleFailedConfigure = errors.NewError("failed to configure module", 5)
)
View Source
var InternalModules = map[string]internalMod{
	"file": internalMod{
		// contains filtered or unexported fields
	},
	"json": internalMod{
		// contains filtered or unexported fields
	},
	"language": internalMod{
		// contains filtered or unexported fields
	},
	"markdown": internalMod{
		// contains filtered or unexported fields
	},
	"math": internalMod{
		// contains filtered or unexported fields
	},
	"noescape": internalMod{
		// contains filtered or unexported fields
	},
	"util": internalMod{
		// contains filtered or unexported fields
	},
	"yaml": internalMod{
		// contains filtered or unexported fields
	},
}

InternalModules that the are integrated into the antibuild binary

Functions

func InstallModule added in v0.13.0

func InstallModule(name string, version string, repoURL string, filePrefix string) (*config.Module, errors.Error)

InstallModule installs a module

func LoadModule added in v0.5.4

func LoadModule(moduleRoot string, identifier string, meta *config.Module, moduleHost map[string]*host.ModuleHost, cfg map[string]interface{}, log host.Logger) errors.Error

LoadModule Loads a specific module and is menth for hotloading, this should not be used for initial setup. For initial setup use LoadModules.

func LoadModules

func LoadModules(moduleRoot string, modules config.Modules, log host.Logger) (moduleHost map[string]*host.ModuleHost, err errors.Error)

LoadModules communicates with modules to load them. Although this should be used for initial setup, for hoatloading modules use LoadModule.

Types

type ModuleEntry added in v0.13.0

type ModuleEntry struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Source      struct {
		Type         string `json:"type"`
		URL          string `json:"url"`
		SubDirectory string `json:"subdirectory"`
	} `json:"source"`
	CompiledStatic  map[string]map[string]map[string]string `json:"compiled_static"`
	CompiledDynamic struct {
		URL          string              `json:"url"`
		Vesions      []string            `json:"versions"`
		OSArchCombos map[string][]string `json:"os_arch_combos"`
	} `json:"compiled_dynamic"`
	LatestVersion string `json:"latest"`
}

ModuleEntry is a single entry for a module repository file

func (ModuleEntry) Install added in v0.13.0

func (me ModuleEntry) Install(version string, targetFile string) (string, errors.Error)

Install installs a module from a module entry

type ModuleRepository added in v0.13.0

type ModuleRepository map[string]ModuleEntry

ModuleRepository is a repository for modules

func (*ModuleRepository) Download added in v0.13.0

func (m *ModuleRepository) Download(url string) errors.Error

Download downloads a json file into a module repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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