session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(s *Session) string

Dump marshals the session as JSON.

Types

type PathUndo

type PathUndo struct {
	Env  map[string]string // Environment vars to restore
	Path map[string]bool   // Paths to remove from PATH
}

PathUndo describes the actions to undo for a single path

func NewPathUndo

func NewPathUndo() *PathUndo

NewPathUndo created a new PathUndo

type PathUndoList

type PathUndoList []*PathUndo

PathUndoList is a slice of PathUndo

type Session

type Session struct {
	Path string
	Undo map[string]*PathUndo
}

Session describes an envy session

func Load

func Load(data string) *Session

Load loads a previously marshaled session.

func New

func New() *Session

New creates a Session object.

func (*Session) PathUndoList

func (s *Session) PathUndoList() PathUndoList

PathUndoList returns a list of all the current PathUndo instances, sorted by path ToUndoFor returns a list of action to undo for a new working dir, and removes the items from the session.

func (*Session) ToUndoFor

func (s *Session) ToUndoFor(p string) PathUndoList

ToUndoFor returns a list of action to undo for a new working dir, and removes the items from the session.

func (*Session) UndoFor

func (s *Session) UndoFor(p string) *PathUndo

UndoFor returns the PathUndo for a directory

Jump to

Keyboard shortcuts

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