hariti

package module
v0.0.1-0...-2b12773 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2017 License: MIT Imports: 15 Imported by: 0

README

License Build Status

go-hariti

TODO Features

cli command
  • hariti get
  • hariti rm
  • hariti list
  • hariti disable
  • hariti enable
jsonrpc via pipe
  • initialize(config)
  • get(config)
  • rm(config)
  • list(config)
  • disable(config)
  • enable(config)
Need consideration
  • create and install by lockfile (aka version lock)
  • multiple plugin set, and switch it
  • generate high speed vim script

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrWriterFromContext

func ErrWriterFromContext(ctx context.Context) io.Writer

func MarshalBundles

func MarshalBundles(w io.Writer, bundles Bundles) error

func RegisterVCS

func RegisterVCS(vcs VCS)

func WithErrWriter

func WithErrWriter(parent context.Context, w io.Writer) context.Context

func WithLogger

func WithLogger(parent context.Context, logger Logger) context.Context

func WithWriter

func WithWriter(parent context.Context, w io.Writer) context.Context

func WriterFromContext

func WriterFromContext(ctx context.Context) io.Writer

Types

type BuildScript

type BuildScript struct {
	Windows string `yaml:"windows"`
	Mac     string `yaml:"mac"`
	Linux   string `yaml:"linux"`
	All     string `yaml:"all"`
}

type Bundle

type Bundle interface {
	GetName() string
	GetLocalPath() string
	GetAliases() []string
}

type Bundles

type Bundles []Bundle

func UnmarshalBundles

func UnmarshalBundles(r io.Reader) (Bundles, error)

func (*Bundles) UnmarshalYAML

func (self *Bundles) UnmarshalYAML(unmarshal func(interface{}) error) error

type BundlesFile

type BundlesFile struct {
	Version string  `yaml:"version"`
	Bundles Bundles `yaml:"bundles"`
}

type Hariti

type Hariti struct {
	Logger Logger
	// contains filtered or unexported fields
}

func NewHariti

func NewHariti(config *HaritiConfig) *Hariti

func (*Hariti) AddAlias

func (self *Hariti) AddAlias(repository string, alias string) error

func (*Hariti) AddDependency

func (self *Hariti) AddDependency(repository string, dependency string) error

func (*Hariti) ClearAlias

func (self *Hariti) ClearAlias(repository string) error

func (*Hariti) ClearDependencies

func (self *Hariti) ClearDependencies(repository string) error

func (*Hariti) CreateBundle

func (self *Hariti) CreateBundle(repository string) (Bundle, error)

func (*Hariti) DeployDir

func (self *Hariti) DeployDir() string

func (*Hariti) Disable

func (self *Hariti) Disable(repository string) error

func (*Hariti) Enable

func (self *Hariti) Enable(repository string) error

func (*Hariti) EnableIf

func (self *Hariti) EnableIf(repository string, expr string) error

func (*Hariti) Get

func (self *Hariti) Get(ctx context.Context, repository string, update bool, enabled bool) error

func (*Hariti) IsEnabled

func (self *Hariti) IsEnabled(bundle Bundle) bool

func (*Hariti) List

func (self *Hariti) List() ([]Bundle, error)

func (*Hariti) MetaDir

func (self *Hariti) MetaDir() string

func (*Hariti) Remove

func (self *Hariti) Remove(repository string, force bool) error

func (*Hariti) RemoveAlias

func (self *Hariti) RemoveAlias(repository string, alias string) error

func (*Hariti) RemoveDependency

func (self *Hariti) RemoveDependency(repository string, dependency string) error

func (*Hariti) RepositoriesDir

func (self *Hariti) RepositoriesDir() string

func (*Hariti) SetupManagedDirectory

func (self *Hariti) SetupManagedDirectory() error

func (*Hariti) WriteScript

func (self *Hariti) WriteScript(w io.Writer, header []string) error

type HaritiConfig

type HaritiConfig struct {
	Directory string
	Writer    io.Writer
	ErrWriter io.Writer
	Verbose   bool
}

type LocalBundle

type LocalBundle struct {
	// name
	Name string `yaml:"-"`
	// aliases
	Aliases []string `yaml:"-"`
	// path
	LocalPath string `yaml:"path"`
}

func (*LocalBundle) GetAliases

func (self *LocalBundle) GetAliases() []string

func (*LocalBundle) GetLocalPath

func (self *LocalBundle) GetLocalPath() string

func (*LocalBundle) GetName

func (self *LocalBundle) GetName() string

type Logger

type Logger interface {
	WithPrefix(string) Logger

	Debug(...interface{})
	Debugf(string, ...interface{})
	Info(...interface{})
	Infof(string, ...interface{})
	Warn(...interface{})
	Warnf(string, ...interface{})
	Error(...interface{})
	Errorf(string, ...interface{})
	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Panic(...interface{})
	Panicf(string, ...interface{})
}

func LoggerFromContextKey

func LoggerFromContextKey(ctx context.Context) Logger

func NewStdLogger

func NewStdLogger(w io.Writer) Logger

type RemoteBundle

type RemoteBundle struct {
	// name
	Name string `yaml:"name"`
	// repository url
	URL *url.URL `yaml:"url"`
	// local directory path
	LocalPath string
	// aliases
	Aliases []string `yaml:"aliases"`
	// dependencies
	Dependencies []*RemoteBundle `yaml:"dependencies"`
	// vim expr
	EnableIfExpr string `yaml:"enable-if"`
	// build script
	BuildScript *BuildScript `yaml:"build"`
}

func (*RemoteBundle) GetAliases

func (self *RemoteBundle) GetAliases() []string

func (*RemoteBundle) GetLocalPath

func (self *RemoteBundle) GetLocalPath() string

func (*RemoteBundle) GetName

func (self *RemoteBundle) GetName() string

func (*RemoteBundle) MarshalYAML

func (self *RemoteBundle) MarshalYAML() (interface{}, error)

type VCS

type VCS interface {
	CanHandle(c context.Context, u *url.URL) bool
	Clone(c context.Context, bundle *RemoteBundle, update bool) error
	IsModified(c context.Context, bundle *RemoteBundle) (bool, error)
}

func DetectVCS

func DetectVCS(u *url.URL) VCS

Directories

Path Synopsis
cmd
encoding
vcs
git

Jump to

Keyboard shortcuts

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