Documentation ¶
Index ¶
- Constants
- Variables
- func InstallModule(name string, version string, repoURL string, filePrefix string) (*config.Module, errors.Error)
- func LoadModule(moduleRoot string, identifier string, meta *config.Module, ...) errors.Error
- func LoadModules(moduleRoot string, modules config.Modules, log host.Logger) (moduleHost map[string]*host.ModuleHost, err errors.Error)
- type ModuleEntry
- type ModuleRepository
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.
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
type ModuleRepository ¶ added in v0.13.0
type ModuleRepository map[string]ModuleEntry
ModuleRepository is a repository for modules
Click to show internal directories.
Click to hide internal directories.