packages

package
v0.0.0-...-3e883f0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

The packages package handles lime package management.

The key idea of lime packages is modularity/optionality. The core backend shouldn't know about tmbundle nor sublime-package, but rather it should make it possible to use these and other variants. @quarnster Ideally packages implemented in such a way that we can just do: import ( _ "github.com/limetext/lime/backend/textmate" _ "github.com/limetext/lime/backend/sublime" _ "github.com/limetext/lime/backend/emacs" )

Package type

Each plugin or package that wants to communicate with backend should implement this interface.

Record type

For enabling lime to detect and load a package it should register itself as a Record

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJSON

func LoadJSON(path string, marshal json.Unmarshaler) error

Won't return the json type itself just watch & load

func Register

func Register(r *Record)

func Scan

func Scan(dir string)

func UnLoad

func UnLoad(name string)

func Unregister

func Unregister(r *Record)

Types

type JSON

type JSON struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Helper type for loading json files(e.g keymaps settings)

func NewJSON

func NewJSON(path string, marshal json.Unmarshaler) *JSON

func (*JSON) FileChanged

func (j *JSON) FileChanged(name string)

func (*JSON) FileCreated

func (j *JSON) FileCreated(name string)

func (*JSON) FileRemoved

func (j *JSON) FileRemoved(name string)

func (*JSON) Load

func (j *JSON) Load()

func (*JSON) Name

func (j *JSON) Name() string

func (*JSON) Path

func (j *JSON) Path() string

func (*JSON) UnLoad

func (j *JSON) UnLoad()

type Package

type Package interface {
	Load()
	UnLoad()
	Name() string
	Path() string
}

Defines the functionality each package needs to implement so the backend could manage the loading watching and etc

type Record

type Record struct {
	Check  func(string) bool
	Action func(string) Package
}

We will register each package as a record, Check function for checking if the path suits for the registered package an Action function for creating package from the path

Jump to

Keyboard shortcuts

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