conda

package
v0.0.0-...-f35d6a9 Latest Latest
Warning

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

Go to latest
Published: May 13, 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, error)

type ExecOption

type ExecOption func(*ExecOptions)

func ExecArgs

func ExecArgs(args ...string) ExecOption

func ExecEnv

func ExecEnv(env ...string) ExecOption

func ExecLiveStream

func ExecLiveStream() ExecOption

type ExecOptions

type ExecOptions struct {
	Args       []string
	Env        []string
	LiveStream bool
}

type Option

type Option func(*Options)

func Stderr

func Stderr(w io.Writer) Option

func Stdin

func Stdin(r io.Reader) Option

func Stdio

func Stdio(stdout, stderr io.Writer, stdin io.Reader) Option

func Stdout

func Stdout(w io.Writer) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

type Session

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

type SyncOption

type SyncOption func(*SyncOptions)

func SyncDeps

func SyncDeps(deps ...string) SyncOption

func SyncLiveStream

func SyncLiveStream() SyncOption

type SyncOptions

type SyncOptions struct {
	Deps       []string
	LiveStream bool
}

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() TaskState

type TaskState

type TaskState int
const (
	Running TaskState = iota + 1
	Exited
)

Jump to

Keyboard shortcuts

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