sshclient

package module
v0.0.0-...-b06e673 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 17 Imported by: 0

README

agent

Библиотека подключения к режиму Агента Конфигуратра 1С Предприятие

Documentation

Index

Constants

View Source
const (
	ExtensionPurposeCustomization ExtensionPurposeType = "customization"
	ExtensionPurposeAddOn                              = "add-on"
	ExtensionPurposePatch                              = "patch"
)
View Source
const (
	LogType           RespondType = "log"            // информационное сообщение.
	SuccessType                   = "success"        // операция успешно завершена.
	ErrorType                     = "error"          // операция завершена с ошибкой.
	CanceledType                  = "canceled"       // операция отменена
	QuestionType                  = "question"       // вопрос пользователю
	DbstruType                    = "dbstru"         // информация о процессе реструктуризации
	LoadingIssueType              = "loading-issue"  // ошибки и предупреждения, накопленные за время загрузки конфигурации из файлов
	ProgressType                  = "progress"       // информация о прогрессе выполнения команды
	ExtensionInfoType             = "extension-info" // информация о расширении, которое находится в информационной базе
	UnknownType                   = "unknown"
)

Variables

View Source
var UnknownRespond = Respond{Type: UnknownType}

Functions

func StartKeepalive

func StartKeepalive(client *ssh.Client, interval time.Duration, countMax int, done <-chan struct{})

func WithNullReader

func WithNullReader() execOption

func WithReader

func WithReader(r RespondReader) execOption

func WithRespondCheck

func WithRespondCheck(onSuccess OnSuccessRespond, onError OnErrorRespond, onProgress OnProgressRespond) execOption

func WithTimeout

func WithTimeout(t time.Duration) execOption

Types

type Agent

type Agent interface {
	Exec(Cmd AgentCommand, opts ...execOption) (res []Respond, err error)

	CopyFileTo(src, dest string) error
	CopyFileFrom(src, dest string) error

	CopyDirTo(src, dest string) error
	CopyDirFrom(src, dest string) error

	//Команды группы common отвечают за общие операции. В состав группы входят следующие команды:
	//connect-ib ‑ выполнить подключение к информационной базе, параметры которой указаны при старте режима агента.
	Connect(opts ...execOption) (err error)

	//disconnect-ib ‑ выполнить отключение от информационной базы, подключение к которой ранее выполнялось с помощью команды connect-ib.
	Disconnect(opts ...execOption) (err error)

	//shutdown ‑ завершить работу конфигуратора в режиме агента.
	Shutdown(opts ...execOption) (err error)

	// options
	Options(opts ...execOption) (confOpts ConfigurationOptions, err error)
	SetOptions(confOpts ConfigurationOptions, opts ...execOption) error

	// Configuration support
	DisableCfgSupport(opts ...execOption) error

	// Configuration
	DumpCfgToFiles(dir string, force bool, opts ...execOption) error
	LoadCfgFromFiles(dir string, updateConfigDumpInfo bool, opts ...execOption) error

	DumpCfg(file string, opts ...execOption) error
	LoadCfg(file string, opts ...execOption) error

	DumpExtensionCfg(ext string, file string, opts ...execOption) error
	LoadExtensionCfg(ext string, file string, opts ...execOption) error

	DumpExtensionToFiles(ext string, dir string, force bool, opts ...execOption) error
	LoadExtensionFromFiles(ext string, dir string, updateConfigDumpInfo bool, opts ...execOption) error
	DumpAllExtensionsToFiles(dir string, force bool, opts ...execOption) error
	LoadAllExtensionsFromFiles(dir string, updateConfigDumpInfo bool, opts ...execOption) error

	// update
	UpdateDbCfg(server bool, opts ...execOption) error
	UpdateDbExtension(extension string, server bool, opts ...execOption) error
	StartBackgroundUpdateDBCfg(opts ...execOption) error
	StopBackgroundUpdateDBCfg(opts ...execOption) error
	FinishBackgroundUpdateDBCfg(opts ...execOption) error
	ResumeBackgroundUpdateDBCfg(opts ...execOption) error

	// Infobase
	IBDataSeparationList(opts ...execOption) (DataSeparationList, error)
	DebugInfo(opts ...execOption) (info DebugInfo, err error)
	DumpIB(file string, opts ...execOption) (err error)
	RestoreIB(file string, opts ...execOption) (err error)
	EraseData(opts ...execOption) (err error)

	//Extensions
	CreateExtension(name, prefix string, synonym string, purpose ExtensionPurposeType, opts ...execOption) error
	DeleteExtension(name string, opts ...execOption) error
	DeleteAllExtensions(opts ...execOption) error
	GetExtensionProperties(name string, opts ...execOption) (ExtensionProperties, error)
	GetAllExtensionsProperties(opts ...execOption) ([]ExtensionProperties, error)
	SetExtensionProperties(props ExtensionProperties, opts ...execOption) error
}

func NewAgentClient

func NewAgentClient(user, password, ipPort string, opts ...Option) (client Agent, err error)

type AgentClient

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

func (*AgentClient) Connect

func (c *AgentClient) Connect(opts ...execOption) error

func (*AgentClient) CopyDirFrom

func (c *AgentClient) CopyDirFrom(src, dest string) error

func (*AgentClient) CopyDirTo

func (c *AgentClient) CopyDirTo(src, dest string) error

func (*AgentClient) CopyDirToWithTreads

func (c *AgentClient) CopyDirToWithTreads(src, dest string, treadCount int) error

func (*AgentClient) CopyFileFrom

func (c *AgentClient) CopyFileFrom(src, dest string) error

func (*AgentClient) CopyFileTo

func (c *AgentClient) CopyFileTo(src, dest string) error

func (*AgentClient) CreateExtension

func (c *AgentClient) CreateExtension(name, prefix string, synonym string, purpose ExtensionPurposeType, opts ...execOption) error

Extensions

func (*AgentClient) DebugInfo

func (c *AgentClient) DebugInfo(opts ...execOption) (info DebugInfo, err error)

func (*AgentClient) DeleteAllExtensions

func (c *AgentClient) DeleteAllExtensions(opts ...execOption) error

func (*AgentClient) DeleteExtension

func (c *AgentClient) DeleteExtension(name string, opts ...execOption) error

func (*AgentClient) DisableCfgSupport

func (c *AgentClient) DisableCfgSupport(opts ...execOption) error

Configuration support

func (*AgentClient) Disconnect

func (c *AgentClient) Disconnect(opts ...execOption) error

func (*AgentClient) DumpAllExtensionsToFiles

func (c *AgentClient) DumpAllExtensionsToFiles(dir string, force bool, opts ...execOption) error

func (*AgentClient) DumpCfg

func (c *AgentClient) DumpCfg(file string, opts ...execOption) error

Configuration

func (*AgentClient) DumpCfgToFiles

func (c *AgentClient) DumpCfgToFiles(dir string, force bool, opts ...execOption) error

func (*AgentClient) DumpExtensionCfg

func (c *AgentClient) DumpExtensionCfg(ext string, file string, opts ...execOption) error

func (*AgentClient) DumpExtensionToFiles

func (c *AgentClient) DumpExtensionToFiles(ext string, dir string, force bool, opts ...execOption) error

func (*AgentClient) DumpIB

func (c *AgentClient) DumpIB(file string, opts ...execOption) (err error)

func (*AgentClient) EraseData

func (c *AgentClient) EraseData(opts ...execOption) (err error)

func (*AgentClient) Exec

func (c *AgentClient) Exec(cmd AgentCommand, opts ...execOption) (res []Respond, err error)

func (*AgentClient) FinishBackgroundUpdateDBCfg

func (c *AgentClient) FinishBackgroundUpdateDBCfg(opts ...execOption) error

func (*AgentClient) GetAllExtensionsProperties

func (c *AgentClient) GetAllExtensionsProperties(opts ...execOption) (lsProps []ExtensionProperties, err error)

func (*AgentClient) GetExtensionProperties

func (c *AgentClient) GetExtensionProperties(name string, opts ...execOption) (props ExtensionProperties, err error)

func (*AgentClient) IBDataSeparationList

func (c *AgentClient) IBDataSeparationList(opts ...execOption) (ls DataSeparationList, err error)

Infobase

func (*AgentClient) LoadAllExtensionsFromFiles

func (c *AgentClient) LoadAllExtensionsFromFiles(dir string, updateConfigDumpInfo bool, opts ...execOption) error

func (*AgentClient) LoadCfg

func (c *AgentClient) LoadCfg(file string, opts ...execOption) error

func (*AgentClient) LoadCfgFromFiles

func (c *AgentClient) LoadCfgFromFiles(dir string, updateConfigDumpInfo bool, opts ...execOption) error

func (*AgentClient) LoadExtensionCfg

func (c *AgentClient) LoadExtensionCfg(ext string, file string, opts ...execOption) error

func (*AgentClient) LoadExtensionFromFiles

func (c *AgentClient) LoadExtensionFromFiles(ext string, dir string, updateConfigDumpInfo bool, opts ...execOption) error

func (*AgentClient) Options

func (c *AgentClient) Options(opts ...execOption) (ConfigurationOptions, error)

options

func (*AgentClient) RestoreIB

func (c *AgentClient) RestoreIB(file string, opts ...execOption) (err error)

func (*AgentClient) ResumeBackgroundUpdateDBCfg

func (c *AgentClient) ResumeBackgroundUpdateDBCfg(opts ...execOption) error

func (*AgentClient) SetExtensionProperties

func (c *AgentClient) SetExtensionProperties(props ExtensionProperties, opts ...execOption) error

func (*AgentClient) SetOptions

func (c *AgentClient) SetOptions(configurationOptions ConfigurationOptions, opts ...execOption) error

func (*AgentClient) Shutdown

func (c *AgentClient) Shutdown(opts ...execOption) (err error)

func (*AgentClient) Start

func (c *AgentClient) Start() error

func (*AgentClient) StartBackgroundUpdateDBCfg

func (c *AgentClient) StartBackgroundUpdateDBCfg(opts ...execOption) error

func (*AgentClient) Stop

func (c *AgentClient) Stop()

func (*AgentClient) StopBackgroundUpdateDBCfg

func (c *AgentClient) StopBackgroundUpdateDBCfg(opts ...execOption) error

func (*AgentClient) UpdateDbCfg

func (c *AgentClient) UpdateDbCfg(server bool, opts ...execOption) error

update

func (*AgentClient) UpdateDbExtension

func (c *AgentClient) UpdateDbExtension(extension string, server bool, opts ...execOption) error

type AgentCommand

type AgentCommand interface {
	Command() string
	Args() []string
}

type AgentTask

type AgentTask struct {
	OnError    OnErrorRespond
	OnSuccess  OnSuccessRespond
	OnProgress OnProgressRespond

	After  *TaskHook
	Before *TaskHook
	// contains filtered or unexported fields
}

func NewAgentTask

func NewAgentTask(cmd AgentCommand) *AgentTask

type AgentTasks

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

func (*AgentTasks) NewTask

func (t *AgentTasks) NewTask(cmd AgentCommand) *AgentTask

type ChannelDataReader

type ChannelDataReader func(date string, doneChan chan bool) error

type CommonConnectInfobase

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

func (CommonConnectInfobase) Args

func (CommonConnectInfobase) Args() (v []string)

func (CommonConnectInfobase) Command

func (c CommonConnectInfobase) Command() string

type CommonDisconnectInfobase

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

func (CommonDisconnectInfobase) Args

func (CommonDisconnectInfobase) Args() (v []string)

func (CommonDisconnectInfobase) Command

func (c CommonDisconnectInfobase) Command() string

type CommonShutdown

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

func (CommonShutdown) Args

func (CommonShutdown) Args() (v []string)

func (CommonShutdown) Command

func (c CommonShutdown) Command() string

type ConfigurationOptions

type ConfigurationOptions struct {

	//  --output-format ‑ позволяет указать формат вывода результата работы команд:
	//  text ‑ команды возвращают результат в текстовом формате.
	//  json ‑ команды возвращают результат в формате JSON-сообщений.
	OutputFormat OptionsOutputFormatType `json:"output-format"`

	//  --show-prompt ‑ позволяет управлять наличием приглашения командной строки designer>:
	//  yes ‑ в командной строке есть приглашение;
	//  no ‑ в командной строке нет приглашения.
	ShowPrompt bool `json:"show-prompt"`

	//  --notify-progress ‑ позволяет получить информацию об отображении прогресса выполнения команды.
	NotifyProgress bool `json:"notify-progress"`

	//  --notify-progress-interval ‑ позволяет получить интервал времени, через который обновляется информация о прогрессе.
	NotifyProgressInterval int `json:"notify-progress-interval"`
}

Данная команда позволяет получить значения параметров. Для команды доступны следующие параметры:

type CreateExtension

type CreateExtension struct {

	//--extension <имя> ‑ задает имя расширения. Параметр является обязательным.
	Name string
	//--name-prefix <префикс> ‑ задает префикс имени для расширения. Параметр является обязательным.
	Prefix string
	//--synonym <синоним> ‑ синоним имени расширения. Многоязычная строка в формате функции Nstr().
	Synonym string
	//--purpose <назначение> ‑ назначение расширения. <Назначение> может принимать следующие значения:
	// customization ‑ назначение Адаптация (значение по умолчанию);
	// add-on ‑ назначение Дополнение;
	// patch ‑ назначение Исправление.
	Purpose ExtensionPurposeType
	// contains filtered or unexported fields
}

create Команда предназначена для создания расширения в информационной базе. Расширение создается пустым. Для загрузки расширения следует использовать команду config load-cfg или config load-config-from-files.

func (CreateExtension) Args

func (c CreateExtension) Args() []string

func (CreateExtension) Command

func (c CreateExtension) Command() string

type DataSeparationList

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

data-separation-common-attribute-list Данная команда позволяет получить список имен разделителей информационной базы.

func (DataSeparationList) Args

func (c DataSeparationList) Args() []string

func (DataSeparationList) Command

func (c DataSeparationList) Command() string

type DebigInfo

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

debug-info C помощью данной команды получить информацию о настройках отладчика для информационной базы.

func (DebigInfo) Args

func (c DebigInfo) Args() []string

func (DebigInfo) Command

func (c DebigInfo) Command() string

type DebugInfo

type DebugInfo struct {

	//  enabled ‑ признак включения отладки.
	Enable bool `json:"enable"`

	//  protocol ‑ протокол отладки: tcp или http.
	Protocol string `json:"protocol"`

	//  server-address ‑ адрес сервера отладки для данной информационной базы.
	ServerAddress string `json:"server-address"`
}

type DeleteExtension

type DeleteExtension struct {

	// --extension <имя> ‑ задает имя удаляемого расширения.
	Name string
	//--all-extensions ‑ указывает, что необходимо удалить все расширения.
	All bool
	// contains filtered or unexported fields
}

create Команда предназначена для создания расширения в информационной базе. Расширение создается пустым. Для загрузки расширения следует использовать команду config load-cfg или config load-config-from-files.

func (DeleteExtension) Args

func (c DeleteExtension) Args() []string

func (DeleteExtension) Command

func (c DeleteExtension) Command() string

type DialContextFunc

type DialContextFunc func(ctx context.Context, network, addr string, config *ssh.ClientConfig) (*ssh.Client, error)

DialContextFunc creates SSH connection to host with a given address.

func ContextDialer

func ContextDialer(dialer *net.Dialer) DialContextFunc

ContextDialer returns DialContextFunc based on dialer to make net connections.

type DumpCfg

type DumpCfg struct {

	//--file <путь> ‑ путь к файлу конфигурации (cf-файл) или расширению (cfe-файл).
	File string `json:"file"`
	//--extension <имя расширения> ‑ содержит имя расширения, которое будет выгружено в файл.
	Extension string `json:"extension"`
	// contains filtered or unexported fields
}

dump-cfg Команда позволяет выполнить выгрузку конфигурации или расширения в файл.

func (DumpCfg) Args

func (c DumpCfg) Args() []string

func (DumpCfg) Command

func (c DumpCfg) Command() string

type DumpCfgToFiles

type DumpCfgToFiles struct {

	//--dir <путь> ‑ содержит путь к каталогу, в который будет выгружена конфигурация. Параметр является обязательным.
	Dir string `json:"dir"`
	//--extension <имя расширения> ‑ содержит имя расширения, которое будет выгружено в файл.
	Extension string `json:"extension"`
	//--all-extensions ‑ если параметр указан, то в файлы будут выгружены все расширения конфигурации.
	AllExtension bool `json:"all-extension"`
	//--format [hierarchical|plain] ‑ определяет формат выгрузки. По умолчанию используется иерархический формат выгрузки (hierarchical).
	Format string
	//--update ‑ обновить существующую выгрузку. В этом случае будут выгружены только те объекты, версии которых отличаются от версий, указанных в файле ConfigDumpInfo.xml.
	Update bool
	//--force ‑ выполнить полную выгрузку, если при попытке обновления выгрузки (параметр update) выяснилось, что текущая версия формата выгрузки не совпадает с версией формата выгрузки, которая указана в файле ConfigDumpInfo.xml.
	Force bool
	//--get-сhanges <путь> ‑ сформировать файл, который содержит изменения между текущей и указанной выгрузками конфигурации.
	GetChanges string
	//--config-dump-info-for-changes <путь> ‑ путь к файлу ConfigDumpInfo.xml, который используется для формирования файла изменений между двумя выгрузками конфигурации.
	ConfigDumpInfo string
	//--list-file <файл> ‑ выгрузить только объекты метаданных и/или внешние свойства, указанные в файле, вне зависимости от того были они изменены или нет.
	ListFile string
	// contains filtered or unexported fields
}

dump-config-to-files Команда позволяет выполнить выгрузку конфигурации в xml-файлы.

func (DumpCfgToFiles) Args

func (c DumpCfgToFiles) Args() []string

func (DumpCfgToFiles) Command

func (c DumpCfgToFiles) Command() string

type DumpInfobase

type DumpInfobase struct {

	// --file <имя файла> ‑ определяет имя dt-файла.
	File string
	// contains filtered or unexported fields
}

dump-ib Команда предназначена для выполнения выгрузки информационной базы в dt-файл. Допустимо использование следующих параметров:

func (DumpInfobase) Args

func (c DumpInfobase) Args() []string

func (DumpInfobase) Command

func (c DumpInfobase) Command() string

type DumpToFilesEpfOrErf

type DumpToFilesEpfOrErf struct {

	//--file <путь> ‑ одержит имя файла, который будет выступать в роли корневого файла выгрузки внешней обработки/отчета в формате XML.
	//Параметр является обязательным.
	File string `json:"file"`
	//--ext-file <файл> ‑ полное имя файла с выгружаемой внешней обработкой (*.epf) или отчетом (*.erf).
	Ext string `json:"ext-file"`
	//--format [hierarchical|plain] ‑ определяет формат выгрузки. По умолчанию используется иерархический формат выгрузки (hierarchical).
	Format string `json:"format"`
	// contains filtered or unexported fields
}

dump-external-data-processor-or-report-to-files Команда позволяет выполнить выгрузку внешних обработок или отчетов в xml-файлы.

func (DumpToFilesEpfOrErf) Args

func (c DumpToFilesEpfOrErf) Args() []string

func (DumpToFilesEpfOrErf) Command

func (c DumpToFilesEpfOrErf) Command() string

type EraseInfobaseDate

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

erase-data Команда выполняет удаление данных информационной базы.

func (EraseInfobaseDate) Args

func (c EraseInfobaseDate) Args() []string

func (EraseInfobaseDate) Command

func (c EraseInfobaseDate) Command() string

type ExtensionProperties

type ExtensionProperties struct {
	Extension                 string
	Active                    ExtensionPropertiesBoolType
	SafeMode                  ExtensionPropertiesBoolType
	SecurityProfileName       string
	UnsafeActionProtection    ExtensionPropertiesBoolType
	UsedInDistributedInfobase ExtensionPropertiesBoolType
	Scope                     ExtensionPropertiesScopeType
}

type ExtensionPropertiesBoolType

type ExtensionPropertiesBoolType string
const (
	ExtensionPropertiesBoolYes    ExtensionPropertiesBoolType = "yes"
	ExtensionPropertiesBoolNo     ExtensionPropertiesBoolType = "no"
	ExtensionPropertiesBoolNotSet                             = ""
)

func (ExtensionPropertiesBoolType) String

type ExtensionPropertiesScopeType

type ExtensionPropertiesScopeType string
const (
	ExtensionPropertiesScopeInfobase       ExtensionPropertiesScopeType = "infobase"
	ExtensionPropertiesScopeDataSeparation                              = "data-separation"
)

func (ExtensionPropertiesScopeType) String

type ExtensionPurposeType

type ExtensionPurposeType string

type GetExtensionProperties

type GetExtensionProperties struct {

	//--extension <имя> ‑ задает имя расширения, для которого необходимо получить свойства.
	Extension string
	//--all-extensions ‑ указывает, что необходимо получить свойства всех расширений, загруженных в информационную базу.
	All bool
	// contains filtered or unexported fields
}

Группа команд properties Назначение группы команд Группа команд config extensions properties позволяет задавать и получать свойства расширения.

get Команда предназначена для получения свойств расширения, расположенного в информационной базе.

func (GetExtensionProperties) Args

func (c GetExtensionProperties) Args() []string

func (GetExtensionProperties) Command

func (c GetExtensionProperties) Command() string

type LoadCfg

type LoadCfg struct {

	//--file <путь> ‑ путь к файлу конфигурации (cf-файл) или расширению (cfe-файл).
	File string `json:"file"`
	//--extension <имя расширения> ‑ содержит имя расширения, которое будет загружено из файла.
	Extension string `json:"extension"`
	// contains filtered or unexported fields
}

load-cfg Команда позволяет выполни ть загрузку конфигурации или расширения из файла.

func (LoadCfg) Args

func (c LoadCfg) Args() []string

func (LoadCfg) Command

func (c LoadCfg) Command() string

type LoadCfgFromFiles

type LoadCfgFromFiles struct {

	//--dir <путь> ‑ содержит путь к каталогу, в который будет загружена конфигурация. Параметр является обязательным.
	Dir string `json:"dir"`
	//--extension <имя расширения> ‑ содержит имя расширения, которое будет выгружено в файл.
	Extension string `json:"extension"`
	//--all-extensions ‑ если параметр указан, то в файлы будут выгружены все расширения конфигурации.
	AllExtension bool `json:"all-extension"`
	//--format [hierarchical|plain] ‑ определяет формат выгрузки. По умолчанию используется иерархический формат выгрузки (hierarchical).
	Format string
	//--update-config-dump-info ‑ после окончания загрузки создать в директории файл ConfigDumpInfo.xml, соответствующий загруженной конфигурации.
	UpdateConfigDumpInfo bool
	//--files <файл[, файл]> ‑ список файлов, которые требуется загрузить.
	//	Файла разделяются запятыми.
	//	Пути к файлам указываются относительно каталога загрузки.
	//	Абсолютные пути не поддерживаются.
	//	При использовании параметра --list-file, данный параметр не используется.
	Files []string
	//--list-file <файл> ‑ путь к файлу, в котором перечислены загружаемые файлы.
	//Одна строка соответствует одному файлу.
	//Пути к файлам указываются относительно каталога загрузки.
	//Абсолютные пути не поддерживаются. При использовании параметра --files, данный параметр не используется.
	ListFile string
	// contains filtered or unexported fields
}

load-config-from-files Команда позволяет выполнить загрузку конфигурации из xml-файлов. Для команды доступны следующие параметры:

func (LoadCfgFromFiles) Args

func (c LoadCfgFromFiles) Args() []string

func (LoadCfgFromFiles) Command

func (c LoadCfgFromFiles) Command() string

type LoadFromFilesEpfOrErf

type LoadFromFilesEpfOrErf struct {

	//--file <путь> ‑ одержит имя файла, который будет выступать в роли корневого файла выгрузки внешней обработки/отчета в формате XML.
	//Параметр является обязательным.
	File string `json:"file"`
	//--ext-file <файл> ‑ полное имя файла с загружаемой внешней обработкой (*.epf) или отчетом (*.erf).
	Ext string `json:"ext-file"`
	// contains filtered or unexported fields
}

load-external-data-processor-or-report-from-files Команда позволяет выполнить загрузку внешних обработок или отчетов из xml-файлов.

func (LoadFromFilesEpfOrErf) Args

func (c LoadFromFilesEpfOrErf) Args() []string

func (LoadFromFilesEpfOrErf) Command

func (c LoadFromFilesEpfOrErf) Command() string

type LoadingIssue

type LoadingIssue struct {
	Message string            `json:"message"`
	Level   LoadingIssueLevel `json:"level"`
}

type LoadingIssueLevel

type LoadingIssueLevel string
const (
	LoadingIssueLevelWarning LoadingIssueLevel = "warning"
	LoadingIssueLevelError                     = "error"
)

type ManageCfgSupport

type ManageCfgSupport struct {

	//--disable-support ‑ указывает на необходимость снятия конфигурации с поддержки.
	//При отсутствии параметра генерируется ошибка.
	DisableSupport bool
	//--force ‑ выполнить снятие конфигурации с поддержки даже в том случае, если в конфигурации запрещены изменения.
	//При отсутствии параметра будет сгенерирована ошибка, если попытка снятия с поддержки будет выполняться для конфигурации,
	//для которой в интерактивном режиме управления поддержкой запрещены изменения.
	Force bool
	// contains filtered or unexported fields
}

manage-cfg-support Команда позволяет снимать конфигурация с поддержки

func (ManageCfgSupport) Args

func (c ManageCfgSupport) Args() []string

func (ManageCfgSupport) Command

func (c ManageCfgSupport) Command() string

type OnErrorRespond

type OnErrorRespond func(err error, errType RespondErrorType, stop chan bool)

type OnProgressRespond

type OnProgressRespond func(info ProgressInfo, stop chan bool)

type OnSuccessRespond

type OnSuccessRespond func(body []byte, stop chan bool)

type Option

type Option func(c *AgentClient)

func WithDialer

func WithDialer(dial DialContextFunc) Option

func WithOptions

func WithOptions(opt ConfigurationOptions) Option

type OptionsBoolType

type OptionsBoolType string
const (
	OptionsBoolYes    OptionsBoolType = "yes"
	OptionsBoolNo     OptionsBoolType = "no"
	OptionsBoolNotSet                 = ""
)

func (OptionsBoolType) String

func (t OptionsBoolType) String() string

type OptionsList

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

func (OptionsList) Args

func (OptionsList) Args() (v []string)

func (OptionsList) Command

func (c OptionsList) Command() string

type OptionsOutputFormatType

type OptionsOutputFormatType string
const (
	OptionsOutputFormatText OptionsOutputFormatType = "text"
	OptionsOutputFormatJson                         = "json"
)

func (OptionsOutputFormatType) String

func (t OptionsOutputFormatType) String() string

type ProgressInfo

type ProgressInfo struct {
	Message string `json:"message"`
	Percent int    `json:"percent"`
}

type Respond

type Respond struct {
	Type      RespondType      `json:"type, not_null"`
	ErrorType RespondErrorType `json:"error-type"`
	Message   string           `json:"message"`
	Body      json.RawMessage  `json:"body"`
}

func (Respond) Error

func (res Respond) Error() error

func (Respond) IsError

func (res Respond) IsError() bool

func (Respond) IsProgress

func (res Respond) IsProgress() bool

func (Respond) IsSuccess

func (res Respond) IsSuccess() bool

func (Respond) ReadBody

func (res Respond) ReadBody(t interface{}) error

type RespondErrorType

type RespondErrorType string

type RespondReader

type RespondReader func(res *[]Respond, date string, doneChan chan bool, onSuccess OnSuccessRespond, onError OnErrorRespond, onProgress OnProgressRespond) error

type RespondType

type RespondType string

type RestoreInfobase

type RestoreInfobase struct {

	// --file <имя файла> ‑ определяет имя dt-файла.
	File string
	// contains filtered or unexported fields
}

restore-ib Команда предназначена для выполнения загрузки информационной базы из dt-файл. Допустимо использование следующих параметров:

func (RestoreInfobase) Args

func (c RestoreInfobase) Args() []string

func (RestoreInfobase) Command

func (c RestoreInfobase) Command() string

type Session

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

func NewSeesion

func NewSeesion(conn *ssh.Client) (*Session, error)

func (*Session) ClearChannel

func (this *Session) ClearChannel()

func (*Session) Close

func (this *Session) Close() error

func (*Session) RawReadChannel

func (this *Session) RawReadChannel(ctx context.Context, fn ChannelDataReader, ticker *time.Ticker) error

func (*Session) ReadChannel

func (this *Session) ReadChannel(timeout time.Duration, fn func(string) bool) string

func (*Session) ReadChannelExpect

func (this *Session) ReadChannelExpect(timeout time.Duration, expects ...string) string

func (*Session) ReadChannelRegExp

func (this *Session) ReadChannelRegExp(timeout time.Duration, re string) string

func (*Session) ReadChannelTiming

func (this *Session) ReadChannelTiming(timeout time.Duration) string

func (*Session) WriteChannel

func (this *Session) WriteChannel(cmds ...string)

type SetExtensionProperties

type SetExtensionProperties struct {

	//--extension <имя> ‑ задает имя расширения, для которого необходимо получить свойства.
	Extension string
	//--active <режим> ‑ определяет активность расширения. <Режим> может принимать следующие значения:
	// yes ‑ расширение активно.
	// no ‑ расширение не активно.
	Active ExtensionPropertiesBoolType
	//--safe-mode <режим> ‑ определяет работу в безопасном режиме. <Режим> может принимать следующие значения:
	// yes ‑ расширение работает в безопасном режиме.
	// no ‑ расширение работает в небезопасном режиме. В этом случае имя профиля безопасности автоматически сбрасывается (имя профиля устанавливается равным пустой строке).
	SafeMode ExtensionPropertiesBoolType
	//--security-profile-name <профиль> ‑ определяет имя профиля безопасности, под управлением которого работает расширение.
	//Если задается имя профиля безопасности, то автоматически устанавливается и признак работы в безопасном режиме.
	SecurityProfileName string
	//--unsafe-action-protection <режим> ‑ определяет режим защиты от опасных действий. <Режим> может принимать следующие значения:
	// yes ‑ защита от опасных действий в расширении включена.
	// no ‑ защита от опасных действий в расширении отключена.
	UnsafeActionProtection ExtensionPropertiesBoolType
	//--used-in-distributed-infobase <режим> ‑ определяет возможность работы расширения в распределенной информационной базе. <Режим> может принимать следующие значения:
	// yes ‑ расширение используется в распределенной информационной базе.
	// no ‑ расширение не используется в распределенной информационной базе.
	UsedInDistributedInfobase ExtensionPropertiesBoolType
	//--scope <область действия> ‑ область действия расширения. <Область действия> может принимать следующие значения:
	// infobase ‑ расширение действительно для все информационной базы.
	// data-separation ‑ расширение действительно для области данных.
	Scope ExtensionPropertiesScopeType
	// contains filtered or unexported fields
}

set Команда предназначена для установки свойств расширения, расположенного в информационной базе.

func (SetExtensionProperties) Args

func (c SetExtensionProperties) Args() []string

func (SetExtensionProperties) Command

func (c SetExtensionProperties) Command() string

type SetOptions

type SetOptions struct {

	//  --output-format ‑ позволяет указать формат вывода результата работы команд:
	//  text ‑ команды возвращают результат в текстовом формате.
	//  json ‑ команды возвращают результат в формате JSON-сообщений.
	OutputFormat OptionsOutputFormatType `json:"output-format"`
	//  --show-prompt ‑ позволяет управлять наличием приглашения командной строки designer>:
	//  yes ‑ в командной строке есть приглашение;
	//  no ‑ в командной строке нет приглашения.
	ShowPrompt OptionsBoolType `json:"show-prompt"`
	//  --notify-progress ‑ позволяет получить информацию об отображении прогресса выполнения команды.
	NotifyProgress OptionsBoolType `json:"notify-progress"`
	//  --notify-progress-interval ‑ позволяет получить интервал времени, через который обновляется информация о прогрессе.
	NotifyProgressInterval int `json:"notify-progress-interval"`
	// contains filtered or unexported fields
}

func (SetOptions) Args

func (c SetOptions) Args() []string

func (SetOptions) Command

func (c SetOptions) Command() string

type TaskHook

type TaskHook struct {
	Upload   []TransferTask
	Download []TransferTask

	ConnectIB    bool
	DisconnectIB bool
}

func (*TaskHook) DownloadDir

func (h *TaskHook) DownloadDir(src, dest string) *TaskHook

func (*TaskHook) DownloadFile

func (h *TaskHook) DownloadFile(src, dest string) *TaskHook

func (*TaskHook) UploadDir

func (h *TaskHook) UploadDir(src, dest string) *TaskHook

func (*TaskHook) UploadFile

func (h *TaskHook) UploadFile(src, dest string) *TaskHook

type TransferTask

type TransferTask struct {
	Dir  bool
	Src  string
	Dest string
}

type UpdateDbCfg

type UpdateDbCfg struct {

	//--prompt-confirmation ‑ определяет необходимость запроса у пользователя подтверждения о принятии изменений при реструктуризации информационной базы.
	PromptConfirmation bool
	//--dynamic-enable ‑ сначала выполняется попытка динамического обновления, если она завершена неудачно, будет запущено фоновое обновление.
	DynamicEnable bool
	//--dynamic-disable ‑ указание данного параметра запрещает динамическое обновление.
	DynamicDisable bool
	//--warnings-as-errors ‑ при указании данного параметра все предупреждения,
	//которые могут возникнуть при обновлении конфигурации базы данных, будут считаться ошибками.
	WarningsAsErrors bool
	//--background-start ‑ при указании данного параметра будет запущено фоновое обновление конфигурации, а текущий сеанс будет завершен.
	BackgroundStart bool
	//--background-cancel ‑ при указании данного параметра происходит отмена запущенного фонового обновления конфигурации базы данных.
	BackgroundCancel bool
	//--background-finish ‑ при указании данного параметра запущенное фоновое обновление конфигурации базы данных будет завершено.
	BackgroundFinish bool
	//При этом на базу данных будет наложена монопольная блокировка и проведена финальная фаза обновления.
	//--background-resume ‑ при указании данного параметра система продолжает фоновое обновление конфигурации базы данных, приостановленное ранее.
	BackgroundResume bool
	//--server ‑ данный параметр указывает, что обновление конфигурации базы данных необходимо выполнить на стороне сервер «1С:Предприятия».
	Server bool
	//--extension <имя расширения> ‑ имя расширения.
	Extension string
	// contains filtered or unexported fields
}

update-db-cfg Команда позволяет выполнить обновление конфигурации базы данных. При выполнении команды update-db-cfg используется следующий алгоритм работы: В том случае, если невозможно монопольно заблокировать базу данных и динамическое обновление возможно (не указан параметр --dynamic-disable) ‑ будет выполнено динамическое обновление конфигурации базы данных. В том случае, если монопольно заблокировать базу данных возможно, но не требуется выполнять реструктуризацию базы данных ‑ будет выполнено обычное обновление конфигурации базы данных. В том случае, если монопольно заблокировать базу данных возможно и требуется выполнить реструктуризацию базы данных, то будет выполнена следующая последовательность действий:

выполняется определение списка измененных объектов;
полученный список отображается в консоли;

если указана необходимость подтверждения пользователя на принятие изменений (параметр --prompt-confirmation) ‑ пользователю задается соответствующий вопрос; если ответ на вопрос отрицательный ‑ обновление отменяется с выдачей соответствующего уведомления; если ответ утвердительный или запрос не требовался ‑ обновление продолжается штатным образом.

func (UpdateDbCfg) Args

func (c UpdateDbCfg) Args() []string

func (UpdateDbCfg) Command

func (c UpdateDbCfg) Command() string

Directories

Path Synopsis
cmd
An example SFTP server implementation using the golang SSH package.
An example SFTP server implementation using the golang SSH package.

Jump to

Keyboard shortcuts

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