conda

package
v0.0.0-...-9fce2f1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = errors.New("forbidden")

Functions

This section is empty.

Types

type Client

type Client interface {
	// Open opens a conda env as a session, if the env
	// does not exist, create it and install needed deps.
	Open(string, ...string) (Session, error)
	// List lists all envs. Like `conda env list`
	List() ([]string, error)
	// Close blocks until all sessions are closed.
	Close() error
}

func NewClient

func NewClient(opts ...Option) Client

type Dep

type Dep struct {
	Name    string
	Version string
}

type Option

type Option func(*Options)

func Args

func Args(args ...string) Option

func Deps

func Deps(deps ...string) Option

func Env

func Env(env ...string) Option

func LiveStream

func LiveStream() Option

func Quiet

func Quiet() Option

func Reader

func Reader(r io.Reader) Option

func Writer

func Writer(w io.Writer) Option

type Options

type Options struct {
	Env   []string // env variable pairs
	Args  []string // e.g. --foo bar
	Deps  []string // e.g. python=3.9 numpy=1.2.10
	Quiet bool
	Live  bool

	Writer io.Writer
	Reader io.Reader
}

type Session

type Session interface {
	// Sync synchronizes dependencies.
	Sync(...Option) error
	// Exec executes a command
	Exec(string, ...Option) (*Task, error)
	// Wait blocks until all task are done
	Wait()
}

type State

type State int
const (
	Pending State = iota + 1
	Active
	Exited
)

type Task

type Task struct {
	Stdout io.Reader
	Stderr io.Reader
	Stdin  io.Writer
	// contains filtered or unexported fields
}

func (Task) Err

func (t Task) Err() error

func (*Task) Kill

func (t *Task) Kill() error

func (Task) State

func (t Task) State() State

Jump to

Keyboard shortcuts

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