wd

package
v0.0.0-...-0018a20 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package wd GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir struct {
	// current work dir
	WorkDir wd.WorkDir `json:"wd"`
	// path related from current work dir
	Path string `json:"path"`
}

func (Dir) RuntimeDoc

func (v Dir) RuntimeDoc(names ...string) ([]string, bool)

type Local

type Local struct {
	task.Task

	// related dir on the root of project
	Source string `json:"source" default:"."`

	// the local workdir
	WorkDir WorkDir `json:"-" output:"dir"`
}

Local create a local workdir

func (*Local) Do

func (local *Local) Do(ctx context.Context) error

func (Local) RuntimeDoc

func (v Local) RuntimeDoc(names ...string) ([]string, bool)

type Platform

type Platform struct {
	OS           string `json:"os"`
	Architecture string `json:"arch"`
}

func (Platform) RuntimeDoc

func (v Platform) RuntimeDoc(names ...string) ([]string, bool)

type Rel

type Rel struct {
	task.Task

	BaseDir   WorkDir `json:"baseDir"`
	TargetDir WorkDir `json:"targetDir"`

	Path string `json:"-" output:"path"`
}

Rel to get related path between two dirs

func (*Rel) Do

func (t *Rel) Do(ctx context.Context) error

func (Rel) RuntimeDoc

func (v Rel) RuntimeDoc(names ...string) ([]string, bool)

type Release

type Release struct {
	// OS name
	Name string `json:"name"`
	// OS Version
	Version string `json:"version,omitempty"`
	// OS id, like `ubuntu` `windows`
	ID string `json:"id"`
	// if os is based on some upstream
	// like debian when id is `ubuntu`
	IDLike string `json:"id_like,omitempty"`
}

func (Release) RuntimeDoc

func (v Release) RuntimeDoc(names ...string) ([]string, bool)

type SSH

type SSH struct {
	task.Task
	// ssh address
	Address string `json:"address"`
	// ssh hostKey
	HostKey string `json:"hostKey,omitempty"`
	// ssh identity file
	IdentityFile string `json:"identityFile"`
	// ssh port
	Port int `json:"port,omitempty" default:"22"`
	// ssh user
	User string `json:"user,omitempty" default:"root"`
	// the workdir from ssh
	WorkDir WorkDir `json:"-" output:"dir"`
}

SSH create ssh work dir for remote executing

func (*SSH) Do

func (c *SSH) Do(ctx context.Context) error

func (SSH) RuntimeDoc

func (v SSH) RuntimeDoc(names ...string) ([]string, bool)

type SSHFromConfig

type SSHFromConfig struct {
	task.Task

	// path to ssh config
	Config string `json:"config"`
	// host key of ssh config
	HostKey string `json:"hostKey"`

	// the workdir from ssh
	WorkDir WorkDir `json:"-" output:"dir"`
}

SSHFromConfig create ssh work dir for remote executing

func (*SSHFromConfig) Do

func (c *SSHFromConfig) Do(ctx context.Context) error

func (SSHFromConfig) RuntimeDoc

func (v SSHFromConfig) RuntimeDoc(names ...string) ([]string, bool)

type Su

type Su struct {
	task.Task

	// current workdir
	Cwd WorkDir `json:"cwd"`

	// switched user
	User string `json:"user"`

	// switched workdir with the switched user
	WorkDir WorkDir `json:"-" output:"dir"`
}

Su switch user

func (*Su) Do

func (e *Su) Do(ctx context.Context) error

func (Su) RuntimeDoc

func (v Su) RuntimeDoc(names ...string) ([]string, bool)

type Sub

type Sub struct {
	task.Task

	// current workdir
	Cwd WorkDir `json:"cwd"`

	// related path from current workdir
	Path string `json:"path"`

	// new workdir
	WorkDir WorkDir `json:"-" output:"dir"`
}

Sub create new work dir base on current work dir

func (*Sub) Do

func (e *Sub) Do(ctx context.Context) error

func (Sub) RuntimeDoc

func (v Sub) RuntimeDoc(names ...string) ([]string, bool)

type SysInfo

type SysInfo struct {
	task.Task

	// current workdir
	Cwd WorkDir `json:"cwd"`
	// home
	Home string `json:"-" output:"home"`
	// os release info
	Release Release `json:"-" output:"release"`
	// os platform
	Platform Platform `json:"-" output:"platform"`
}

SysInfo get sys info of current work dir

func (*SysInfo) Do

func (t *SysInfo) Do(ctx context.Context) error

func (SysInfo) RuntimeDoc

func (v SysInfo) RuntimeDoc(names ...string) ([]string, bool)

type Temp

type Temp struct {
	task.Task
	// related dir on the root of project
	ID string `json:"id"`
	// the tmp workdir
	WorkDir WorkDir `json:"-" output:"dir"`
}

Tm create a tmp workdir

func (*Temp) Do

func (local *Temp) Do(ctx context.Context) error

func (Temp) RuntimeDoc

func (v Temp) RuntimeDoc(names ...string) ([]string, bool)

type WorkDir

type WorkDir struct {
	Ref struct {
		ID string `json:"id"`
	} `json:"$$wd"`
}

func (*WorkDir) Do

func (w *WorkDir) Do(ctx context.Context, action func(ctx context.Context, wd wd.WorkDir) error, optFns ...wd.OptionFunc) error

func (*WorkDir) Get

func (w *WorkDir) Get(ctx context.Context, optFns ...wd.OptionFunc) (wd.WorkDir, error)

func (WorkDir) RuntimeDoc

func (v WorkDir) RuntimeDoc(names ...string) ([]string, bool)

func (*WorkDir) ScopeName

func (w *WorkDir) ScopeName(ctx context.Context) (string, error)

func (*WorkDir) Sync

func (w *WorkDir) Sync(ctx context.Context, workdir wd.WorkDir) error

Jump to

Keyboard shortcuts

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