-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Поддержка загрузки библиотек из каталога, заданного в конфиге и ENV при запуске сервиса #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
70af4f0
feat: Поддержка загрузки библиотек из конфигурационных файлов и перем…
Stivo182 8d22afa
Исправлен воркфлоу test
Stivo182 07ac22d
Понежена версия configor, исправлен воркфлоу test
Stivo182 625d736
Исправлено замечание кролика
Stivo182 4b708ff
Настройка запуска httpbin в тестах под 1testrunner
Stivo182 7753109
Проверка для 1testrunner
Stivo182 7b199db
Увеличен таймаут
Stivo182 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| #Использовать logos | ||
|
|
||
| Перем _Лог; | ||
|
|
||
| #Область ПрограммныйИнтерфейс | ||
|
|
||
| // Возвращает приоритет провайдера | ||
| // | ||
| // Возвращаемое значение: | ||
| // Число - текущий приоритет провайдера | ||
| // | ||
| Функция Приоритет() Экспорт | ||
| Возврат 1; | ||
| КонецФункции | ||
|
|
||
| // Возвращает идентификатор провайдера | ||
| // | ||
| // Возвращаемое значение: | ||
| // Строка - текущий идентификатор провайдера | ||
| // | ||
| Функция Идентификатор() Экспорт | ||
| Возврат "cfg"; | ||
| КонецФункции | ||
|
|
||
| // Возвращает тип провайдера | ||
| // | ||
| // Возвращаемое значение: | ||
| // Строка - текущий тип провайдера | ||
| // | ||
| Функция ТипПровайдера() Экспорт | ||
| Возврат "file"; | ||
| КонецФункции | ||
|
|
||
| // Возвращает расширения файлов по умолчанию | ||
| // | ||
| // Возвращаемое значение: | ||
| // Строка - расширения файлов по умолчанию | ||
| // | ||
| Функция РасширенияФайлов() Экспорт | ||
| Возврат "cfg"; | ||
| КонецФункции | ||
|
|
||
| // Выполняет чтение параметров для провайдера | ||
| // | ||
| // Параметры: | ||
| // НастройкиПровайдера - Структура - структура настроек провайдера | ||
| // | ||
| // Возвращаемое значение: | ||
| // Соответствие - результат чтения провайдера | ||
| // | ||
| Функция ПрочитатьПараметры(НастройкиПровайдера) Экспорт | ||
|
|
||
| ПрочитанныеПараметры = Новый Соответствие; | ||
|
|
||
| ФайлПараметров = Новый Файл(НастройкиПровайдера.ФайлПараметров); | ||
|
|
||
| Если Не ФайлПараметров.Существует() Тогда | ||
| _Лог.Отладка("Не найден файл параметров <%1>", ФайлПараметров.ПолноеИмя); | ||
| Возврат ПрочитанныеПараметры; | ||
| КонецЕсли; | ||
|
|
||
| _Лог.Отладка("Выполняю чтение файла параметров <%1>", ФайлПараметров.ПолноеИмя); | ||
| ПрочитанныеПараметры = Прочитать(ФайлПараметров.ПолноеИмя); | ||
|
|
||
| Возврат ПрочитанныеПараметры; | ||
|
|
||
| КонецФункции | ||
Stivo182 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #КонецОбласти | ||
|
|
||
| #Область СлужебныеПроцедурыИФункции | ||
|
|
||
| Процедура ПриСозданииОбъекта() | ||
| _Лог = Логирование.ПолучитьЛог("oscript.lib.httpbin.configor.cfg"); | ||
| КонецПроцедуры | ||
|
|
||
| // Выполнить чтение настроек из файла | ||
| // | ||
| // Параметры: | ||
| // ПутьКФайлу - Cтрока - путь к файлу настроек | ||
| // Возвращаемое значение: | ||
| // Соответствие - итоговые параметры | ||
| // | ||
| Функция Прочитать(Знач ПутьКФайлу) | ||
|
|
||
| НастройкиИзФайла = Новый Соответствие; | ||
|
|
||
| ТД = Новый ТекстовыйДокумент(); | ||
| ТД.Прочитать(ПутьКФайлу); | ||
|
|
||
| Для Сч = 1 По ТД.КоличествоСтрок() Цикл | ||
|
|
||
| СтрокаНастроек = ТД.ПолучитьСтроку(Сч); | ||
|
|
||
| Если ПустаяСтрока(СтрокаНастроек) или Лев(СтрокаНастроек, 1) = "#" Тогда | ||
| Продолжить; | ||
| КонецЕсли; | ||
|
|
||
| Поз = СтрНайти(СтрокаНастроек, "="); | ||
| Если Поз = 0 Тогда | ||
| Продолжить; | ||
| КонецЕсли; | ||
|
|
||
| Ключ = СокрЛП(Лев(СтрокаНастроек, Поз - 1)); | ||
| Значение = СокрЛП(Сред(СтрокаНастроек, Поз + 1)); | ||
|
|
||
| НастройкиИзФайла.Вставить(Ключ, Значение); | ||
|
|
||
| КонецЦикла; | ||
|
|
||
| _Лог.Отладка("Прочитан файл настроек %1", ПутьКФайлу); | ||
|
|
||
| Возврат НастройкиИзФайла; | ||
|
|
||
| КонецФункции // Прочитать | ||
|
|
||
| #КонецОбласти | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| lib.system=../oscript_modules |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.