runner

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 9 Imported by: 6

README

runner

Исполнитель файлов 1С Предприятие

Documentation

Index

Constants

View Source
const CreateInfobase = "CREATEINFOBASE"

Variables

This section is empty.

Functions

func Run

func Run(where Infobase, what Command, opts ...interface{}) error

Types

type Command

type Command interface {
	Command() string
	Check() error
	Values() []string
}

type Infobase

type Infobase interface {
	// Возвращает
	// - /IBConnectionString <СтрокаПодключения>
	// - /F<ПУтьКБазе>
	// - /S<ПутьКСервернойБазе>
	ConnectionString() string
}

type Option

type Option func(options *Options)

func WithCommonValues

func WithCommonValues(cv []string) Option

func WithContext

func WithContext(ctx context.Context) Option

func WithCredentials

func WithCredentials(user, password string) Option

func WithDumpResult

func WithDumpResult(file string) Option

func WithOut

func WithOut(file string, noTruncate bool) Option

func WithPath

func WithPath(path string) Option

func WithTimeout

func WithTimeout(timeout int64) Option

func WithUC

func WithUC(uc string) Option

func WithUnlockCode

func WithUnlockCode(uc string) Option

func WithVersion

func WithVersion(version string) Option

type Options

type Options struct {
	Version    string
	Timeout    int64
	Out        string
	NoTruncate bool

	DumpResult string

	Context context.Context
	// contains filtered or unexported fields
}

func (*Options) NewDumpResultFile

func (ro *Options) NewDumpResultFile()

func (*Options) NewOutFile

func (ro *Options) NewOutFile()

func (*Options) Option

func (ro *Options) Option(fn Option)

func (*Options) Options

func (ro *Options) Options(opts ...Option)

func (*Options) RemoveDumpResultFile

func (ro *Options) RemoveDumpResultFile()

func (*Options) RemoveOutFile

func (ro *Options) RemoveOutFile()

func (*Options) RemoveTempFiles

func (ro *Options) RemoveTempFiles()

func (Options) Values

func (ro Options) Values() []string

type Param added in v0.2.0

type Param interface {
	Key() string
	Sep() string
	Value() string
}

type Params

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

func (*Params) Append

func (p *Params) Append(arr ...string)

func (*Params) Values

func (p *Params) Values() []string

type PlatformRunner added in v0.3.0

type PlatformRunner interface {

	//CreateInfobase()
	Run(ctx context.Context) error
	Background(ctx context.Context) (Process, error)
	Check() error
	Args() []string
	Opts() Options
}

func NewPlatformRunner added in v0.3.0

func NewPlatformRunner(where Infobase, what Command, opts ...interface{}) PlatformRunner

type Process

type Process interface {
	// Ready returns a channel which will close once the runner is active
	Ready() <-chan struct{}

	// Wait returns a channel that will emit a single error once the Process exits.
	Wait() <-chan error

	// Signal sends a shutdown signal to the Process.  It does not block.
	Signal(os.Signal)
}

A Process represents a Runner that has been started. It is safe to call any method on a Process even after the Process has exited.

func Background

func Background(ctx context.Context, where Infobase, what Command, opts ...interface{}) (Process, error)

type RunFunc

type RunFunc func(signals <-chan os.Signal, ready chan<- struct{}) error

The RunFunc type is an adapter to allow the use of ordinary functions as Runners. If f is a function that matches the Run method signature, RunFunc(f) is a Runner object that calls f.

func (RunFunc) Run

func (r RunFunc) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type Runner

type Runner interface {
	Run(signals <-chan os.Signal, ready chan<- struct{}) error
}

type ValueSep added in v0.2.0

type ValueSep string
const (
	SpaceSep ValueSep = " "
	EqualSep ValueSep = "="
	NoSep    ValueSep = ""
)

type Values added in v0.2.0

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

func NewValues added in v0.2.0

func NewValues() *Values

func (*Values) Append added in v0.2.0

func (v *Values) Append(v2 Params)

func (*Values) GetMap added in v0.2.0

func (v *Values) GetMap()

func (Values) Len added in v0.2.0

func (v Values) Len() int

func (*Values) Map added in v0.2.0

func (v *Values) Map(val Param)

func (*Values) Set added in v0.2.0

func (v *Values) Set(key string, sep string, value string)

func (*Values) Values added in v0.2.0

func (v *Values) Values() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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