From 6340a2329e9fbacd7a335af217ceecb108711f7f Mon Sep 17 00:00:00 2001 From: Karim Radhouani Date: Wed, 8 Nov 2023 10:53:18 -0800 Subject: [PATCH 1/4] introduce go workspaces --- .github/workflows/release.yml | 8 +- .github/workflows/test.yml | 8 +- cmd/listen.go | 4 +- cmd/prompt.go | 2 +- cmd/root.go | 2 +- .../golang_package/examples/capabilities.md | 2 +- .../user_guide/golang_package/examples/get.md | 2 +- .../user_guide/golang_package/examples/set.md | 2 +- .../golang_package/examples/subscribe.md | 2 +- examples/pkg/capabilities_rpc/main.go | 3 +- examples/pkg/get_rpc/main.go | 3 +- examples/pkg/set_rpc/main.go | 3 +- examples/pkg/subscribe_rpc/main.go | 3 +- formatters/all/all.go | 33 -- go.mod | 35 +- go.sum | 23 +- go.work | 12 + go.work.sum | 480 ++++++++++++++++++ outputs/all/all.go | 25 - {actions => pkg/actions}/action.go | 2 +- {loaders => pkg/actions}/all/all.go | 8 +- .../actions}/gnmi_action/gnmi_action.go | 23 +- .../actions}/gnmi_action/gnmi_action_test.go | 7 +- .../actions}/gnmi_action/options.go | 4 +- .../actions}/http_action/http_action.go | 8 +- .../actions}/http_action/http_action_test.go | 6 +- .../actions}/script_action/options.go | 4 +- .../actions}/script_action/script_action.go | 2 +- .../actions}/template_action/options.go | 4 +- .../template_action/template_action.go | 8 +- {api => pkg/api}/gnmi_msgs.go | 34 +- {api => pkg/api}/gnmi_msgs_test.go | 3 +- pkg/api/go.mod | 39 ++ pkg/api/go.sum | 48 ++ {api => pkg/api}/target.go | 5 +- {api => pkg/api}/target_test.go | 3 +- {api => pkg/api}/tunnel.go | 0 {api => pkg/api}/tunnel_test.go | 3 +- {app => pkg/app}/api.go | 5 +- {app => pkg/app}/app.go | 17 +- {app => pkg/app}/capabilities.go | 3 +- {app => pkg/app}/clustering.go | 4 +- {app => pkg/app}/clustering_test.go | 3 +- {app => pkg/app}/collector.go | 9 +- {app => pkg/app}/const.go | 0 {app => pkg/app}/diff.go | 6 +- {app => pkg/app}/generate.go | 7 +- {app => pkg/app}/generatePath.go | 0 {app => pkg/app}/get.go | 7 +- {app => pkg/app}/getset.go | 7 +- {app => pkg/app}/gnmi_client.go | 3 +- {app => pkg/app}/gnmi_client_subscribe.go | 8 +- {app => pkg/app}/gnmi_server.go | 12 +- {app => pkg/app}/inputs.go | 4 +- {app => pkg/app}/loaders.go | 2 +- {app => pkg/app}/locker.go | 0 {app => pkg/app}/logging.go | 0 {app => pkg/app}/metrics.go | 0 {app => pkg/app}/outputs.go | 4 +- {app => pkg/app}/path.go | 9 +- {app => pkg/app}/path_test.go | 0 {app => pkg/app}/prompt.go | 0 {app => pkg/app}/routes.go | 0 {app => pkg/app}/set-to-notifs.go | 0 {app => pkg/app}/set.go | 5 +- {app => pkg/app}/setrequest.go | 0 {app => pkg/app}/subscribe.go | 7 +- {app => pkg/app}/subscribe_once.go | 0 {app => pkg/app}/subscribe_poll.go | 0 {app => pkg/app}/subscribe_prompt.go | 3 +- {app => pkg/app}/target.go | 5 +- {app => pkg/app}/tunnel.go | 5 +- {app => pkg/app}/utils.go | 0 {app => pkg/app}/version.go | 0 {cache => pkg/cache}/cache.go | 3 +- pkg/cache/go.mod | 38 ++ pkg/cache/go.sum | 72 +++ {cache => pkg/cache}/jetstream_cache.go | 5 +- {cache => pkg/cache}/jetstream_cache_test.go | 3 +- {cache => pkg/cache}/nats_cache.go | 5 +- {cache => pkg/cache}/oc_cache.go | 10 +- {cache => pkg/cache}/oc_cache_test.go | 0 {cache => pkg/cache}/options.go | 0 {cache => pkg/cache}/redis_cache.go | 6 +- {config => pkg/config}/actions.go | 2 +- {config => pkg/config}/api_server.go | 2 +- {config => pkg/config}/clustering.go | 0 {config => pkg/config}/config.go | 16 +- {config => pkg/config}/config_test.go | 5 +- {config => pkg/config}/diff.go | 4 +- {config => pkg/config}/environment.go | 0 {config => pkg/config}/gnmi_server.go | 4 +- {config => pkg/config}/inputs.go | 4 +- {config => pkg/config}/loader.go | 4 +- {config => pkg/config}/locker.go | 4 +- {config => pkg/config}/outputs.go | 4 +- {config => pkg/config}/outputs_test.go | 0 {config => pkg/config}/processors.go | 2 +- {config => pkg/config}/processors_test.go | 0 {config => pkg/config}/set.go | 13 +- {config => pkg/config}/set_test.go | 3 +- {config => pkg/config}/subscriptions.go | 4 +- {config => pkg/config}/subscriptions_test.go | 7 +- {config => pkg/config}/targets.go | 3 +- {config => pkg/config}/targets_test.go | 3 +- {config => pkg/config}/tunnel_server.go | 5 +- {utils => pkg/file}/file.go | 68 +-- pkg/formatters/all/all.go | 33 ++ {formatters => pkg/formatters}/event.go | 5 +- .../event_add_tag/event_add_tag.go | 6 +- .../event_add_tag/event_add_tag_test.go | 2 +- .../formatters}/event_allow/event_allow.go | 6 +- .../event_allow/event_allow_test.go | 2 +- .../event_combine/event_combine.go | 6 +- .../event_combine_test/event_combine_test.go | 4 +- .../event_convert/event_convert.go | 6 +- .../event_convert/event_convert_test.go | 2 +- .../event_data_convert/event_data_convert.go | 6 +- .../event_data_convert_test.go | 2 +- .../event_date_string/event_date_string.go | 6 +- .../event_date_string_test.go | 2 +- .../formatters}/event_delete/event_delete.go | 6 +- .../event_delete/event_delete_test.go | 2 +- .../formatters}/event_drop/event_drop.go | 6 +- .../formatters}/event_drop/event_drop_test.go | 2 +- .../event_duration_convert.go | 6 +- .../event_duration_convert_test.go | 2 +- .../event_extract_tags/event_extract_tags.go | 6 +- .../event_extract_tags_test.go | 2 +- .../event_group_by/event_group_by.go | 6 +- .../event_group_by/event_group_by_test.go | 2 +- .../formatters}/event_jq/event_jq.go | 6 +- .../formatters}/event_jq/event_jq_test.go | 4 +- .../formatters}/event_merge/event_merge.go | 6 +- .../event_merge/event_merge_test.go | 2 +- .../event_override_ts/event_override_ts.go | 6 +- .../event_override_ts_test.go | 2 +- .../event_rate_limit/event_rate_limit.go | 6 +- .../event_rate_limit/event_rate_limit_test.go | 52 +- .../formatters}/event_starlark/dict.go | 0 .../formatters}/event_starlark/event.go | 3 +- .../event_starlark/event_starlark.go | 6 +- .../event_starlark/event_starlark_test.go | 2 +- .../event_strings/event_strings.go | 6 +- .../event_strings/event_strings_test.go | 2 +- {formatters => pkg/formatters}/event_test.go | 0 .../formatters}/event_to_tag/event_to_tag.go | 6 +- .../event_to_tag/event_to_tag_test.go | 2 +- .../event_trigger/event_trigger.go | 16 +- .../event_trigger/event_trigger_test.go | 4 +- .../event_value_tag/event_value_tag.go | 6 +- .../event_value_tag/event_value_tag_test.go | 2 +- .../formatters}/event_write/event_write.go | 6 +- .../event_write/event_write_test.go | 2 +- {formatters => pkg/formatters}/flat.go | 11 +- {formatters => pkg/formatters}/formats.go | 3 +- {formatters => pkg/formatters}/json.go | 39 +- {formatters => pkg/formatters}/msg.go | 0 {formatters => pkg/formatters}/processors.go | 2 +- .../formatters}/processors_test.go | 0 {utils => pkg/gtemplate}/template.go | 2 +- pkg/gtemplate/template_funcs.go | 31 ++ {inputs => pkg/inputs}/all/all.go | 6 +- {inputs => pkg/inputs}/input.go | 4 +- .../inputs}/kafka_input/kafka_input.go | 13 +- .../inputs}/kafka_input/kafka_scram_client.go | 0 .../inputs}/nats_input/nats_input.go | 13 +- .../inputs}/stan_input/stan_input.go | 13 +- {actions => pkg/loaders}/all/all.go | 8 +- .../loaders}/consul_loader/consul_loader.go | 14 +- .../consul_loader/consul_loader_metrics.go | 0 .../loaders}/consul_loader/options.go | 2 +- .../loaders}/docker_loader/docker_loader.go | 21 +- .../docker_loader/docker_loader_metrics.go | 0 .../loaders}/docker_loader/options.go | 2 +- .../loaders}/file_loader/file_loader.go | 17 +- .../file_loader/file_loader_metrics.go | 0 .../loaders}/file_loader/options.go | 2 +- .../loaders}/http_loader/http_loader.go | 20 +- .../http_loader/http_loader_metrics.go | 0 .../loaders}/http_loader/options.go | 2 +- {loaders => pkg/loaders}/loaders.go | 3 +- {loaders => pkg/loaders}/loaders_test.go | 3 +- {loaders => pkg/loaders}/option.go | 3 +- {lockers => pkg/lockers}/all/all.go | 6 +- .../lockers}/consul_locker/consul_locker.go | 5 +- .../consul_locker/consul_registration.go | 3 +- .../lockers}/k8s_locker/k8s_locker.go | 14 +- .../lockers}/k8s_locker/k8s_registration.go | 3 +- {lockers => pkg/lockers}/locker.go | 0 .../lockers}/redis_locker/redis_locker.go | 5 +- .../redis_locker/redis_registration.go | 3 +- pkg/outputs/all/all.go | 25 + .../outputs}/asciigraph_output/asciigraph.go | 14 +- {outputs => pkg/outputs}/file/file_metrics.go | 0 {outputs => pkg/outputs}/file/file_output.go | 16 +- .../outputs}/gnmi_output/gnmi_output.go | 21 +- .../outputs}/gnmi_output/gnmi_server.go | 11 +- .../outputs}/gnmi_output/gnmi_server_get.go | 10 +- .../outputs}/gnmi_output/gnmi_server_set.go | 9 +- .../gnmi_output/gnmi_server_subscribe.go | 5 +- .../influxdb_output/influxdb_cache.go | 7 +- .../influxdb_output/influxdb_output.go | 17 +- .../outputs}/kafka_output/kafka_metrics.go | 0 .../outputs}/kafka_output/kafka_output.go | 17 +- .../kafka_output/kafka_scram_client.go | 0 .../jetstream/jetstream_output.go | 17 +- .../jetstream/jetstream_output_metrics.go | 0 .../nats_outputs/nats/nats_metrics.go | 0 .../outputs}/nats_outputs/nats/nats_output.go | 17 +- .../nats_outputs/stan/stan_metrics.go | 0 .../outputs}/nats_outputs/stan/stan_output.go | 15 +- {outputs => pkg/outputs}/options.go | 2 +- {outputs => pkg/outputs}/output.go | 13 +- .../prometheus_output/prometheus_common.go | 2 +- .../prometheus_common_test.go | 2 +- .../prometheus_output/prometheus_cache.go | 2 +- .../prometheus_output/prometheus_metrics.go | 0 .../prometheus_output/prometheus_output.go | 15 +- .../prometheus_service_registration.go | 3 +- .../prometheus_write_client.go | 2 +- .../prometheus_write_metrics.go | 0 .../prometheus_write_output.go | 16 +- {outputs => pkg/outputs}/protometa.go | 0 .../outputs}/snmp_output/snmp_metrics.go | 0 .../outputs}/snmp_output/snmp_output.go | 21 +- .../outputs}/tcp_output/tcp_output.go | 15 +- .../outputs}/udp_output/udp_output.go | 15 +- pkg/path/go.mod | 22 + pkg/path/go.sum | 25 + {utils => pkg/path}/path.go | 57 ++- {utils => pkg/path}/path_test.go | 4 +- pkg/target/go.mod | 30 ++ pkg/target/go.sum | 44 ++ {target => pkg/target}/subscribe.go | 0 {target => pkg/target}/target.go | 9 +- pkg/testutils/go.mod | 19 + pkg/testutils/go.sum | 25 + {testutils => pkg/testutils}/utils.go | 0 pkg/types/go.mod | 23 + pkg/types/go.sum | 36 ++ {types => pkg/types}/sasl.go | 0 {types => pkg/types}/subscription.go | 0 {types => pkg/types}/target.go | 2 +- {types => pkg/types}/tls.go | 0 pkg/utils/go.mod | 5 + pkg/utils/go.sum | 2 + {utils => pkg/utils}/tls.go | 66 ++- {utils => pkg/utils}/utils.go | 58 --- {utils => pkg/utils}/utils_test.go | 0 utils/template_funcs.go | 23 - 251 files changed, 1840 insertions(+), 764 deletions(-) delete mode 100644 formatters/all/all.go create mode 100644 go.work create mode 100644 go.work.sum delete mode 100644 outputs/all/all.go rename {actions => pkg/actions}/action.go (98%) rename {loaders => pkg/actions}/all/all.go (67%) rename {actions => pkg/actions}/gnmi_action/gnmi_action.go (95%) rename {actions => pkg/actions}/gnmi_action/gnmi_action_test.go (98%) rename {actions => pkg/actions}/gnmi_action/options.go (91%) rename {actions => pkg/actions}/http_action/http_action.go (97%) rename {actions => pkg/actions}/http_action/http_action_test.go (98%) rename {actions => pkg/actions}/script_action/options.go (91%) rename {actions => pkg/actions}/script_action/script_action.go (98%) rename {actions => pkg/actions}/template_action/options.go (91%) rename {actions => pkg/actions}/template_action/template_action.go (91%) rename {api => pkg/api}/gnmi_msgs.go (98%) rename {api => pkg/api}/gnmi_msgs_test.go (99%) create mode 100644 pkg/api/go.mod create mode 100644 pkg/api/go.sum rename {api => pkg/api}/target.go (98%) rename {api => pkg/api}/target_test.go (98%) rename {api => pkg/api}/tunnel.go (100%) rename {api => pkg/api}/tunnel_test.go (99%) rename {app => pkg/app}/api.go (99%) rename {app => pkg/app}/app.go (98%) rename {app => pkg/app}/capabilities.go (98%) rename {app => pkg/app}/clustering.go (99%) rename {app => pkg/app}/clustering_test.go (98%) rename {app => pkg/app}/collector.go (97%) rename {app => pkg/app}/const.go (100%) rename {app => pkg/app}/diff.go (98%) rename {app => pkg/app}/generate.go (99%) rename {app => pkg/app}/generatePath.go (100%) rename {app => pkg/app}/get.go (98%) rename {app => pkg/app}/getset.go (97%) rename {app => pkg/app}/gnmi_client.go (98%) rename {app => pkg/app}/gnmi_client_subscribe.go (98%) rename {app => pkg/app}/gnmi_server.go (99%) rename {app => pkg/app}/inputs.go (94%) rename {app => pkg/app}/loaders.go (98%) rename {app => pkg/app}/locker.go (100%) rename {app => pkg/app}/logging.go (100%) rename {app => pkg/app}/metrics.go (100%) rename {app => pkg/app}/outputs.go (96%) rename {app => pkg/app}/path.go (98%) rename {app => pkg/app}/path_test.go (100%) rename {app => pkg/app}/prompt.go (100%) rename {app => pkg/app}/routes.go (100%) rename {app => pkg/app}/set-to-notifs.go (100%) rename {app => pkg/app}/set.go (98%) rename {app => pkg/app}/setrequest.go (100%) rename {app => pkg/app}/subscribe.go (98%) rename {app => pkg/app}/subscribe_once.go (100%) rename {app => pkg/app}/subscribe_poll.go (100%) rename {app => pkg/app}/subscribe_prompt.go (97%) rename {app => pkg/app}/target.go (97%) rename {app => pkg/app}/tunnel.go (98%) rename {app => pkg/app}/utils.go (100%) rename {app => pkg/app}/version.go (100%) rename {cache => pkg/cache}/cache.go (99%) create mode 100644 pkg/cache/go.mod create mode 100644 pkg/cache/go.sum rename {cache => pkg/cache}/jetstream_cache.go (99%) rename {cache => pkg/cache}/jetstream_cache_test.go (99%) rename {cache => pkg/cache}/nats_cache.go (99%) rename {cache => pkg/cache}/oc_cache.go (97%) rename {cache => pkg/cache}/oc_cache_test.go (100%) rename {cache => pkg/cache}/options.go (100%) rename {cache => pkg/cache}/redis_cache.go (99%) rename {config => pkg/config}/actions.go (97%) rename {config => pkg/config}/api_server.go (98%) rename {config => pkg/config}/clustering.go (100%) rename {config => pkg/config}/config.go (99%) rename {config => pkg/config}/config_test.go (99%) rename {config => pkg/config}/diff.go (94%) rename {config => pkg/config}/environment.go (100%) rename {config => pkg/config}/gnmi_server.go (99%) rename {config => pkg/config}/inputs.go (95%) rename {config => pkg/config}/loader.go (93%) rename {config => pkg/config}/locker.go (92%) rename {config => pkg/config}/outputs.go (97%) rename {config => pkg/config}/outputs_test.go (100%) rename {config => pkg/config}/processors.go (97%) rename {config => pkg/config}/processors_test.go (100%) rename {config => pkg/config}/set.go (95%) rename {config => pkg/config}/set_test.go (99%) rename {config => pkg/config}/subscriptions.go (99%) rename {config => pkg/config}/subscriptions_test.go (99%) rename {config => pkg/config}/targets.go (99%) rename {config => pkg/config}/targets_test.go (99%) rename {config => pkg/config}/tunnel_server.go (97%) rename {utils => pkg/file}/file.go (83%) create mode 100644 pkg/formatters/all/all.go rename {formatters => pkg/formatters}/event.go (98%) rename {formatters => pkg/formatters}/event_add_tag/event_add_tag.go (97%) rename {formatters => pkg/formatters}/event_add_tag/event_add_tag_test.go (99%) rename {formatters => pkg/formatters}/event_allow/event_allow.go (97%) rename {formatters => pkg/formatters}/event_allow/event_allow_test.go (99%) rename {formatters => pkg/formatters}/event_combine/event_combine.go (97%) rename {formatters => pkg/formatters}/event_combine/event_combine_test/event_combine_test.go (97%) rename {formatters => pkg/formatters}/event_convert/event_convert.go (98%) rename {formatters => pkg/formatters}/event_convert/event_convert_test.go (99%) rename {formatters => pkg/formatters}/event_data_convert/event_data_convert.go (98%) rename {formatters => pkg/formatters}/event_data_convert/event_data_convert_test.go (99%) rename {formatters => pkg/formatters}/event_date_string/event_date_string.go (97%) rename {formatters => pkg/formatters}/event_date_string/event_date_string_test.go (98%) rename {formatters => pkg/formatters}/event_delete/event_delete.go (96%) rename {formatters => pkg/formatters}/event_delete/event_delete_test.go (99%) rename {formatters => pkg/formatters}/event_drop/event_drop.go (97%) rename {formatters => pkg/formatters}/event_drop/event_drop_test.go (98%) rename {formatters => pkg/formatters}/event_duration_convert/event_duration_convert.go (97%) rename {formatters => pkg/formatters}/event_duration_convert/event_duration_convert_test.go (99%) rename {formatters => pkg/formatters}/event_extract_tags/event_extract_tags.go (97%) rename {formatters => pkg/formatters}/event_extract_tags/event_extract_tags_test.go (99%) rename {formatters => pkg/formatters}/event_group_by/event_group_by.go (96%) rename {formatters => pkg/formatters}/event_group_by/event_group_by_test.go (99%) rename {formatters => pkg/formatters}/event_jq/event_jq.go (97%) rename {formatters => pkg/formatters}/event_jq/event_jq_test.go (99%) rename {formatters => pkg/formatters}/event_merge/event_merge.go (95%) rename {formatters => pkg/formatters}/event_merge/event_merge_test.go (99%) rename {formatters => pkg/formatters}/event_override_ts/event_override_ts.go (95%) rename {formatters => pkg/formatters}/event_override_ts/event_override_ts_test.go (98%) rename {formatters => pkg/formatters}/event_rate_limit/event_rate_limit.go (96%) rename {formatters => pkg/formatters}/event_rate_limit/event_rate_limit_test.go (88%) rename {formatters => pkg/formatters}/event_starlark/dict.go (100%) rename {formatters => pkg/formatters}/event_starlark/event.go (99%) rename {formatters => pkg/formatters}/event_starlark/event_starlark.go (97%) rename {formatters => pkg/formatters}/event_starlark/event_starlark_test.go (99%) rename {formatters => pkg/formatters}/event_strings/event_strings.go (98%) rename {formatters => pkg/formatters}/event_strings/event_strings_test.go (99%) rename {formatters => pkg/formatters}/event_test.go (100%) rename {formatters => pkg/formatters}/event_to_tag/event_to_tag.go (96%) rename {formatters => pkg/formatters}/event_to_tag/event_to_tag_test.go (98%) rename {formatters => pkg/formatters}/event_trigger/event_trigger.go (95%) rename {formatters => pkg/formatters}/event_trigger/event_trigger_test.go (98%) rename {formatters => pkg/formatters}/event_value_tag/event_value_tag.go (95%) rename {formatters => pkg/formatters}/event_value_tag/event_value_tag_test.go (99%) rename {formatters => pkg/formatters}/event_write/event_write.go (97%) rename {formatters => pkg/formatters}/event_write/event_write_test.go (99%) rename {formatters => pkg/formatters}/flat.go (87%) rename {formatters => pkg/formatters}/formats.go (99%) rename {formatters => pkg/formatters}/json.go (88%) rename {formatters => pkg/formatters}/msg.go (100%) rename {formatters => pkg/formatters}/processors.go (98%) rename {formatters => pkg/formatters}/processors_test.go (100%) rename {utils => pkg/gtemplate}/template.go (98%) create mode 100644 pkg/gtemplate/template_funcs.go rename {inputs => pkg/inputs}/all/all.go (74%) rename {inputs => pkg/inputs}/input.go (94%) rename {inputs => pkg/inputs}/kafka_input/kafka_input.go (98%) rename {inputs => pkg/inputs}/kafka_input/kafka_scram_client.go (100%) rename {inputs => pkg/inputs}/nats_input/nats_input.go (97%) rename {inputs => pkg/inputs}/stan_input/stan_input.go (97%) rename {actions => pkg/loaders}/all/all.go (67%) rename {loaders => pkg/loaders}/consul_loader/consul_loader.go (98%) rename {loaders => pkg/loaders}/consul_loader/consul_loader_metrics.go (100%) rename {loaders => pkg/loaders}/consul_loader/options.go (95%) rename {loaders => pkg/loaders}/docker_loader/docker_loader.go (97%) rename {loaders => pkg/loaders}/docker_loader/docker_loader_metrics.go (100%) rename {loaders => pkg/loaders}/docker_loader/options.go (95%) rename {loaders => pkg/loaders}/file_loader/file_loader.go (96%) rename {loaders => pkg/loaders}/file_loader/file_loader_metrics.go (100%) rename {loaders => pkg/loaders}/file_loader/options.go (95%) rename {loaders => pkg/loaders}/http_loader/http_loader.go (96%) rename {loaders => pkg/loaders}/http_loader/http_loader_metrics.go (100%) rename {loaders => pkg/loaders}/http_loader/options.go (95%) rename {loaders => pkg/loaders}/loaders.go (98%) rename {loaders => pkg/loaders}/loaders_test.go (98%) rename {loaders => pkg/loaders}/option.go (96%) rename {lockers => pkg/lockers}/all/all.go (73%) rename {lockers => pkg/lockers}/consul_locker/consul_locker.go (98%) rename {lockers => pkg/lockers}/consul_locker/consul_registration.go (99%) rename {lockers => pkg/lockers}/k8s_locker/k8s_locker.go (99%) rename {lockers => pkg/lockers}/k8s_locker/k8s_registration.go (99%) rename {lockers => pkg/lockers}/locker.go (100%) rename {lockers => pkg/lockers}/redis_locker/redis_locker.go (98%) rename {lockers => pkg/lockers}/redis_locker/redis_registration.go (99%) create mode 100644 pkg/outputs/all/all.go rename {outputs => pkg/outputs}/asciigraph_output/asciigraph.go (97%) rename {outputs => pkg/outputs}/file/file_metrics.go (100%) rename {outputs => pkg/outputs}/file/file_output.go (95%) rename {outputs => pkg/outputs}/gnmi_output/gnmi_output.go (95%) rename {outputs => pkg/outputs}/gnmi_output/gnmi_server.go (99%) rename {outputs => pkg/outputs}/gnmi_output/gnmi_server_get.go (98%) rename {outputs => pkg/outputs}/gnmi_output/gnmi_server_set.go (96%) rename {outputs => pkg/outputs}/gnmi_output/gnmi_server_subscribe.go (99%) rename {outputs => pkg/outputs}/influxdb_output/influxdb_cache.go (94%) rename {outputs => pkg/outputs}/influxdb_output/influxdb_output.go (97%) rename {outputs => pkg/outputs}/kafka_output/kafka_metrics.go (100%) rename {outputs => pkg/outputs}/kafka_output/kafka_output.go (97%) rename {outputs => pkg/outputs}/kafka_output/kafka_scram_client.go (100%) rename {outputs => pkg/outputs}/nats_outputs/jetstream/jetstream_output.go (98%) rename {outputs => pkg/outputs}/nats_outputs/jetstream/jetstream_output_metrics.go (100%) rename {outputs => pkg/outputs}/nats_outputs/nats/nats_metrics.go (100%) rename {outputs => pkg/outputs}/nats_outputs/nats/nats_output.go (96%) rename {outputs => pkg/outputs}/nats_outputs/stan/stan_metrics.go (100%) rename {outputs => pkg/outputs}/nats_outputs/stan/stan_output.go (97%) rename {outputs => pkg/outputs}/options.go (97%) rename {outputs => pkg/outputs}/output.go (96%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_common.go (98%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_common_test.go (98%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_output/prometheus_cache.go (97%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_output/prometheus_metrics.go (100%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_output/prometheus_output.go (97%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_output/prometheus_service_registration.go (99%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_write_output/prometheus_write_client.go (99%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_write_output/prometheus_write_metrics.go (100%) rename {outputs => pkg/outputs}/prometheus_output/prometheus_write_output/prometheus_write_output.go (97%) rename {outputs => pkg/outputs}/protometa.go (100%) rename {outputs => pkg/outputs}/snmp_output/snmp_metrics.go (100%) rename {outputs => pkg/outputs}/snmp_output/snmp_output.go (97%) rename {outputs => pkg/outputs}/tcp_output/tcp_output.go (95%) rename {outputs => pkg/outputs}/udp_output/udp_output.go (95%) create mode 100644 pkg/path/go.mod create mode 100644 pkg/path/go.sum rename {utils => pkg/path}/path.go (79%) rename {utils => pkg/path}/path_test.go (99%) create mode 100644 pkg/target/go.mod create mode 100644 pkg/target/go.sum rename {target => pkg/target}/subscribe.go (100%) rename {target => pkg/target}/target.go (99%) create mode 100644 pkg/testutils/go.mod create mode 100644 pkg/testutils/go.sum rename {testutils => pkg/testutils}/utils.go (100%) create mode 100644 pkg/types/go.mod create mode 100644 pkg/types/go.sum rename {types => pkg/types}/sasl.go (100%) rename {types => pkg/types}/subscription.go (100%) rename {types => pkg/types}/target.go (99%) rename {types => pkg/types}/tls.go (100%) create mode 100644 pkg/utils/go.mod create mode 100644 pkg/utils/go.sum rename {utils => pkg/utils}/tls.go (76%) rename {utils => pkg/utils}/utils.go (60%) rename {utils => pkg/utils}/utils_test.go (100%) delete mode 100644 utils/template_funcs.go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bae5eaf1..fcdb2d75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,13 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.GOVER }} - - run: go test -cover ./... + - run: | + go test -cover ./... + go test -cover ./pkg/utils + go test -cover ./pkg/target + go test -cover ./pkg/path + go test -cover ./pkg/cache + go test -cover ./pkg/api env: CGO_ENABLED: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e3bf0da..3dfee85f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,13 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.GOVER }} - - run: go test -cover ./... + - run: | + go test -cover ./... + go test -cover ./pkg/utils + go test -cover ./pkg/target + go test -cover ./pkg/path + go test -cover ./pkg/cache + go test -cover ./pkg/api env: CGO_ENABLED: 0 # run staticcheck diff --git a/cmd/listen.go b/cmd/listen.go index 03681647..af568a5a 100644 --- a/cmd/listen.go +++ b/cmd/listen.go @@ -22,8 +22,8 @@ import ( "github.com/jhump/protoreflect/dynamic" nokiasros "github.com/karimra/sros-dialout" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/utils" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cobra" "google.golang.org/grpc" diff --git a/cmd/prompt.go b/cmd/prompt.go index 68993ec9..566d75e0 100644 --- a/cmd/prompt.go +++ b/cmd/prompt.go @@ -25,7 +25,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" ) var colorMapping = map[string]goprompt.Color{ diff --git a/cmd/root.go b/cmd/root.go index 7900b997..f2726604 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -16,7 +16,7 @@ import ( "os/signal" "syscall" - "github.com/openconfig/gnmic/app" + "github.com/openconfig/gnmic/pkg/app" "github.com/spf13/cobra" ) diff --git a/docs/user_guide/golang_package/examples/capabilities.md b/docs/user_guide/golang_package/examples/capabilities.md index 77f0bb2c..b42b7ec5 100644 --- a/docs/user_guide/golang_package/examples/capabilities.md +++ b/docs/user_guide/golang_package/examples/capabilities.md @@ -9,7 +9,7 @@ import ( "fmt" "log" - "github.com/openconfig/gnmic/api" + "github.com/openconfig/gnmic/pkg/api" "google.golang.org/protobuf/encoding/prototext" ) diff --git a/docs/user_guide/golang_package/examples/get.md b/docs/user_guide/golang_package/examples/get.md index 3a1fe290..94b28d55 100644 --- a/docs/user_guide/golang_package/examples/get.md +++ b/docs/user_guide/golang_package/examples/get.md @@ -9,7 +9,7 @@ import ( "fmt" "log" - "github.com/openconfig/gnmic/api" + "github.com/openconfig/gnmic/pkg/api" "google.golang.org/protobuf/encoding/prototext" ) diff --git a/docs/user_guide/golang_package/examples/set.md b/docs/user_guide/golang_package/examples/set.md index a133a613..6656c1b3 100644 --- a/docs/user_guide/golang_package/examples/set.md +++ b/docs/user_guide/golang_package/examples/set.md @@ -9,7 +9,7 @@ import ( "fmt" "log" - "github.com/openconfig/gnmic/api" + "github.com/openconfig/gnmic/pkg/api" "google.golang.org/protobuf/encoding/prototext" ) diff --git a/docs/user_guide/golang_package/examples/subscribe.md b/docs/user_guide/golang_package/examples/subscribe.md index 95b413fe..d243b522 100644 --- a/docs/user_guide/golang_package/examples/subscribe.md +++ b/docs/user_guide/golang_package/examples/subscribe.md @@ -11,7 +11,7 @@ import ( "log" "time" - "github.com/openconfig/gnmic/api" + "github.com/openconfig/gnmic/pkg/api" "google.golang.org/protobuf/encoding/prototext" ) diff --git a/examples/pkg/capabilities_rpc/main.go b/examples/pkg/capabilities_rpc/main.go index 01556e09..75a542e8 100644 --- a/examples/pkg/capabilities_rpc/main.go +++ b/examples/pkg/capabilities_rpc/main.go @@ -13,8 +13,9 @@ import ( "fmt" "log" - "github.com/openconfig/gnmic/api" "google.golang.org/protobuf/encoding/prototext" + + "github.com/openconfig/gnmic/pkg/api" ) func main() { diff --git a/examples/pkg/get_rpc/main.go b/examples/pkg/get_rpc/main.go index a5e012d5..69895cd0 100644 --- a/examples/pkg/get_rpc/main.go +++ b/examples/pkg/get_rpc/main.go @@ -13,8 +13,9 @@ import ( "fmt" "log" - "github.com/openconfig/gnmic/api" "google.golang.org/protobuf/encoding/prototext" + + "github.com/openconfig/gnmic/pkg/api" ) func main() { diff --git a/examples/pkg/set_rpc/main.go b/examples/pkg/set_rpc/main.go index 955121b3..1d7b66d6 100644 --- a/examples/pkg/set_rpc/main.go +++ b/examples/pkg/set_rpc/main.go @@ -13,8 +13,9 @@ import ( "fmt" "log" - "github.com/openconfig/gnmic/api" "google.golang.org/protobuf/encoding/prototext" + + "github.com/openconfig/gnmic/pkg/api" ) func main() { diff --git a/examples/pkg/subscribe_rpc/main.go b/examples/pkg/subscribe_rpc/main.go index b5911357..3b4c4cf9 100644 --- a/examples/pkg/subscribe_rpc/main.go +++ b/examples/pkg/subscribe_rpc/main.go @@ -14,8 +14,9 @@ import ( "log" "time" - "github.com/openconfig/gnmic/api" "google.golang.org/protobuf/encoding/prototext" + + "github.com/openconfig/gnmic/pkg/api" ) func main() { diff --git a/formatters/all/all.go b/formatters/all/all.go deleted file mode 100644 index 4b7e9d8b..00000000 --- a/formatters/all/all.go +++ /dev/null @@ -1,33 +0,0 @@ -// © 2022 Nokia. -// -// This code is a Contribution to the gNMIc project (“Work”) made under the Google Software Grant and Corporate Contributor License Agreement (“CLA”) and governed by the Apache License 2.0. -// No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. -// This code is provided on an “as is” basis without any warranties of any kind. -// -// SPDX-License-Identifier: Apache-2.0 - -package all - -import ( - _ "github.com/openconfig/gnmic/formatters/event_add_tag" - _ "github.com/openconfig/gnmic/formatters/event_allow" - _ "github.com/openconfig/gnmic/formatters/event_combine" - _ "github.com/openconfig/gnmic/formatters/event_convert" - _ "github.com/openconfig/gnmic/formatters/event_data_convert" - _ "github.com/openconfig/gnmic/formatters/event_date_string" - _ "github.com/openconfig/gnmic/formatters/event_delete" - _ "github.com/openconfig/gnmic/formatters/event_drop" - _ "github.com/openconfig/gnmic/formatters/event_duration_convert" - _ "github.com/openconfig/gnmic/formatters/event_extract_tags" - _ "github.com/openconfig/gnmic/formatters/event_group_by" - _ "github.com/openconfig/gnmic/formatters/event_jq" - _ "github.com/openconfig/gnmic/formatters/event_merge" - _ "github.com/openconfig/gnmic/formatters/event_override_ts" - _ "github.com/openconfig/gnmic/formatters/event_rate_limit" - _ "github.com/openconfig/gnmic/formatters/event_starlark" - _ "github.com/openconfig/gnmic/formatters/event_strings" - _ "github.com/openconfig/gnmic/formatters/event_to_tag" - _ "github.com/openconfig/gnmic/formatters/event_trigger" - _ "github.com/openconfig/gnmic/formatters/event_value_tag" - _ "github.com/openconfig/gnmic/formatters/event_write" -) diff --git a/go.mod b/go.mod index 1b81f35c..2032f43e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,16 @@ module github.com/openconfig/gnmic -go 1.21 +go 1.21.1 + +replace ( + github.com/openconfig/gnmic/pkg/api => ./pkg/api + github.com/openconfig/gnmic/pkg/cache => ./pkg/cache + github.com/openconfig/gnmic/pkg/path => ./pkg/path + github.com/openconfig/gnmic/pkg/target => ./pkg/target + github.com/openconfig/gnmic/pkg/testutils => ./pkg/testutils + github.com/openconfig/gnmic/pkg/types => ./pkg/types + github.com/openconfig/gnmic/pkg/utils => ./pkg/utils +) require ( github.com/Shopify/sarama v1.38.1 @@ -10,10 +20,9 @@ require ( github.com/docker/docker v24.0.7+incompatible github.com/fsnotify/fsnotify v1.6.0 github.com/fullstorydev/grpcurl v1.8.7 - github.com/go-redis/redis/v8 v8.11.5 github.com/go-redsync/redsync/v4 v4.10.0 github.com/go-resty/resty/v2 v2.7.0 - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.3.1 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 @@ -27,7 +36,7 @@ require ( github.com/influxdata/influxdb-client-go/v2 v2.12.3 github.com/itchyny/gojq v0.12.13 github.com/jellydator/ttlcache/v3 v3.1.0 - github.com/jhump/protoreflect v1.15.1 + github.com/jhump/protoreflect v1.15.3 github.com/jlaffaye/ftp v0.2.0 github.com/karimra/go-map-flattener v0.0.1 github.com/karimra/sros-dialout v0.0.0-20200518085040-c759bf74063a @@ -39,6 +48,13 @@ require ( github.com/nsf/termbox-go v1.1.1 github.com/olekukonko/tablewriter v0.0.5 github.com/openconfig/gnmi v0.10.0 + github.com/openconfig/gnmic/pkg/api v0.0.0 + github.com/openconfig/gnmic/pkg/cache v0.0.0 + github.com/openconfig/gnmic/pkg/path v0.33.0 + github.com/openconfig/gnmic/pkg/target v0.33.0 + github.com/openconfig/gnmic/pkg/testutils v0.33.0 + github.com/openconfig/gnmic/pkg/types v0.33.0 + github.com/openconfig/gnmic/pkg/utils v0.33.0 github.com/openconfig/goyang v1.4.2 github.com/openconfig/ygot v0.29.2 github.com/pkg/sftp v1.13.6 @@ -52,7 +68,6 @@ require ( github.com/xdg/scram v1.0.5 go.starlark.net v0.0.0-20230612165344-9532f5667272 golang.org/x/crypto v0.14.0 - golang.org/x/oauth2 v0.12.0 golang.org/x/sync v0.3.0 google.golang.org/grpc v1.59.0 google.golang.org/protobuf v1.31.0 @@ -81,7 +96,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.5 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v1.26.10 // indirect github.com/bcicen/bfstree v1.0.0 // indirect - github.com/bufbuild/protocompile v0.5.1 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/derekparker/trie v0.0.0-20221221181808-1424fce0c981 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -90,6 +105,7 @@ require ( github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/gofuzz v1.2.0 // indirect @@ -128,6 +144,7 @@ require ( go.uber.org/atomic v1.11.0 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/mod v0.11.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/tools v0.10.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect @@ -222,11 +239,11 @@ require ( github.com/mattn/go-runewidth v0.0.14 // indirect github.com/mattn/go-tty v0.0.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect - github.com/nats-io/nats-server/v2 v2.10.4 + github.com/nats-io/nats-server/v2 v2.10.4 // indirect github.com/nats-io/nats-streaming-server v0.24.3 // indirect github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/openconfig/grpctunnel v0.0.0-20220819142823-6f5422b8ca70 + github.com/openconfig/grpctunnel v0.1.0 github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect @@ -250,7 +267,7 @@ require ( go4.org/intern v0.0.0-20230205224052-192e9f60865c // indirect go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect gocloud.dev v0.25.1-0.20220408200107-09b10f7359f7 // indirect - golang.org/x/net v0.17.0 + golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 golang.org/x/time v0.3.0 // indirect diff --git a/go.sum b/go.sum index b873c875..7ed777fd 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/c-bata/go-prompt v0.2.5 h1:3zg6PecEywxNn0xiqcXHD96fkbxghD+gdB2tbsYfl+Y= github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= @@ -249,7 +249,6 @@ github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4r github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -501,8 +500,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE= github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk= github.com/google/go-replayers/httpreplay v1.1.1 h1:H91sIMlt1NZzN7R+/ASswyouLJfW0WLW7fhyUFvDEkY= @@ -758,8 +757,8 @@ github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7 github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= github.com/jhump/protoreflect v1.12.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jlaffaye/ftp v0.2.0 h1:lXNvW7cBu7R/68bknOX3MrRIIqZ61zELs1P2RAiA3lg= github.com/jlaffaye/ftp v0.2.0/go.mod h1:is2Ds5qkhceAPy2xD6RLI6hmp/qysSoymZ+Z2uTnspI= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -958,8 +957,8 @@ github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NT github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU= github.com/openconfig/goyang v1.4.2 h1:inJe/BwVSBIhDN003MVKPUNeLDlLPJrvNV+ZsXdKNxc= github.com/openconfig/goyang v1.4.2/go.mod h1:vX61x01Q46AzbZUzG617vWqh/cB+aisc+RrNkXRd3W8= -github.com/openconfig/grpctunnel v0.0.0-20220819142823-6f5422b8ca70 h1:t6SvvdfWCMlw0XPlsdxO8EgO+q/fXnTevDjdYREKFwU= -github.com/openconfig/grpctunnel v0.0.0-20220819142823-6f5422b8ca70/go.mod h1:OmTWe7RyZj2CIzIgy4ovEBzCLBJzRvWSZmn7u02U9gU= +github.com/openconfig/grpctunnel v0.1.0 h1:EN99qtlExZczgQgp5ANnHRC/Rs62cAG+Tz2BQ5m/maM= +github.com/openconfig/grpctunnel v0.1.0/go.mod h1:G04Pdu0pml98tdvXrvLaU+EBo3PxYfI9MYqpvdaEHLo= github.com/openconfig/ygot v0.6.0/go.mod h1:o30svNf7O0xK+R35tlx95odkDmZWS9JyWWQSmIhqwAs= github.com/openconfig/ygot v0.29.2 h1:K0cRipc6LluVEQv6+/CCyr8dJuAI9PHhOFtgJHwhCjI= github.com/openconfig/ygot v0.29.2/go.mod h1:i0wozoTfFxK7SuMBHhAigyl6+e2BTCb1QYsFW9NLmjQ= @@ -1334,8 +1333,8 @@ golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= -golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1423,7 +1422,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1669,7 +1667,6 @@ google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210811021853-ddbe55d93216/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= diff --git a/go.work b/go.work new file mode 100644 index 00000000..2f03fc80 --- /dev/null +++ b/go.work @@ -0,0 +1,12 @@ +go 1.21.1 + +use ( + . + ./pkg/api + ./pkg/cache + ./pkg/path + ./pkg/target + ./pkg/testutils + ./pkg/types + ./pkg/utils +) diff --git a/go.work.sum b/go.work.sum new file mode 100644 index 00000000..f8c3b549 --- /dev/null +++ b/go.work.sum @@ -0,0 +1,480 @@ +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= +cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go/accessapproval v1.7.1/go.mod h1:JYczztsHRMK7NTXb6Xw+dwbs/WnOJxbo/2mTI+Kgg68= +cloud.google.com/go/accesscontextmanager v1.8.1/go.mod h1:JFJHfvuaTC+++1iL1coPiG1eu5D24db2wXCDWDjIrxo= +cloud.google.com/go/aiplatform v1.48.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= +cloud.google.com/go/analytics v0.21.3/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= +cloud.google.com/go/apigateway v1.6.1/go.mod h1:ufAS3wpbRjqfZrzpvLC2oh0MFlpRJm2E/ts25yyqmXA= +cloud.google.com/go/apigeeconnect v1.6.1/go.mod h1:C4awq7x0JpLtrlQCr8AzVIzAaYgngRqWf9S5Uhg+wWs= +cloud.google.com/go/apigeeregistry v0.7.1/go.mod h1:1XgyjZye4Mqtw7T9TsY4NW10U7BojBvG4RMD+vRDrIw= +cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= +cloud.google.com/go/appengine v1.8.1/go.mod h1:6NJXGLVhZCN9aQ/AEDvmfzKEfoYBlfB80/BHiKVputY= +cloud.google.com/go/area120 v0.8.1/go.mod h1:BVfZpGpB7KFVNxPiQBuHkX6Ed0rS51xIgmGyjrAfzsg= +cloud.google.com/go/artifactregistry v1.14.1/go.mod h1:nxVdG19jTaSTu7yA7+VbWL346r3rIdkZ142BSQqhn5E= +cloud.google.com/go/asset v1.14.1/go.mod h1:4bEJ3dnHCqWCDbWJ/6Vn7GVI9LerSi7Rfdi03hd+WTQ= +cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= +cloud.google.com/go/automl v1.13.1/go.mod h1:1aowgAHWYZU27MybSCFiukPO7xnyawv7pt3zK4bheQE= +cloud.google.com/go/baremetalsolution v1.1.1/go.mod h1:D1AV6xwOksJMV4OSlWHtWuFNZZYujJknMAP4Qa27QIA= +cloud.google.com/go/batch v1.3.1/go.mod h1:VguXeQKXIYaeeIYbuozUmBR13AfL4SJP7IltNPS+A4A= +cloud.google.com/go/beyondcorp v1.0.0/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= +cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= +cloud.google.com/go/billing v1.16.0/go.mod h1:y8vx09JSSJG02k5QxbycNRrN7FGZB6F3CAcgum7jvGA= +cloud.google.com/go/binaryauthorization v1.6.1/go.mod h1:TKt4pa8xhowwffiBmbrbcxijJRZED4zrqnwZ1lKH51U= +cloud.google.com/go/certificatemanager v1.7.1/go.mod h1:iW8J3nG6SaRYImIa+wXQ0g8IgoofDFRp5UMzaNk1UqI= +cloud.google.com/go/channel v1.16.0/go.mod h1:eN/q1PFSl5gyu0dYdmxNXscY/4Fi7ABmeHCJNf/oHmc= +cloud.google.com/go/cloudbuild v1.13.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= +cloud.google.com/go/clouddms v1.6.1/go.mod h1:Ygo1vL52Ov4TBZQquhz5fiw2CQ58gvu+PlS6PVXCpZI= +cloud.google.com/go/cloudtasks v1.12.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= +cloud.google.com/go/container v1.24.0/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= +cloud.google.com/go/containeranalysis v0.10.1/go.mod h1:Ya2jiILITMY68ZLPaogjmOMNkwsDrWBSTyBubGXO7j0= +cloud.google.com/go/datacatalog v1.16.0/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= +cloud.google.com/go/dataflow v0.9.1/go.mod h1:Wp7s32QjYuQDWqJPFFlnBKhkAtiFpMTdg00qGbnIHVw= +cloud.google.com/go/dataform v0.8.1/go.mod h1:3BhPSiw8xmppbgzeBbmDvmSWlwouuJkXsXsb8UBih9M= +cloud.google.com/go/datafusion v1.7.1/go.mod h1:KpoTBbFmoToDExJUso/fcCiguGDk7MEzOWXUsJo0wsI= +cloud.google.com/go/datalabeling v0.8.1/go.mod h1:XS62LBSVPbYR54GfYQsPXZjTW8UxCK2fkDciSrpRFdY= +cloud.google.com/go/dataplex v1.9.0/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= +cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= +cloud.google.com/go/dataproc/v2 v2.0.1/go.mod h1:7Ez3KRHdFGcfY7GcevBbvozX+zyWGcwLJvvAMwCaoZ4= +cloud.google.com/go/dataqna v0.8.1/go.mod h1:zxZM0Bl6liMePWsHA8RMGAfmTG34vJMapbHAxQ5+WA8= +cloud.google.com/go/datastore v1.13.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= +cloud.google.com/go/datastream v1.10.0/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= +cloud.google.com/go/deploy v1.13.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= +cloud.google.com/go/dialogflow v1.40.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= +cloud.google.com/go/dlp v1.10.1/go.mod h1:IM8BWz1iJd8njcNcG0+Kyd9OPnqnRNkDV8j42VT5KOI= +cloud.google.com/go/documentai v1.22.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= +cloud.google.com/go/domains v0.9.1/go.mod h1:aOp1c0MbejQQ2Pjf1iJvnVyT+z6R6s8pX66KaCSDYfE= +cloud.google.com/go/edgecontainer v1.1.1/go.mod h1:O5bYcS//7MELQZs3+7mabRqoWQhXCzenBu0R8bz2rwk= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.6.2/go.mod h1:T2tB6tX+TRak7i88Fb2N9Ok3PvY3UNbUsMag9/BARh4= +cloud.google.com/go/eventarc v1.13.0/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= +cloud.google.com/go/filestore v1.7.1/go.mod h1:y10jsorq40JJnjR/lQ8AfFbbcGlw3g+Dp8oN7i7FjV4= +cloud.google.com/go/firestore v1.12.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= +cloud.google.com/go/functions v1.15.1/go.mod h1:P5yNWUTkyU+LvW/S9O6V+V423VZooALQlqoXdoPz5AE= +cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= +cloud.google.com/go/gkebackup v1.3.0/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= +cloud.google.com/go/gkeconnect v0.8.1/go.mod h1:KWiK1g9sDLZqhxB2xEuPV8V9NYzrqTUmQR9shJHpOZw= +cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY= +cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= +cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= +cloud.google.com/go/iap v1.8.1/go.mod h1:sJCbeqg3mvWLqjZNsI6dfAtbbV1DL2Rl7e1mTyXYREQ= +cloud.google.com/go/ids v1.4.1/go.mod h1:np41ed8YMU8zOgv53MMMoCntLTn2lF+SUzlM+O3u/jw= +cloud.google.com/go/iot v1.7.1/go.mod h1:46Mgw7ev1k9KqK1ao0ayW9h0lI+3hxeanz+L1zmbbbk= +cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= +cloud.google.com/go/language v1.10.1/go.mod h1:CPp94nsdVNiQEt1CNjF5WkTcisLiHPyIbMhvR8H2AW0= +cloud.google.com/go/lifesciences v0.9.1/go.mod h1:hACAOd1fFbCGLr/+weUKRAJas82Y4vrL3O5326N//Wc= +cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= +cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= +cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc= +cloud.google.com/go/managedidentities v1.6.1/go.mod h1:h/irGhTN2SkZ64F43tfGPMbHnypMbu4RB3yl8YcuEak= +cloud.google.com/go/maps v1.4.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= +cloud.google.com/go/mediatranslation v0.8.1/go.mod h1:L/7hBdEYbYHQJhX2sldtTO5SZZ1C1vkapubj0T2aGig= +cloud.google.com/go/memcache v1.10.1/go.mod h1:47YRQIarv4I3QS5+hoETgKO40InqzLP6kpNLvyXuyaA= +cloud.google.com/go/metastore v1.12.0/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= +cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= +cloud.google.com/go/networkconnectivity v1.12.1/go.mod h1:PelxSWYM7Sh9/guf8CFhi6vIqf19Ir/sbfZRUwXh92E= +cloud.google.com/go/networkmanagement v1.8.0/go.mod h1:Ho/BUGmtyEqrttTgWEe7m+8vDdK74ibQc+Be0q7Fof0= +cloud.google.com/go/networksecurity v0.9.1/go.mod h1:MCMdxOKQ30wsBI1eI659f9kEp4wuuAueoC9AJKSPWZQ= +cloud.google.com/go/notebooks v1.9.1/go.mod h1:zqG9/gk05JrzgBt4ghLzEepPHNwE5jgPcHZRKhlC1A8= +cloud.google.com/go/optimization v1.4.1/go.mod h1:j64vZQP7h9bO49m2rVaTVoNM0vEBEN5eKPUPbZyXOrk= +cloud.google.com/go/orchestration v1.8.1/go.mod h1:4sluRF3wgbYVRqz7zJ1/EUNc90TTprliq9477fGobD8= +cloud.google.com/go/orgpolicy v1.11.1/go.mod h1:8+E3jQcpZJQliP+zaFfayC2Pg5bmhuLK755wKhIIUCE= +cloud.google.com/go/osconfig v1.12.1/go.mod h1:4CjBxND0gswz2gfYRCUoUzCm9zCABp91EeTtWXyz0tE= +cloud.google.com/go/oslogin v1.10.1/go.mod h1:x692z7yAue5nE7CsSnoG0aaMbNoRJRXO4sn73R+ZqAs= +cloud.google.com/go/phishingprotection v0.8.1/go.mod h1:AxonW7GovcA8qdEk13NfHq9hNx5KPtfxXNeUxTDxB6I= +cloud.google.com/go/policytroubleshooter v1.8.0/go.mod h1:tmn5Ir5EToWe384EuboTcVQT7nTag2+DuH3uHmKd1HU= +cloud.google.com/go/privatecatalog v0.9.1/go.mod h1:0XlDXW2unJXdf9zFz968Hp35gl/bhF4twwpXZAW50JA= +cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= +cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0= +cloud.google.com/go/recaptchaenterprise/v2 v2.7.2/go.mod h1:kR0KjsJS7Jt1YSyWFkseQ756D45kaYNTlDPPaRAvDBU= +cloud.google.com/go/recommendationengine v0.8.1/go.mod h1:MrZihWwtFYWDzE6Hz5nKcNz3gLizXVIDI/o3G1DLcrE= +cloud.google.com/go/recommender v1.10.1/go.mod h1:XFvrE4Suqn5Cq0Lf+mCP6oBHD/yRMA8XxP5sb7Q7gpA= +cloud.google.com/go/redis v1.13.1/go.mod h1:VP7DGLpE91M6bcsDdMuyCm2hIpB6Vp2hI090Mfd1tcg= +cloud.google.com/go/resourcemanager v1.9.1/go.mod h1:dVCuosgrh1tINZ/RwBufr8lULmWGOkPS8gL5gqyjdT8= +cloud.google.com/go/resourcesettings v1.6.1/go.mod h1:M7mk9PIZrC5Fgsu1kZJci6mpgN8o0IUzVx3eJU3y4Jw= +cloud.google.com/go/retail v1.14.1/go.mod h1:y3Wv3Vr2k54dLNIrCzenyKG8g8dhvhncT2NcNjb/6gE= +cloud.google.com/go/run v1.2.0/go.mod h1:36V1IlDzQ0XxbQjUx6IYbw8H3TJnWvhii963WW3B/bo= +cloud.google.com/go/scheduler v1.10.1/go.mod h1:R63Ldltd47Bs4gnhQkmNDse5w8gBRrhObZ54PxgR2Oo= +cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= +cloud.google.com/go/security v1.15.1/go.mod h1:MvTnnbsWnehoizHi09zoiZob0iCHVcL4AUBj76h9fXA= +cloud.google.com/go/securitycenter v1.23.0/go.mod h1:8pwQ4n+Y9WCWM278R8W3nF65QtY172h4S8aXyI9/hsQ= +cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= +cloud.google.com/go/servicedirectory v1.11.0/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= +cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= +cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= +cloud.google.com/go/shell v1.7.1/go.mod h1:u1RaM+huXFaTojTbW4g9P5emOrrmLE69KrxqQahKn4g= +cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI= +cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= +cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA= +cloud.google.com/go/talent v1.6.2/go.mod h1:CbGvmKCG61mkdjcqTcLOkb2ZN1SrQI8MDyma2l7VD24= +cloud.google.com/go/texttospeech v1.7.1/go.mod h1:m7QfG5IXxeneGqTapXNxv2ItxP/FS0hCZBwXYqucgSk= +cloud.google.com/go/tpu v1.6.1/go.mod h1:sOdcHVIgDEEOKuqUoi6Fq53MKHJAtOwtz0GuKsWSH3E= +cloud.google.com/go/trace v1.10.1/go.mod h1:gbtL94KE5AJLH3y+WVpfWILmqgc6dXcqgNXdOPAQTYk= +cloud.google.com/go/translate v1.8.2/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= +cloud.google.com/go/video v1.19.0/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= +cloud.google.com/go/videointelligence v1.11.1/go.mod h1:76xn/8InyQHarjTWsBR058SmlPCwQjgcvoW0aZykOvo= +cloud.google.com/go/vision/v2 v2.7.2/go.mod h1:jKa8oSYBWhYiXarHPvP4USxYANYUEdEsQrloLjrSwJU= +cloud.google.com/go/vmmigration v1.7.1/go.mod h1:WD+5z7a/IpZ5bKK//YmT9E047AD+rjycCAvyMxGJbro= +cloud.google.com/go/vmwareengine v1.0.0/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= +cloud.google.com/go/vpcaccess v1.7.1/go.mod h1:FogoD46/ZU+JUBX9D606X21EnxiszYi2tArQwLY4SXs= +cloud.google.com/go/webrisk v1.9.1/go.mod h1:4GCmXKcOa2BZcZPn6DCEvE7HypmEJcJkr4mtM+sqYPc= +cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv5/rGpFCsBOvPbYgszpg= +cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= +github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1/go.mod h1:DffdKW9RFqa5VgmsjUOsS7UE7eiA5iAvYUs63bhKQ0M= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= +github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= +github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/aws/aws-sdk-go v1.44.206/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.276/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= +github.com/digitalocean/godo v1.99.0/go.mod h1:SsS2oXo2rznfM/nORlZ/6JaUJZFhmKTib1YhopUc8NA= +github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= +github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= +github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/gophercloud/gophercloud v1.4.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= +github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= +github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-msgpack v1.1.5/go.mod h1:gWVc3sv/wbDmR3rQsj1CAktEZzoz1YNK9NfGLXJ69/4= +github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/nomad/api v0.0.0-20230605233119-67e39d5d248f/go.mod h1:Xjd3OXUTfsWbCCBsQd3EdfPTz5evDi+fxqdvpN+WqQg= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hetznercloud/hcloud-go v1.45.1/go.mod h1:aAUGxSfSnB8/lVXHNEDxtCT1jykaul8kqjD7f5KQXF8= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/ionos-cloud/sdk-go/v6 v6.1.7/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/linode/linodego v1.17.0/go.mod h1:/omzPxie0/YI6S0sTw1q47qDt5IYSlbO/infRR4UG+A= +github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/ovh/go-ovh v1.4.1/go.mod h1:6bL6pPyUT7tBfI0pqOegJgRjgjuO+mOo+MyXd1EEC0M= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/prometheus/alertmanager v0.25.0/go.mod h1:MEZ3rFVHqKZsw7IcNS/m4AWZeXThmJhumpiWR4eHU/w= +github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI= +github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= +github.com/prometheus/exporter-toolkit v0.10.0/go.mod h1:+sVFzuvV5JDyw+Ih6p3zFxZNVnKQa3x5qPmDSiPu4ZY= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/protocolbuffers/txtpbfmt v0.0.0-20220608084003-fc78c767cd6a/go.mod h1:KjY0wibdYKc4DYkerHSbguaf3JeIPGhNJBp2BNiFH78= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= +github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= +github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0/go.mod h1:XiYsayHc36K3EByOO6nbAXnAWbrUxdjUROCEeeROOH8= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0/go.mod h1:vLarbg68dH2Wa77g71zmKQqlQ8+8Rq3GRG31uc0WcWI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0/go.mod h1:JgXSGah17croqhJfhByOLVY719k1emAXC8MVhCIJlRs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0/go.mod h1:I33vtIe0sR96wfrUcilIzLoA3mLHhRmz9S9Te0S3gDo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0/go.mod h1:hGXzO5bhhSHZnKvrDaXB82Y9DRFour0Nz/KrBh7reWw= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20190424220101-1e8e1cfdf96b/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220527130721-00d5c0f3be58/go.mod h1:yKyY4AMRwFiC8yMMNaMi+RkCnjZJt9LoWuvhXjMs+To= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= +google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= +google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q= +google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= +google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.51.0-dev/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= +k8s.io/api v0.27.3/go.mod h1:C4BNvZnQOF7JA/0Xed2S+aUyJSfTGkGFxLXz9MnpIpg= +k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= +k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= +k8s.io/client-go v0.27.3/go.mod h1:2MBEKuTo6V1lbKy3z1euEGnhPfGZLKTS9tiJ2xodM48= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/outputs/all/all.go b/outputs/all/all.go deleted file mode 100644 index 80ce0bb5..00000000 --- a/outputs/all/all.go +++ /dev/null @@ -1,25 +0,0 @@ -// © 2022 Nokia. -// -// This code is a Contribution to the gNMIc project (“Work”) made under the Google Software Grant and Corporate Contributor License Agreement (“CLA”) and governed by the Apache License 2.0. -// No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. -// This code is provided on an “as is” basis without any warranties of any kind. -// -// SPDX-License-Identifier: Apache-2.0 - -package all - -import ( - _ "github.com/openconfig/gnmic/outputs/asciigraph_output" - _ "github.com/openconfig/gnmic/outputs/file" - _ "github.com/openconfig/gnmic/outputs/gnmi_output" - _ "github.com/openconfig/gnmic/outputs/influxdb_output" - _ "github.com/openconfig/gnmic/outputs/kafka_output" - _ "github.com/openconfig/gnmic/outputs/nats_outputs/jetstream" - _ "github.com/openconfig/gnmic/outputs/nats_outputs/nats" - _ "github.com/openconfig/gnmic/outputs/nats_outputs/stan" - _ "github.com/openconfig/gnmic/outputs/prometheus_output/prometheus_output" - _ "github.com/openconfig/gnmic/outputs/prometheus_output/prometheus_write_output" - _ "github.com/openconfig/gnmic/outputs/snmp_output" - _ "github.com/openconfig/gnmic/outputs/tcp_output" - _ "github.com/openconfig/gnmic/outputs/udp_output" -) diff --git a/actions/action.go b/pkg/actions/action.go similarity index 98% rename from actions/action.go rename to pkg/actions/action.go index d79db38f..86377b3c 100644 --- a/actions/action.go +++ b/pkg/actions/action.go @@ -13,7 +13,7 @@ import ( "log" "github.com/mitchellh/mapstructure" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" ) type Action interface { diff --git a/loaders/all/all.go b/pkg/actions/all/all.go similarity index 67% rename from loaders/all/all.go rename to pkg/actions/all/all.go index d0f2f2ec..23dbc89e 100644 --- a/loaders/all/all.go +++ b/pkg/actions/all/all.go @@ -9,8 +9,8 @@ package all import ( - _ "github.com/openconfig/gnmic/loaders/consul_loader" - _ "github.com/openconfig/gnmic/loaders/docker_loader" - _ "github.com/openconfig/gnmic/loaders/file_loader" - _ "github.com/openconfig/gnmic/loaders/http_loader" + _ "github.com/openconfig/gnmic/pkg/actions/gnmi_action" + _ "github.com/openconfig/gnmic/pkg/actions/http_action" + _ "github.com/openconfig/gnmic/pkg/actions/script_action" + _ "github.com/openconfig/gnmic/pkg/actions/template_action" ) diff --git a/actions/gnmi_action/gnmi_action.go b/pkg/actions/gnmi_action/gnmi_action.go similarity index 95% rename from actions/gnmi_action/gnmi_action.go rename to pkg/actions/gnmi_action/gnmi_action.go index 6964e296..63e549e0 100644 --- a/actions/gnmi_action/gnmi_action.go +++ b/pkg/actions/gnmi_action/gnmi_action.go @@ -20,14 +20,17 @@ import ( "sync" "text/template" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/api" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "gopkg.in/yaml.v2" + + "github.com/openconfig/gnmi/proto/gnmi" + + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/api" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -262,11 +265,11 @@ func (g *gnmiAction) validate() error { func (g *gnmiAction) parseTemplates() error { var err error - g.target, err = utils.CreateTemplate(fmt.Sprintf("%s-target", g.Name), g.Target) + g.target, err = gtemplate.CreateTemplate(fmt.Sprintf("%s-target", g.Name), g.Target) if err != nil { return err } - g.prefix, err = utils.CreateTemplate(fmt.Sprintf("%s-prefix", g.Name), g.Prefix) + g.prefix, err = gtemplate.CreateTemplate(fmt.Sprintf("%s-prefix", g.Name), g.Prefix) if err != nil { return err } @@ -281,7 +284,7 @@ func (g *gnmiAction) parseTemplates() error { func (g *gnmiAction) createTemplates(n string, s []string) ([]*template.Template, error) { tpls := make([]*template.Template, 0, len(s)) for i, p := range s { - tpl, err := utils.CreateTemplate(fmt.Sprintf("%s-%s-%d", g.Name, n, i), p) + tpl, err := gtemplate.CreateTemplate(fmt.Sprintf("%s-%s-%d", g.Name, n, i), p) if err != nil { return nil, err } diff --git a/actions/gnmi_action/gnmi_action_test.go b/pkg/actions/gnmi_action/gnmi_action_test.go similarity index 98% rename from actions/gnmi_action/gnmi_action_test.go rename to pkg/actions/gnmi_action/gnmi_action_test.go index 85a425f5..b9dd2efb 100644 --- a/actions/gnmi_action/gnmi_action_test.go +++ b/pkg/actions/gnmi_action/gnmi_action_test.go @@ -12,9 +12,10 @@ import ( "testing" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/testutils" + + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/testutils" ) type getRequestTestItem struct { diff --git a/actions/gnmi_action/options.go b/pkg/actions/gnmi_action/options.go similarity index 91% rename from actions/gnmi_action/options.go rename to pkg/actions/gnmi_action/options.go index cd111dbe..5e1324c9 100644 --- a/actions/gnmi_action/options.go +++ b/pkg/actions/gnmi_action/options.go @@ -12,8 +12,8 @@ import ( "log" "os" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (g *gnmiAction) WithTargets(tcs map[string]*types.TargetConfig) { diff --git a/actions/http_action/http_action.go b/pkg/actions/http_action/http_action.go similarity index 97% rename from actions/http_action/http_action.go rename to pkg/actions/http_action/http_action.go index b48ef753..93d9c5f7 100644 --- a/actions/http_action/http_action.go +++ b/pkg/actions/http_action/http_action.go @@ -22,10 +22,10 @@ import ( "text/template" "time" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/actions/http_action/http_action_test.go b/pkg/actions/http_action/http_action_test.go similarity index 98% rename from actions/http_action/http_action_test.go rename to pkg/actions/http_action/http_action_test.go index f5a17a8b..d0a6d03c 100644 --- a/actions/http_action/http_action_test.go +++ b/pkg/actions/http_action/http_action_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/utils" ) type item struct { diff --git a/actions/script_action/options.go b/pkg/actions/script_action/options.go similarity index 91% rename from actions/script_action/options.go rename to pkg/actions/script_action/options.go index 8c828a85..337b3fa1 100644 --- a/actions/script_action/options.go +++ b/pkg/actions/script_action/options.go @@ -12,8 +12,8 @@ import ( "log" "os" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (s *scriptAction) WithTargets(map[string]*types.TargetConfig) {} diff --git a/actions/script_action/script_action.go b/pkg/actions/script_action/script_action.go similarity index 98% rename from actions/script_action/script_action.go rename to pkg/actions/script_action/script_action.go index 6db5b3eb..85b92715 100644 --- a/actions/script_action/script_action.go +++ b/pkg/actions/script_action/script_action.go @@ -18,7 +18,7 @@ import ( "os/exec" "strings" - "github.com/openconfig/gnmic/actions" + "github.com/openconfig/gnmic/pkg/actions" ) const ( diff --git a/actions/template_action/options.go b/pkg/actions/template_action/options.go similarity index 91% rename from actions/template_action/options.go rename to pkg/actions/template_action/options.go index 9b5d59c7..a0c3ab5e 100644 --- a/actions/template_action/options.go +++ b/pkg/actions/template_action/options.go @@ -12,8 +12,8 @@ import ( "log" "os" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (t *templateAction) WithTargets(map[string]*types.TargetConfig) {} diff --git a/actions/template_action/template_action.go b/pkg/actions/template_action/template_action.go similarity index 91% rename from actions/template_action/template_action.go rename to pkg/actions/template_action/template_action.go index 608e8efd..a8751d24 100644 --- a/actions/template_action/template_action.go +++ b/pkg/actions/template_action/template_action.go @@ -17,8 +17,8 @@ import ( "os" "text/template" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/gtemplate" ) const ( @@ -63,7 +63,7 @@ func (t *templateAction) Init(cfg map[string]interface{}, opts ...actions.Option return err } if t.Template != "" { - t.tpl, err = utils.CreateTemplate(fmt.Sprintf("%s-template-action", t.Name), t.Template) + t.tpl, err = gtemplate.CreateTemplate(fmt.Sprintf("%s-template-action", t.Name), t.Template) if err != nil { return err } @@ -72,7 +72,7 @@ func (t *templateAction) Init(cfg map[string]interface{}, opts ...actions.Option if err != nil { return err } - t.tpl = t.tpl.Funcs(utils.NewTemplateEngine().CreateFuncs()). + t.tpl = t.tpl.Funcs(gtemplate.NewTemplateEngine().CreateFuncs()). Option("missingkey=zero") } t.logger.Printf("action name %q of type %q initialized: %v", t.Name, actionType, t) diff --git a/api/gnmi_msgs.go b/pkg/api/gnmi_msgs.go similarity index 98% rename from api/gnmi_msgs.go rename to pkg/api/gnmi_msgs.go index 1ca83413..191b7a02 100644 --- a/api/gnmi_msgs.go +++ b/pkg/api/gnmi_msgs.go @@ -20,8 +20,8 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/proto/gnmi_ext" gvalue "github.com/openconfig/gnmi/value" - "github.com/openconfig/gnmic/utils" "google.golang.org/protobuf/proto" + "github.com/openconfig/gnmic/pkg/path" ) const ( @@ -360,23 +360,23 @@ func Prefix(prefix string) func(msg proto.Message) error { var err error switch msg := msg.ProtoReflect().Interface().(type) { case *gnmi.GetRequest: - msg.Prefix, err = utils.CreatePrefix(prefix, "") + msg.Prefix, err = path.CreatePrefix(prefix, "") case *gnmi.SetRequest: - msg.Prefix, err = utils.CreatePrefix(prefix, "") + msg.Prefix, err = path.CreatePrefix(prefix, "") case *gnmi.SetResponse: - msg.Prefix, err = utils.CreatePrefix(prefix, "") + msg.Prefix, err = path.CreatePrefix(prefix, "") case *gnmi.SubscribeRequest: switch msg := msg.Request.(type) { case *gnmi.SubscribeRequest_Subscribe: if msg.Subscribe == nil { msg.Subscribe = new(gnmi.SubscriptionList) } - msg.Subscribe.Prefix, err = utils.CreatePrefix(prefix, "") + msg.Subscribe.Prefix, err = path.CreatePrefix(prefix, "") default: return fmt.Errorf("option Prefix: %w: %T", ErrInvalidMsgType, msg) } case *gnmi.Notification: - msg.Prefix, err = utils.CreatePrefix(prefix, "") + msg.Prefix, err = path.CreatePrefix(prefix, "") default: return fmt.Errorf("option Prefix: %w: %T", ErrInvalidMsgType, msg) } @@ -431,7 +431,7 @@ func Target(target string) func(msg proto.Message) error { // Path creates a GNMIOption that creates a *gnmi.Path and adds it to the supplied proto.Message // which can be a *gnmi.GetRequest, *gnmi.SetRequest or a *gnmi.Subscription. -func Path(path string) func(msg proto.Message) error { +func Path(p string) func(msg proto.Message) error { return func(msg proto.Message) error { if msg == nil { return ErrInvalidMsgType @@ -439,26 +439,26 @@ func Path(path string) func(msg proto.Message) error { var err error switch msg := msg.ProtoReflect().Interface().(type) { case *gnmi.GetRequest: - p, err := utils.ParsePath(path) + gp, err := path.ParsePath(p) if err != nil { return fmt.Errorf("%w: %v", ErrInvalidValue, err) } if len(msg.Path) == 0 { msg.Path = make([]*gnmi.Path, 0) } - msg.Path = append(msg.Path, p) + msg.Path = append(msg.Path, gp) case *gnmi.Update: - msg.Path, err = utils.ParsePath(path) + msg.Path, err = path.ParsePath(p) if err != nil { return fmt.Errorf("%w: %v", ErrInvalidValue, err) } case *gnmi.UpdateResult: - msg.Path, err = utils.ParsePath(path) + msg.Path, err = path.ParsePath(p) if err != nil { return fmt.Errorf("%w: %v", ErrInvalidValue, err) } case *gnmi.Subscription: - msg.Path, err = utils.ParsePath(path) + msg.Path, err = path.ParsePath(p) if err != nil { return fmt.Errorf("%w: %v", ErrInvalidValue, err) } @@ -903,30 +903,30 @@ func value(data interface{}, encoding string) (*gnmi.TypedValue, error) { // Delete creates a GNMIOption that creates a *gnmi.Path and adds it to the supplied proto.Message. // the supplied message must be a *gnmi.SetRequest. The *gnmi.Path is added the .Delete list. -func Delete(path string) func(msg proto.Message) error { +func Delete(p string) func(msg proto.Message) error { return func(msg proto.Message) error { if msg == nil { return ErrInvalidMsgType } switch msg := msg.ProtoReflect().Interface().(type) { case *gnmi.SetRequest: - p, err := utils.ParsePath(path) + gp, err := path.ParsePath(p) if err != nil { return fmt.Errorf("%w: %v", ErrInvalidValue, err) } if len(msg.Delete) == 0 { msg.Delete = make([]*gnmi.Path, 0) } - msg.Delete = append(msg.Delete, p) + msg.Delete = append(msg.Delete, gp) case *gnmi.Notification: - p, err := utils.ParsePath(path) + gp, err := path.ParsePath(p) if err != nil { return fmt.Errorf("%w: %v", ErrInvalidValue, err) } if len(msg.Delete) == 0 { msg.Delete = make([]*gnmi.Path, 0) } - msg.Delete = append(msg.Delete, p) + msg.Delete = append(msg.Delete, gp) default: return fmt.Errorf("option Delete: %w: %T", ErrInvalidMsgType, msg) } diff --git a/api/gnmi_msgs_test.go b/pkg/api/gnmi_msgs_test.go similarity index 99% rename from api/gnmi_msgs_test.go rename to pkg/api/gnmi_msgs_test.go index 22b0c5e0..df52fafb 100644 --- a/api/gnmi_msgs_test.go +++ b/pkg/api/gnmi_msgs_test.go @@ -17,7 +17,8 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/proto/gnmi_ext" - "github.com/openconfig/gnmic/testutils" + + "github.com/openconfig/gnmic/pkg/testutils" ) // Capabilities Request / Response tests diff --git a/pkg/api/go.mod b/pkg/api/go.mod new file mode 100644 index 00000000..7a866edb --- /dev/null +++ b/pkg/api/go.mod @@ -0,0 +1,39 @@ +module github.com/openconfig/gnmic/pkg/api + +go 1.21.1 + +replace ( + github.com/openconfig/gnmic/pkg/path => ../path + github.com/openconfig/gnmic/pkg/target => ../target + github.com/openconfig/gnmic/pkg/testutils => ../testutils + github.com/openconfig/gnmic/pkg/types => ../types + github.com/openconfig/gnmic/pkg/utils => ../utils +) + +require ( + github.com/AlekSi/pointer v1.2.0 + github.com/google/go-cmp v0.6.0 + github.com/openconfig/gnmi v0.10.0 + github.com/openconfig/gnmic/pkg/path v0.33.0 + github.com/openconfig/gnmic/pkg/target v0.33.0 + github.com/openconfig/gnmic/pkg/testutils v0.33.0 + github.com/openconfig/gnmic/pkg/types v0.33.0 + github.com/openconfig/gnmic/pkg/utils v0.33.0 // indirect + github.com/openconfig/grpctunnel v0.1.0 + google.golang.org/protobuf v1.31.0 +) + +require ( + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/jhump/protoreflect v1.15.3 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.13.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect +) diff --git a/pkg/api/go.sum b/pkg/api/go.sum new file mode 100644 index 00000000..46872075 --- /dev/null +++ b/pkg/api/go.sum @@ -0,0 +1,48 @@ +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= +github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tSNSBle0= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= +github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= +github.com/openconfig/grpctunnel v0.1.0 h1:EN99qtlExZczgQgp5ANnHRC/Rs62cAG+Tz2BQ5m/maM= +github.com/openconfig/grpctunnel v0.1.0/go.mod h1:G04Pdu0pml98tdvXrvLaU+EBo3PxYfI9MYqpvdaEHLo= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/api/target.go b/pkg/api/target.go similarity index 98% rename from api/target.go rename to pkg/api/target.go index aa7e5d77..4cebc5d8 100644 --- a/api/target.go +++ b/pkg/api/target.go @@ -14,8 +14,9 @@ import ( "time" "github.com/AlekSi/pointer" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" ) var DefaultTargetTimeout = 10 * time.Second diff --git a/api/target_test.go b/pkg/api/target_test.go similarity index 98% rename from api/target_test.go rename to pkg/api/target_test.go index 4f0af50d..a5e02218 100644 --- a/api/target_test.go +++ b/pkg/api/target_test.go @@ -13,7 +13,8 @@ import ( "github.com/AlekSi/pointer" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/types" ) type input struct { diff --git a/api/tunnel.go b/pkg/api/tunnel.go similarity index 100% rename from api/tunnel.go rename to pkg/api/tunnel.go diff --git a/api/tunnel_test.go b/pkg/api/tunnel_test.go similarity index 99% rename from api/tunnel_test.go rename to pkg/api/tunnel_test.go index 91109005..93dd206f 100644 --- a/api/tunnel_test.go +++ b/pkg/api/tunnel_test.go @@ -12,8 +12,9 @@ import ( "errors" "testing" - "github.com/openconfig/gnmic/testutils" tpb "github.com/openconfig/grpctunnel/proto/tunnel" + + "github.com/openconfig/gnmic/pkg/testutils" ) type registerOpInput struct { diff --git a/app/api.go b/pkg/app/api.go similarity index 99% rename from app/api.go rename to pkg/app/api.go index df6b0079..0204caaf 100644 --- a/app/api.go +++ b/pkg/app/api.go @@ -19,10 +19,11 @@ import ( "github.com/gorilla/handlers" "github.com/gorilla/mux" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" + + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (a *App) newAPIServer() (*http.Server, error) { diff --git a/app/app.go b/pkg/app/app.go similarity index 98% rename from app/app.go rename to pkg/app/app.go index 4b71f006..784a552e 100644 --- a/app/app.go +++ b/pkg/app/app.go @@ -26,14 +26,6 @@ import ( grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/jhump/protoreflect/desc" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/inputs" - "github.com/openconfig/gnmic/lockers" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" "github.com/openconfig/goyang/pkg/yang" "github.com/openconfig/grpctunnel/tunnel" "github.com/prometheus/client_golang/prometheus" @@ -45,6 +37,15 @@ import ( "google.golang.org/grpc/grpclog" "google.golang.org/protobuf/proto" "gopkg.in/yaml.v2" + + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/inputs" + "github.com/openconfig/gnmic/pkg/lockers" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/app/capabilities.go b/pkg/app/capabilities.go similarity index 98% rename from app/capabilities.go rename to pkg/app/capabilities.go index bd3859f1..e4e3d97a 100644 --- a/app/capabilities.go +++ b/pkg/app/capabilities.go @@ -14,10 +14,11 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/proto/gnmi_ext" - "github.com/openconfig/gnmic/types" "github.com/openconfig/grpctunnel/tunnel" "github.com/spf13/cobra" "github.com/spf13/pflag" + + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) CapPreRunE(cmd *cobra.Command, _ []string) error { diff --git a/app/clustering.go b/pkg/app/clustering.go similarity index 99% rename from app/clustering.go rename to pkg/app/clustering.go index a08b756c..42a75657 100644 --- a/app/clustering.go +++ b/pkg/app/clustering.go @@ -22,8 +22,8 @@ import ( "strings" "time" - "github.com/openconfig/gnmic/lockers" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/lockers" + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/app/clustering_test.go b/pkg/app/clustering_test.go similarity index 98% rename from app/clustering_test.go rename to pkg/app/clustering_test.go index 18023cb5..93f99dbe 100644 --- a/app/clustering_test.go +++ b/pkg/app/clustering_test.go @@ -13,7 +13,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/lockers" + + "github.com/openconfig/gnmic/pkg/lockers" ) var testSetGetInstancesTagsMatches = map[string]struct { diff --git a/app/collector.go b/pkg/app/collector.go similarity index 97% rename from app/collector.go rename to pkg/app/collector.go index 562667c6..10913d68 100644 --- a/app/collector.go +++ b/pkg/app/collector.go @@ -17,11 +17,12 @@ import ( "sync" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/app/const.go b/pkg/app/const.go similarity index 100% rename from app/const.go rename to pkg/app/const.go diff --git a/app/diff.go b/pkg/app/diff.go similarity index 98% rename from app/diff.go rename to pkg/app/diff.go index 5d331891..70d0a962 100644 --- a/app/diff.go +++ b/pkg/app/diff.go @@ -24,9 +24,9 @@ import ( "github.com/spf13/pflag" "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" ) type targetDiffResponse struct { diff --git a/app/generate.go b/pkg/app/generate.go similarity index 99% rename from app/generate.go rename to pkg/app/generate.go index 42d3beed..2da31c28 100644 --- a/app/generate.go +++ b/pkg/app/generate.go @@ -19,12 +19,13 @@ import ( "strings" "github.com/huandu/xstrings" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/utils" "github.com/openconfig/goyang/pkg/yang" "github.com/spf13/cobra" "github.com/spf13/pflag" "gopkg.in/yaml.v2" + + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/path" ) // options for formatting keys when generating yaml/json payloads @@ -458,7 +459,7 @@ func getSubMapByPath(p string, m map[string]interface{}, kopts *keyOpts) (interf return m, nil } // strip path from keys if any - gp, err := utils.ParsePath(p) + gp, err := path.ParsePath(p) if err != nil { return nil, fmt.Errorf("failed to parse xpath %q: %v", p, err) } diff --git a/app/generatePath.go b/pkg/app/generatePath.go similarity index 100% rename from app/generatePath.go rename to pkg/app/generatePath.go diff --git a/app/get.go b/pkg/app/get.go similarity index 98% rename from app/get.go rename to pkg/app/get.go index 04da61d4..032be2ec 100644 --- a/app/get.go +++ b/pkg/app/get.go @@ -15,12 +15,13 @@ import ( "strings" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" "github.com/openconfig/grpctunnel/tunnel" "github.com/spf13/cobra" "github.com/spf13/pflag" + + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) GetPreRunE(cmd *cobra.Command, args []string) error { diff --git a/app/getset.go b/pkg/app/getset.go similarity index 97% rename from app/getset.go rename to pkg/app/getset.go index a5929fd8..9ce8bbbc 100644 --- a/app/getset.go +++ b/pkg/app/getset.go @@ -16,12 +16,13 @@ import ( "github.com/itchyny/gojq" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" "github.com/openconfig/grpctunnel/tunnel" "github.com/spf13/cobra" "github.com/spf13/pflag" + + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) GetSetPreRunE(cmd *cobra.Command, args []string) error { diff --git a/app/gnmi_client.go b/pkg/app/gnmi_client.go similarity index 98% rename from app/gnmi_client.go rename to pkg/app/gnmi_client.go index fb797857..d9aa073d 100644 --- a/app/gnmi_client.go +++ b/pkg/app/gnmi_client.go @@ -14,7 +14,8 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/proto/gnmi_ext" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) ClientCapabilities(ctx context.Context, tc *types.TargetConfig, ext ...*gnmi_ext.Extension) (*gnmi.CapabilityResponse, error) { diff --git a/app/gnmi_client_subscribe.go b/pkg/app/gnmi_client_subscribe.go similarity index 98% rename from app/gnmi_client_subscribe.go rename to pkg/app/gnmi_client_subscribe.go index 8a5dd7da..27f5f802 100644 --- a/app/gnmi_client_subscribe.go +++ b/pkg/app/gnmi_client_subscribe.go @@ -21,10 +21,10 @@ import ( "github.com/openconfig/grpctunnel/tunnel" "google.golang.org/grpc" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/lockers" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/lockers" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" ) type subscriptionRequest struct { diff --git a/app/gnmi_server.go b/pkg/app/gnmi_server.go similarity index 99% rename from app/gnmi_server.go rename to pkg/app/gnmi_server.go index 314bf36e..679c2c05 100644 --- a/app/gnmi_server.go +++ b/pkg/app/gnmi_server.go @@ -23,10 +23,6 @@ import ( grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/hashicorp/consul/api" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "golang.org/x/sync/semaphore" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -34,6 +30,12 @@ import ( "google.golang.org/grpc/peer" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/path" + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) type streamClient struct { @@ -731,7 +733,7 @@ func (a *App) handlegNMIcInternalGet(ctx context.Context, req *gnmi.GetRequest) a.configLock.RLock() defer a.configLock.RUnlock() for _, p := range req.GetPath() { - elems := utils.PathElems(req.GetPrefix(), p) + elems := path.PathElems(req.GetPrefix(), p) ns, err := a.handlegNMIGetPath(elems, req.GetEncoding()) if err != nil { return nil, err diff --git a/app/inputs.go b/pkg/app/inputs.go similarity index 94% rename from app/inputs.go rename to pkg/app/inputs.go index 4af2c2d1..20ca477e 100644 --- a/app/inputs.go +++ b/pkg/app/inputs.go @@ -11,8 +11,8 @@ package app import ( "context" - "github.com/openconfig/gnmic/inputs" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/inputs" + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) InitInput(ctx context.Context, name string, tcs map[string]*types.TargetConfig) { diff --git a/app/loaders.go b/pkg/app/loaders.go similarity index 98% rename from app/loaders.go rename to pkg/app/loaders.go index 38290267..d046b5c6 100644 --- a/app/loaders.go +++ b/pkg/app/loaders.go @@ -12,7 +12,7 @@ import ( "context" "time" - "github.com/openconfig/gnmic/loaders" + "github.com/openconfig/gnmic/pkg/loaders" ) func (a *App) startLoader(ctx context.Context) { diff --git a/app/locker.go b/pkg/app/locker.go similarity index 100% rename from app/locker.go rename to pkg/app/locker.go diff --git a/app/logging.go b/pkg/app/logging.go similarity index 100% rename from app/logging.go rename to pkg/app/logging.go diff --git a/app/metrics.go b/pkg/app/metrics.go similarity index 100% rename from app/metrics.go rename to pkg/app/metrics.go diff --git a/app/outputs.go b/pkg/app/outputs.go similarity index 96% rename from app/outputs.go rename to pkg/app/outputs.go index 4bbda1b3..26cdb21b 100644 --- a/app/outputs.go +++ b/pkg/app/outputs.go @@ -12,8 +12,8 @@ import ( "context" "fmt" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) InitOutput(ctx context.Context, name string, tcs map[string]*types.TargetConfig) { diff --git a/app/path.go b/pkg/app/path.go similarity index 98% rename from app/path.go rename to pkg/app/path.go index 80c3156c..511f48b9 100644 --- a/app/path.go +++ b/pkg/app/path.go @@ -18,10 +18,11 @@ import ( "strings" "github.com/manifoldco/promptui" - "github.com/openconfig/gnmic/utils" "github.com/openconfig/goyang/pkg/yang" "github.com/spf13/cobra" "github.com/spf13/pflag" + + "github.com/openconfig/gnmic/pkg/path" ) type pathGenOpts struct { @@ -354,7 +355,7 @@ func (a *App) generatePath(entry *yang.Entry, pType string) *generatedPath { gp.IsState = isState(entry) gp.Namespace = entry.Namespace().NName() if pType == "gnmi" { - gnmiPath, err := utils.ParsePath(gp.Path) + gnmiPath, err := path.ParsePath(gp.Path) if err != nil { fmt.Fprintf(os.Stderr, "path: %s could not be changed to gnmi format: %v\n", gp.Path, err) } @@ -461,7 +462,7 @@ func isState(e *yang.Entry) bool { // collapsePrefixes removes prefixes from path element names and keys func collapsePrefixes(p string) string { - gp, err := utils.ParsePath(p) + gp, err := path.ParsePath(p) if err != nil { return p } @@ -475,7 +476,7 @@ func collapsePrefixes(p string) string { pe.Name = name } } - return fmt.Sprintf("/%s", utils.GnmiPathToXPath(gp, false)) + return fmt.Sprintf("/%s", path.GnmiPathToXPath(gp, false)) } // takes a path element name or a key name diff --git a/app/path_test.go b/pkg/app/path_test.go similarity index 100% rename from app/path_test.go rename to pkg/app/path_test.go diff --git a/app/prompt.go b/pkg/app/prompt.go similarity index 100% rename from app/prompt.go rename to pkg/app/prompt.go diff --git a/app/routes.go b/pkg/app/routes.go similarity index 100% rename from app/routes.go rename to pkg/app/routes.go diff --git a/app/set-to-notifs.go b/pkg/app/set-to-notifs.go similarity index 100% rename from app/set-to-notifs.go rename to pkg/app/set-to-notifs.go diff --git a/app/set.go b/pkg/app/set.go similarity index 98% rename from app/set.go rename to pkg/app/set.go index d15ceb13..dc5f5022 100644 --- a/app/set.go +++ b/pkg/app/set.go @@ -13,11 +13,12 @@ import ( "fmt" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/types" "github.com/openconfig/grpctunnel/tunnel" "github.com/spf13/cobra" "github.com/spf13/pflag" + + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) SetPreRunE(cmd *cobra.Command, args []string) error { diff --git a/app/setrequest.go b/pkg/app/setrequest.go similarity index 100% rename from app/setrequest.go rename to pkg/app/setrequest.go diff --git a/app/subscribe.go b/pkg/app/subscribe.go similarity index 98% rename from app/subscribe.go rename to pkg/app/subscribe.go index ba7c3e1c..267a60d6 100644 --- a/app/subscribe.go +++ b/pkg/app/subscribe.go @@ -19,12 +19,13 @@ import ( "github.com/manifoldco/promptui" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/config" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" "github.com/openconfig/grpctunnel/tunnel" "github.com/spf13/cobra" "github.com/spf13/pflag" + + "github.com/openconfig/gnmic/pkg/config" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/app/subscribe_once.go b/pkg/app/subscribe_once.go similarity index 100% rename from app/subscribe_once.go rename to pkg/app/subscribe_once.go diff --git a/app/subscribe_poll.go b/pkg/app/subscribe_poll.go similarity index 100% rename from app/subscribe_poll.go rename to pkg/app/subscribe_poll.go diff --git a/app/subscribe_prompt.go b/pkg/app/subscribe_prompt.go similarity index 97% rename from app/subscribe_prompt.go rename to pkg/app/subscribe_prompt.go index ff1b0890..34e4d5fe 100644 --- a/app/subscribe_prompt.go +++ b/pkg/app/subscribe_prompt.go @@ -12,8 +12,9 @@ import ( "fmt" "time" - "github.com/openconfig/gnmic/types" "github.com/spf13/cobra" + + "github.com/openconfig/gnmic/pkg/types" ) func (a *App) SubscribeRunPrompt(cmd *cobra.Command, args []string) error { diff --git a/app/target.go b/pkg/app/target.go similarity index 97% rename from app/target.go rename to pkg/app/target.go index 09169ea8..0b759b0a 100644 --- a/app/target.go +++ b/pkg/app/target.go @@ -13,8 +13,9 @@ import ( "fmt" "github.com/fullstorydev/grpcurl" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" ) // initTarget initializes a new target given its name. diff --git a/app/tunnel.go b/pkg/app/tunnel.go similarity index 98% rename from app/tunnel.go rename to pkg/app/tunnel.go index 9b88e864..940fbcef 100644 --- a/app/tunnel.go +++ b/pkg/app/tunnel.go @@ -18,12 +18,13 @@ import ( "time" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" tpb "github.com/openconfig/grpctunnel/proto/tunnel" "github.com/openconfig/grpctunnel/tunnel" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (a *App) initTunnelServer(tsc tunnel.ServerConfig) error { diff --git a/app/utils.go b/pkg/app/utils.go similarity index 100% rename from app/utils.go rename to pkg/app/utils.go diff --git a/app/version.go b/pkg/app/version.go similarity index 100% rename from app/version.go rename to pkg/app/version.go diff --git a/cache/cache.go b/pkg/cache/cache.go similarity index 99% rename from cache/cache.go rename to pkg/cache/cache.go index d12ba6e4..9c48d4b7 100644 --- a/cache/cache.go +++ b/pkg/cache/cache.go @@ -15,8 +15,9 @@ import ( "sync" "time" - "github.com/openconfig/gnmi/proto/gnmi" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmi/proto/gnmi" ) type CacheType string diff --git a/pkg/cache/go.mod b/pkg/cache/go.mod new file mode 100644 index 00000000..f06aa59d --- /dev/null +++ b/pkg/cache/go.mod @@ -0,0 +1,38 @@ +module github.com/openconfig/gnmic/pkg/cache + +go 1.21.1 + +replace ( + github.com/openconfig/gnmic/pkg/path => ../path + github.com/openconfig/gnmic/pkg/testutils => ../testutils + github.com/openconfig/gnmic/pkg/utils => ../utils +) + +require ( + github.com/go-redis/redis/v8 v8.11.5 + github.com/nats-io/nats-server/v2 v2.10.4 + github.com/nats-io/nats.go v1.31.0 + github.com/openconfig/gnmi v0.10.0 + github.com/openconfig/gnmic/pkg/path v0.33.0 + github.com/openconfig/gnmic/pkg/utils v0.33.0 + google.golang.org/protobuf v1.31.0 +) + +require ( + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/golang/glog v1.1.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/klauspost/compress v1.17.2 // indirect + github.com/minio/highwayhash v1.0.2 // indirect + github.com/nats-io/jwt/v2 v2.5.2 // indirect + github.com/nats-io/nkeys v0.4.6 // indirect + github.com/nats-io/nuid v1.0.1 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect +) diff --git a/pkg/cache/go.sum b/pkg/cache/go.sum new file mode 100644 index 00000000..d1562558 --- /dev/null +++ b/pkg/cache/go.sum @@ -0,0 +1,72 @@ +github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/nats-io/jwt/v2 v2.5.2 h1:DhGH+nKt+wIkDxM6qnVSKjokq5t59AZV5HRcFW0zJwU= +github.com/nats-io/jwt/v2 v2.5.2/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= +github.com/nats-io/nats-server/v2 v2.10.4 h1:uB9xcwon3tPXWAdmTJqqqC6cie3yuPWHJjjTBgaPNus= +github.com/nats-io/nats-server/v2 v2.10.4/go.mod h1:eWm2JmHP9Lqm2oemB6/XGi0/GwsZwtWf8HIPUsh+9ns= +github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= +github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= +github.com/nats-io/nkeys v0.4.6 h1:IzVe95ru2CT6ta874rt9saQRkWfe2nFj1NtvYSLqMzY= +github.com/nats-io/nkeys v0.4.6/go.mod h1:4DxZNzenSVd1cYQoAa8948QY3QDjrHfcfVADymtkpts= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= +github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= +github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea h1:5MyIz4bN4vpH6aHDN339bkWXAjTkhg1ZKMhR4aIi5Rk= +github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU= +github.com/openconfig/grpctunnel v0.1.0 h1:EN99qtlExZczgQgp5ANnHRC/Rs62cAG+Tz2BQ5m/maM= +github.com/openconfig/grpctunnel v0.1.0/go.mod h1:G04Pdu0pml98tdvXrvLaU+EBo3PxYfI9MYqpvdaEHLo= +github.com/openconfig/ygot v0.6.0 h1:kJJFPBrczC6TDnz/HMlFTJEdW2CuyUftV13XveIukg0= +github.com/openconfig/ygot v0.6.0/go.mod h1:o30svNf7O0xK+R35tlx95odkDmZWS9JyWWQSmIhqwAs= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/cache/jetstream_cache.go b/pkg/cache/jetstream_cache.go similarity index 99% rename from cache/jetstream_cache.go rename to pkg/cache/jetstream_cache.go index 9cd97760..6e521dd2 100644 --- a/cache/jetstream_cache.go +++ b/pkg/cache/jetstream_cache.go @@ -20,11 +20,12 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/utils" - "google.golang.org/protobuf/proto" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/cache/jetstream_cache_test.go b/pkg/cache/jetstream_cache_test.go similarity index 99% rename from cache/jetstream_cache_test.go rename to pkg/cache/jetstream_cache_test.go index eb74dced..38c75170 100644 --- a/cache/jetstream_cache_test.go +++ b/pkg/cache/jetstream_cache_test.go @@ -14,8 +14,9 @@ import ( "testing" "time" - "github.com/openconfig/gnmi/proto/gnmi" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmi/proto/gnmi" ) func Test_natsCache_Write(t *testing.T) { diff --git a/cache/nats_cache.go b/pkg/cache/nats_cache.go similarity index 99% rename from cache/nats_cache.go rename to pkg/cache/nats_cache.go index 66595cd4..bd820719 100644 --- a/cache/nats_cache.go +++ b/pkg/cache/nats_cache.go @@ -16,11 +16,12 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/utils" - "google.golang.org/protobuf/proto" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/cache/oc_cache.go b/pkg/cache/oc_cache.go similarity index 97% rename from cache/oc_cache.go rename to pkg/cache/oc_cache.go index 1d044326..a14feba3 100644 --- a/cache/oc_cache.go +++ b/pkg/cache/oc_cache.go @@ -23,9 +23,9 @@ import ( "github.com/openconfig/gnmi/path" "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/subscribe" + gpath "github.com/openconfig/gnmic/pkg/path" + "github.com/openconfig/gnmic/pkg/utils" "google.golang.org/protobuf/proto" - - "github.com/openconfig/gnmic/utils" ) const ( @@ -229,11 +229,11 @@ func (gc *gnmiCache) handleSingleQuery(ctx context.Context, ro *ReadOpts, ch cha ro.m = new(sync.RWMutex) } - prefix := utils.GnmiPathToXPath(gl.GetPrefix(), true) + prefix := gpath.GnmiPathToXPath(gl.GetPrefix(), true) target := gl.GetPrefix().GetTarget() for _, upd := range gl.GetUpdate() { - path := utils.GnmiPathToXPath(upd.GetPath(), true) - valXPath := strings.Join([]string{target, prefix, path}, "/") + p := gpath.GnmiPathToXPath(upd.GetPath(), true) + valXPath := strings.Join([]string{target, prefix, p}, "/") ro.m.RLock() sv, ok := ro.lastSent[valXPath] ro.m.RUnlock() diff --git a/cache/oc_cache_test.go b/pkg/cache/oc_cache_test.go similarity index 100% rename from cache/oc_cache_test.go rename to pkg/cache/oc_cache_test.go diff --git a/cache/options.go b/pkg/cache/options.go similarity index 100% rename from cache/options.go rename to pkg/cache/options.go diff --git a/cache/redis_cache.go b/pkg/cache/redis_cache.go similarity index 99% rename from cache/redis_cache.go rename to pkg/cache/redis_cache.go index 488a75c7..241b37dc 100644 --- a/cache/redis_cache.go +++ b/pkg/cache/redis_cache.go @@ -16,10 +16,12 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + redis "github.com/go-redis/redis/v8" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/utils" - "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/config/actions.go b/pkg/config/actions.go similarity index 97% rename from config/actions.go rename to pkg/config/actions.go index d15b97de..6110eb23 100644 --- a/config/actions.go +++ b/pkg/config/actions.go @@ -11,7 +11,7 @@ package config import ( "fmt" - "github.com/openconfig/gnmic/actions" + "github.com/openconfig/gnmic/pkg/actions" ) func (c *Config) GetActions() (map[string]map[string]interface{}, error) { diff --git a/config/api_server.go b/pkg/config/api_server.go similarity index 98% rename from config/api_server.go rename to pkg/config/api_server.go index 34c19c75..022d5733 100644 --- a/config/api_server.go +++ b/pkg/config/api_server.go @@ -13,7 +13,7 @@ import ( "os" "time" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/config/clustering.go b/pkg/config/clustering.go similarity index 100% rename from config/clustering.go rename to pkg/config/clustering.go diff --git a/config/config.go b/pkg/config/config.go similarity index 99% rename from config/config.go rename to pkg/config/config.go index c9285a36..31475ac0 100644 --- a/config/config.go +++ b/pkg/config/config.go @@ -22,6 +22,9 @@ import ( "text/template" "time" + "gopkg.in/natefinch/lumberjack.v2" + yaml "gopkg.in/yaml.v2" + "github.com/adrg/xdg" "github.com/itchyny/gojq" "github.com/mitchellh/go-homedir" @@ -29,12 +32,11 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - "gopkg.in/natefinch/lumberjack.v2" - yaml "gopkg.in/yaml.v2" - "github.com/openconfig/gnmic/api" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/api" + gfile "github.com/openconfig/gnmic/pkg/file" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -280,7 +282,7 @@ func (c *Config) Load(ctx context.Context) error { if c.GlobalFlags.CfgFile != "" { // configuration file path is explicitly set c.FileConfig.SetConfigFile(c.GlobalFlags.CfgFile) - configBytes, err := utils.ReadFile(ctx, c.FileConfig.ConfigFileUsed()) + configBytes, err := gfile.ReadFile(ctx, c.FileConfig.ConfigFileUsed()) if err != nil { return err } @@ -766,7 +768,7 @@ func (c *Config) CreateSetRequest(targetName string) ([]*gnmi.SetRequest, error) // readFile reads a json or yaml file. the the file is .yaml, converts it to json and returns []byte and an error func readFile(name string) ([]byte, error) { - data, err := utils.ReadFile(context.TODO(), name) + data, err := gfile.ReadFile(context.TODO(), name) if err != nil { return nil, err } diff --git a/config/config_test.go b/pkg/config/config_test.go similarity index 99% rename from config/config_test.go rename to pkg/config/config_test.go index e0cd4e05..ee6c80cb 100644 --- a/config/config_test.go +++ b/pkg/config/config_test.go @@ -16,8 +16,9 @@ import ( "testing" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/api" - "github.com/openconfig/gnmic/testutils" + + "github.com/openconfig/gnmic/pkg/api" + "github.com/openconfig/gnmic/pkg/testutils" ) var createGetRequestTestSet = map[string]struct { diff --git a/config/diff.go b/pkg/config/diff.go similarity index 94% rename from config/diff.go rename to pkg/config/diff.go index 2650ffde..a6bd6a0a 100644 --- a/config/diff.go +++ b/pkg/config/diff.go @@ -15,8 +15,8 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/spf13/cobra" - "github.com/openconfig/gnmic/api" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/api" + "github.com/openconfig/gnmic/pkg/types" ) func (c *Config) CreateDiffSubscribeRequest(cmd *cobra.Command) (*gnmi.SubscribeRequest, error) { diff --git a/config/environment.go b/pkg/config/environment.go similarity index 100% rename from config/environment.go rename to pkg/config/environment.go diff --git a/config/gnmi_server.go b/pkg/config/gnmi_server.go similarity index 99% rename from config/gnmi_server.go rename to pkg/config/gnmi_server.go index 4a4161b3..1f78e581 100644 --- a/config/gnmi_server.go +++ b/pkg/config/gnmi_server.go @@ -14,8 +14,8 @@ import ( "strconv" "time" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/config/inputs.go b/pkg/config/inputs.go similarity index 95% rename from config/inputs.go rename to pkg/config/inputs.go index d91c463a..16580e7b 100644 --- a/config/inputs.go +++ b/pkg/config/inputs.go @@ -11,8 +11,8 @@ package config import ( "fmt" - "github.com/openconfig/gnmic/inputs" - _ "github.com/openconfig/gnmic/inputs/all" + "github.com/openconfig/gnmic/pkg/inputs" + _ "github.com/openconfig/gnmic/pkg/inputs/all" ) func (c *Config) GetInputs() (map[string]map[string]interface{}, error) { diff --git a/config/loader.go b/pkg/config/loader.go similarity index 93% rename from config/loader.go rename to pkg/config/loader.go index 4363f1fd..9b936bef 100644 --- a/config/loader.go +++ b/pkg/config/loader.go @@ -12,8 +12,8 @@ import ( "errors" "fmt" - "github.com/openconfig/gnmic/loaders" - _ "github.com/openconfig/gnmic/loaders/all" + "github.com/openconfig/gnmic/pkg/loaders" + _ "github.com/openconfig/gnmic/pkg/loaders/all" ) func (c *Config) GetLoader() error { diff --git a/config/locker.go b/pkg/config/locker.go similarity index 92% rename from config/locker.go rename to pkg/config/locker.go index 75f57ba5..eba5ec80 100644 --- a/config/locker.go +++ b/pkg/config/locker.go @@ -11,8 +11,8 @@ package config import ( "errors" - "github.com/openconfig/gnmic/lockers" - _ "github.com/openconfig/gnmic/lockers/all" + "github.com/openconfig/gnmic/pkg/lockers" + _ "github.com/openconfig/gnmic/pkg/lockers/all" ) func (c *Config) getLocker() error { diff --git a/config/outputs.go b/pkg/config/outputs.go similarity index 97% rename from config/outputs.go rename to pkg/config/outputs.go index f1213225..e7cc947e 100644 --- a/config/outputs.go +++ b/pkg/config/outputs.go @@ -13,8 +13,8 @@ import ( "fmt" "sort" - "github.com/openconfig/gnmic/outputs" - _ "github.com/openconfig/gnmic/outputs/all" + "github.com/openconfig/gnmic/pkg/outputs" + _ "github.com/openconfig/gnmic/pkg/outputs/all" ) func (c *Config) GetOutputs() (map[string]map[string]interface{}, error) { diff --git a/config/outputs_test.go b/pkg/config/outputs_test.go similarity index 100% rename from config/outputs_test.go rename to pkg/config/outputs_test.go diff --git a/config/processors.go b/pkg/config/processors.go similarity index 97% rename from config/processors.go rename to pkg/config/processors.go index 980af7b5..0c5e6e14 100644 --- a/config/processors.go +++ b/pkg/config/processors.go @@ -11,7 +11,7 @@ package config import ( "fmt" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) func (c *Config) GetEventProcessors() (map[string]map[string]interface{}, error) { diff --git a/config/processors_test.go b/pkg/config/processors_test.go similarity index 100% rename from config/processors_test.go rename to pkg/config/processors_test.go diff --git a/config/set.go b/pkg/config/set.go similarity index 95% rename from config/set.go rename to pkg/config/set.go index f6d33680..d69815d9 100644 --- a/config/set.go +++ b/pkg/config/set.go @@ -19,10 +19,13 @@ import ( "strings" "text/template" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/api" - "github.com/openconfig/gnmic/utils" "gopkg.in/yaml.v2" + + "github.com/openconfig/gnmi/proto/gnmi" + + "github.com/openconfig/gnmic/pkg/api" + gfile "github.com/openconfig/gnmic/pkg/file" + "github.com/openconfig/gnmic/pkg/gtemplate" ) const ( @@ -48,7 +51,7 @@ func (c *Config) ReadSetRequestTemplate() error { } c.setRequestTemplate = make([]*template.Template, len(c.SetRequestFile)) for i, srf := range c.SetRequestFile { - b, err := utils.ReadFile(context.TODO(), srf) + b, err := gfile.ReadFile(context.TODO(), srf) if err != nil { return err } @@ -56,7 +59,7 @@ func (c *Config) ReadSetRequestTemplate() error { c.logger.Printf("set request file %d content: %s", i, string(b)) } // read template - c.setRequestTemplate[i], err = utils.CreateTemplate(fmt.Sprintf("set-request-%d", i), string(b)) + c.setRequestTemplate[i], err = gtemplate.CreateTemplate(fmt.Sprintf("set-request-%d", i), string(b)) if err != nil { return err } diff --git a/config/set_test.go b/pkg/config/set_test.go similarity index 99% rename from config/set_test.go rename to pkg/config/set_test.go index bdad7c39..0ca98879 100644 --- a/config/set_test.go +++ b/pkg/config/set_test.go @@ -14,7 +14,8 @@ import ( "text/template" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/testutils" + + "github.com/openconfig/gnmic/pkg/testutils" ) var createSetRequestFromFileTestSet = map[string]struct { diff --git a/config/subscriptions.go b/pkg/config/subscriptions.go similarity index 99% rename from config/subscriptions.go rename to pkg/config/subscriptions.go index 28858f38..0d295c3f 100644 --- a/config/subscriptions.go +++ b/pkg/config/subscriptions.go @@ -22,8 +22,8 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/spf13/cobra" - "github.com/openconfig/gnmic/api" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/api" + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/config/subscriptions_test.go b/pkg/config/subscriptions_test.go similarity index 99% rename from config/subscriptions_test.go rename to pkg/config/subscriptions_test.go index 528ebbc0..ff8eaf82 100644 --- a/config/subscriptions_test.go +++ b/pkg/config/subscriptions_test.go @@ -19,14 +19,15 @@ import ( "text/template" "time" + "google.golang.org/protobuf/encoding/prototext" + "github.com/AlekSi/pointer" "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/proto/gnmi_ext" "github.com/spf13/viper" - "google.golang.org/protobuf/encoding/prototext" - "github.com/openconfig/gnmic/testutils" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/testutils" + "github.com/openconfig/gnmic/pkg/types" ) func mustParseTime(tm string) time.Time { diff --git a/config/targets.go b/pkg/config/targets.go similarity index 99% rename from config/targets.go rename to pkg/config/targets.go index 504450bb..c3bc7329 100644 --- a/config/targets.go +++ b/pkg/config/targets.go @@ -17,7 +17,8 @@ import ( "strings" "github.com/mitchellh/mapstructure" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/types" ) const ( diff --git a/config/targets_test.go b/pkg/config/targets_test.go similarity index 99% rename from config/targets_test.go rename to pkg/config/targets_test.go index 138c2662..9d3a5568 100644 --- a/config/targets_test.go +++ b/pkg/config/targets_test.go @@ -16,7 +16,8 @@ import ( "testing" "github.com/AlekSi/pointer" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/types" ) var getTargetsTestSet = map[string]struct { diff --git a/config/tunnel_server.go b/pkg/config/tunnel_server.go similarity index 97% rename from config/tunnel_server.go rename to pkg/config/tunnel_server.go index e20b38ce..a7f09656 100644 --- a/config/tunnel_server.go +++ b/pkg/config/tunnel_server.go @@ -14,8 +14,9 @@ import ( "time" "github.com/mitchellh/mapstructure" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/utils/file.go b/pkg/file/file.go similarity index 83% rename from utils/file.go rename to pkg/file/file.go index 360f6b1e..95f7756d 100644 --- a/utils/file.go +++ b/pkg/file/file.go @@ -6,10 +6,9 @@ // // SPDX-License-Identifier: Apache-2.0 -package utils +package file import ( - "bufio" "bytes" "context" "crypto/tls" @@ -22,11 +21,13 @@ import ( "path/filepath" "strings" - "github.com/jlaffaye/ftp" - "github.com/pkg/sftp" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "golang.org/x/crypto/ssh/knownhosts" + + "github.com/jlaffaye/ftp" + "github.com/openconfig/gnmic/pkg/utils" + "github.com/pkg/sftp" ) const ( @@ -50,7 +51,7 @@ func ReadFile(ctx context.Context, path string) ([]byte, error) { case strings.HasPrefix(path, "sftp://"): return readSFTPFile(ctx, path, false) default: - return readLocalFile(ctx, path) + return utils.ReadLocalFile(ctx, path) } } @@ -216,63 +217,6 @@ func readSFTPFile(_ context.Context, path string, checkHostKey bool) ([]byte, er return b, err } -// readLocalFile reads a file from the local file system, -// unmarshals the content into a map[string]*types.TargetConfig -// and returns -func readLocalFile(ctx context.Context, path string) ([]byte, error) { - // read from stdin - if path == "-" { - return readFromStdin(ctx) - } - - // local file - f, err := os.Open(path) - if err != nil { - return nil, err - } - defer f.Close() - - st, err := f.Stat() - if err != nil { - return nil, err - } - if st.IsDir() { - return nil, fmt.Errorf("%q is a directory", path) - } - data := make([]byte, st.Size()) - - rd := bufio.NewReader(f) - _, err = rd.Read(data) - if err != nil && err != io.EOF { - return nil, err - } - return data, nil -} - -// read bytes from stdin -func readFromStdin(ctx context.Context) ([]byte, error) { - // read from stdin - data := make([]byte, 0, 128) - rd := bufio.NewReader(os.Stdin) - buf := make([]byte, 128) - for { - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - n, err := rd.Read(buf) - if err == io.EOF { - data = append(data, buf[:n]...) - return data, nil - } - if err != nil { - return nil, err - } - data = append(data, buf[:n]...) - } - } -} - // FileExists returns true if a file referenced by filename exists & accessible. func FileExists(filename string) bool { f, err := os.Stat(filename) diff --git a/pkg/formatters/all/all.go b/pkg/formatters/all/all.go new file mode 100644 index 00000000..2e93c1a1 --- /dev/null +++ b/pkg/formatters/all/all.go @@ -0,0 +1,33 @@ +// © 2022 Nokia. +// +// This code is a Contribution to the gNMIc project (“Work”) made under the Google Software Grant and Corporate Contributor License Agreement (“CLA”) and governed by the Apache License 2.0. +// No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. +// This code is provided on an “as is” basis without any warranties of any kind. +// +// SPDX-License-Identifier: Apache-2.0 + +package all + +import ( + _ "github.com/openconfig/gnmic/pkg/formatters/event_add_tag" + _ "github.com/openconfig/gnmic/pkg/formatters/event_allow" + _ "github.com/openconfig/gnmic/pkg/formatters/event_combine" + _ "github.com/openconfig/gnmic/pkg/formatters/event_convert" + _ "github.com/openconfig/gnmic/pkg/formatters/event_data_convert" + _ "github.com/openconfig/gnmic/pkg/formatters/event_date_string" + _ "github.com/openconfig/gnmic/pkg/formatters/event_delete" + _ "github.com/openconfig/gnmic/pkg/formatters/event_drop" + _ "github.com/openconfig/gnmic/pkg/formatters/event_duration_convert" + _ "github.com/openconfig/gnmic/pkg/formatters/event_extract_tags" + _ "github.com/openconfig/gnmic/pkg/formatters/event_group_by" + _ "github.com/openconfig/gnmic/pkg/formatters/event_jq" + _ "github.com/openconfig/gnmic/pkg/formatters/event_merge" + _ "github.com/openconfig/gnmic/pkg/formatters/event_override_ts" + _ "github.com/openconfig/gnmic/pkg/formatters/event_rate_limit" + _ "github.com/openconfig/gnmic/pkg/formatters/event_starlark" + _ "github.com/openconfig/gnmic/pkg/formatters/event_strings" + _ "github.com/openconfig/gnmic/pkg/formatters/event_to_tag" + _ "github.com/openconfig/gnmic/pkg/formatters/event_trigger" + _ "github.com/openconfig/gnmic/pkg/formatters/event_value_tag" + _ "github.com/openconfig/gnmic/pkg/formatters/event_write" +) diff --git a/formatters/event.go b/pkg/formatters/event.go similarity index 98% rename from formatters/event.go rename to pkg/formatters/event.go index 197b04a6..86c11096 100644 --- a/formatters/event.go +++ b/pkg/formatters/event.go @@ -16,7 +16,8 @@ import ( flattener "github.com/karimra/go-map-flattener" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/utils" + + "github.com/openconfig/gnmic/pkg/path" ) // EventMsg represents a gNMI update message, @@ -89,7 +90,7 @@ func ResponseToEventMsgs(name string, rsp *gnmi.SubscribeResponse, meta map[stri } // add paths for _, del := range rsp.Update.GetDelete() { - e.Deletes = append(e.Deletes, utils.GnmiPathToXPath(del, false)) + e.Deletes = append(e.Deletes, path.GnmiPathToXPath(del, false)) } evs = append(evs, e) } diff --git a/formatters/event_add_tag/event_add_tag.go b/pkg/formatters/event_add_tag/event_add_tag.go similarity index 97% rename from formatters/event_add_tag/event_add_tag.go rename to pkg/formatters/event_add_tag/event_add_tag.go index e80ee5b9..6ab42496 100644 --- a/formatters/event_add_tag/event_add_tag.go +++ b/pkg/formatters/event_add_tag/event_add_tag.go @@ -18,9 +18,9 @@ import ( "github.com/itchyny/gojq" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_add_tag/event_add_tag_test.go b/pkg/formatters/event_add_tag/event_add_tag_test.go similarity index 99% rename from formatters/event_add_tag/event_add_tag_test.go rename to pkg/formatters/event_add_tag/event_add_tag_test.go index 0df9cc57..a8e60855 100644 --- a/formatters/event_add_tag/event_add_tag_test.go +++ b/pkg/formatters/event_add_tag/event_add_tag_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_allow/event_allow.go b/pkg/formatters/event_allow/event_allow.go similarity index 97% rename from formatters/event_allow/event_allow.go rename to pkg/formatters/event_allow/event_allow.go index af634e4d..01bc3989 100644 --- a/formatters/event_allow/event_allow.go +++ b/pkg/formatters/event_allow/event_allow.go @@ -18,9 +18,9 @@ import ( "github.com/itchyny/gojq" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_allow/event_allow_test.go b/pkg/formatters/event_allow/event_allow_test.go similarity index 99% rename from formatters/event_allow/event_allow_test.go rename to pkg/formatters/event_allow/event_allow_test.go index 8cfa2bd5..b20c991f 100644 --- a/formatters/event_allow/event_allow_test.go +++ b/pkg/formatters/event_allow/event_allow_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_combine/event_combine.go b/pkg/formatters/event_combine/event_combine.go similarity index 97% rename from formatters/event_combine/event_combine.go rename to pkg/formatters/event_combine/event_combine.go index 7fdf7837..571a4a8e 100644 --- a/formatters/event_combine/event_combine.go +++ b/pkg/formatters/event_combine/event_combine.go @@ -19,9 +19,9 @@ import ( "github.com/itchyny/gojq" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_combine/event_combine_test/event_combine_test.go b/pkg/formatters/event_combine/event_combine_test/event_combine_test.go similarity index 97% rename from formatters/event_combine/event_combine_test/event_combine_test.go rename to pkg/formatters/event_combine/event_combine_test/event_combine_test.go index 7c3363bc..c9dc89b1 100644 --- a/formatters/event_combine/event_combine_test/event_combine_test.go +++ b/pkg/formatters/event_combine/event_combine_test/event_combine_test.go @@ -12,8 +12,8 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" - _ "github.com/openconfig/gnmic/formatters/all" + "github.com/openconfig/gnmic/pkg/formatters" + _ "github.com/openconfig/gnmic/pkg/formatters/all" ) func Test_combine_Apply(t *testing.T) { diff --git a/formatters/event_convert/event_convert.go b/pkg/formatters/event_convert/event_convert.go similarity index 98% rename from formatters/event_convert/event_convert.go rename to pkg/formatters/event_convert/event_convert.go index c351b78f..6fe2106a 100644 --- a/formatters/event_convert/event_convert.go +++ b/pkg/formatters/event_convert/event_convert.go @@ -19,9 +19,9 @@ import ( "regexp" "strconv" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_convert/event_convert_test.go b/pkg/formatters/event_convert/event_convert_test.go similarity index 99% rename from formatters/event_convert/event_convert_test.go rename to pkg/formatters/event_convert/event_convert_test.go index a8fa799d..2edf1d46 100644 --- a/formatters/event_convert/event_convert_test.go +++ b/pkg/formatters/event_convert/event_convert_test.go @@ -13,7 +13,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_data_convert/event_data_convert.go b/pkg/formatters/event_data_convert/event_data_convert.go similarity index 98% rename from formatters/event_data_convert/event_data_convert.go rename to pkg/formatters/event_data_convert/event_data_convert.go index ca2ec016..5692f9d8 100644 --- a/formatters/event_data_convert/event_data_convert.go +++ b/pkg/formatters/event_data_convert/event_data_convert.go @@ -21,9 +21,9 @@ import ( units "github.com/bcicen/go-units" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_data_convert/event_data_convert_test.go b/pkg/formatters/event_data_convert/event_data_convert_test.go similarity index 99% rename from formatters/event_data_convert/event_data_convert_test.go rename to pkg/formatters/event_data_convert/event_data_convert_test.go index 7a3da0b7..e4883bee 100644 --- a/formatters/event_data_convert/event_data_convert_test.go +++ b/pkg/formatters/event_data_convert/event_data_convert_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) func Test_dataConvert_Apply(t *testing.T) { diff --git a/formatters/event_date_string/event_date_string.go b/pkg/formatters/event_date_string/event_date_string.go similarity index 97% rename from formatters/event_date_string/event_date_string.go rename to pkg/formatters/event_date_string/event_date_string.go index 6a1c1625..a2fb9acc 100644 --- a/formatters/event_date_string/event_date_string.go +++ b/pkg/formatters/event_date_string/event_date_string.go @@ -18,9 +18,9 @@ import ( "strconv" "time" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_date_string/event_date_string_test.go b/pkg/formatters/event_date_string/event_date_string_test.go similarity index 98% rename from formatters/event_date_string/event_date_string_test.go rename to pkg/formatters/event_date_string/event_date_string_test.go index e7f277b2..3e314f6b 100644 --- a/formatters/event_date_string/event_date_string_test.go +++ b/pkg/formatters/event_date_string/event_date_string_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_delete/event_delete.go b/pkg/formatters/event_delete/event_delete.go similarity index 96% rename from formatters/event_delete/event_delete.go rename to pkg/formatters/event_delete/event_delete.go index 77021042..d704112f 100644 --- a/formatters/event_delete/event_delete.go +++ b/pkg/formatters/event_delete/event_delete.go @@ -15,9 +15,9 @@ import ( "os" "regexp" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_delete/event_delete_test.go b/pkg/formatters/event_delete/event_delete_test.go similarity index 99% rename from formatters/event_delete/event_delete_test.go rename to pkg/formatters/event_delete/event_delete_test.go index 88a37447..bed2be3f 100644 --- a/formatters/event_delete/event_delete_test.go +++ b/pkg/formatters/event_delete/event_delete_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_drop/event_drop.go b/pkg/formatters/event_drop/event_drop.go similarity index 97% rename from formatters/event_drop/event_drop.go rename to pkg/formatters/event_drop/event_drop.go index 288d0099..84361f73 100644 --- a/formatters/event_drop/event_drop.go +++ b/pkg/formatters/event_drop/event_drop.go @@ -18,9 +18,9 @@ import ( "github.com/itchyny/gojq" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_drop/event_drop_test.go b/pkg/formatters/event_drop/event_drop_test.go similarity index 98% rename from formatters/event_drop/event_drop_test.go rename to pkg/formatters/event_drop/event_drop_test.go index 8ad2c4da..33b30b87 100644 --- a/formatters/event_drop/event_drop_test.go +++ b/pkg/formatters/event_drop/event_drop_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_duration_convert/event_duration_convert.go b/pkg/formatters/event_duration_convert/event_duration_convert.go similarity index 97% rename from formatters/event_duration_convert/event_duration_convert.go rename to pkg/formatters/event_duration_convert/event_duration_convert.go index 15f43c3c..a652e0e6 100644 --- a/formatters/event_duration_convert/event_duration_convert.go +++ b/pkg/formatters/event_duration_convert/event_duration_convert.go @@ -17,9 +17,9 @@ import ( "regexp" "strconv" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_duration_convert/event_duration_convert_test.go b/pkg/formatters/event_duration_convert/event_duration_convert_test.go similarity index 99% rename from formatters/event_duration_convert/event_duration_convert_test.go rename to pkg/formatters/event_duration_convert/event_duration_convert_test.go index c65fa734..12274f0e 100644 --- a/formatters/event_duration_convert/event_duration_convert_test.go +++ b/pkg/formatters/event_duration_convert/event_duration_convert_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) const ( diff --git a/formatters/event_extract_tags/event_extract_tags.go b/pkg/formatters/event_extract_tags/event_extract_tags.go similarity index 97% rename from formatters/event_extract_tags/event_extract_tags.go rename to pkg/formatters/event_extract_tags/event_extract_tags.go index aabe3e5d..8dda6cc0 100644 --- a/formatters/event_extract_tags/event_extract_tags.go +++ b/pkg/formatters/event_extract_tags/event_extract_tags.go @@ -15,9 +15,9 @@ import ( "os" "regexp" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_extract_tags/event_extract_tags_test.go b/pkg/formatters/event_extract_tags/event_extract_tags_test.go similarity index 99% rename from formatters/event_extract_tags/event_extract_tags_test.go rename to pkg/formatters/event_extract_tags/event_extract_tags_test.go index 9891021c..4b43978b 100644 --- a/formatters/event_extract_tags/event_extract_tags_test.go +++ b/pkg/formatters/event_extract_tags/event_extract_tags_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_group_by/event_group_by.go b/pkg/formatters/event_group_by/event_group_by.go similarity index 96% rename from formatters/event_group_by/event_group_by.go rename to pkg/formatters/event_group_by/event_group_by.go index 4eb75bbb..3f206f9e 100644 --- a/formatters/event_group_by/event_group_by.go +++ b/pkg/formatters/event_group_by/event_group_by.go @@ -16,9 +16,9 @@ import ( "sort" "strings" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_group_by/event_group_by_test.go b/pkg/formatters/event_group_by/event_group_by_test.go similarity index 99% rename from formatters/event_group_by/event_group_by_test.go rename to pkg/formatters/event_group_by/event_group_by_test.go index 88b89d22..cce30fa3 100644 --- a/formatters/event_group_by/event_group_by_test.go +++ b/pkg/formatters/event_group_by/event_group_by_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_jq/event_jq.go b/pkg/formatters/event_jq/event_jq.go similarity index 97% rename from formatters/event_jq/event_jq.go rename to pkg/formatters/event_jq/event_jq.go index a84e971b..5d0351b3 100644 --- a/formatters/event_jq/event_jq.go +++ b/pkg/formatters/event_jq/event_jq.go @@ -17,9 +17,9 @@ import ( "github.com/itchyny/gojq" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_jq/event_jq_test.go b/pkg/formatters/event_jq/event_jq_test.go similarity index 99% rename from formatters/event_jq/event_jq_test.go rename to pkg/formatters/event_jq/event_jq_test.go index e370eb57..cb0dc953 100644 --- a/formatters/event_jq/event_jq_test.go +++ b/pkg/formatters/event_jq/event_jq_test.go @@ -14,8 +14,8 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/utils" ) type item struct { diff --git a/formatters/event_merge/event_merge.go b/pkg/formatters/event_merge/event_merge.go similarity index 95% rename from formatters/event_merge/event_merge.go rename to pkg/formatters/event_merge/event_merge.go index 559e056c..05b529d1 100644 --- a/formatters/event_merge/event_merge.go +++ b/pkg/formatters/event_merge/event_merge.go @@ -14,9 +14,9 @@ import ( "log" "os" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_merge/event_merge_test.go b/pkg/formatters/event_merge/event_merge_test.go similarity index 99% rename from formatters/event_merge/event_merge_test.go rename to pkg/formatters/event_merge/event_merge_test.go index e643e041..972c9d5c 100644 --- a/formatters/event_merge/event_merge_test.go +++ b/pkg/formatters/event_merge/event_merge_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_override_ts/event_override_ts.go b/pkg/formatters/event_override_ts/event_override_ts.go similarity index 95% rename from formatters/event_override_ts/event_override_ts.go rename to pkg/formatters/event_override_ts/event_override_ts.go index a2152be8..70ba0c07 100644 --- a/formatters/event_override_ts/event_override_ts.go +++ b/pkg/formatters/event_override_ts/event_override_ts.go @@ -15,9 +15,9 @@ import ( "os" "time" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_override_ts/event_override_ts_test.go b/pkg/formatters/event_override_ts/event_override_ts_test.go similarity index 98% rename from formatters/event_override_ts/event_override_ts_test.go rename to pkg/formatters/event_override_ts/event_override_ts_test.go index 273623fa..b1c3e227 100644 --- a/formatters/event_override_ts/event_override_ts_test.go +++ b/pkg/formatters/event_override_ts/event_override_ts_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_rate_limit/event_rate_limit.go b/pkg/formatters/event_rate_limit/event_rate_limit.go similarity index 96% rename from formatters/event_rate_limit/event_rate_limit.go rename to pkg/formatters/event_rate_limit/event_rate_limit.go index 02501c5d..53cbad02 100644 --- a/formatters/event_rate_limit/event_rate_limit.go +++ b/pkg/formatters/event_rate_limit/event_rate_limit.go @@ -13,9 +13,9 @@ import ( lru "github.com/hashicorp/golang-lru/v2" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_rate_limit/event_rate_limit_test.go b/pkg/formatters/event_rate_limit/event_rate_limit_test.go similarity index 88% rename from formatters/event_rate_limit/event_rate_limit_test.go rename to pkg/formatters/event_rate_limit/event_rate_limit_test.go index 714198e8..60f2a793 100644 --- a/formatters/event_rate_limit/event_rate_limit_test.go +++ b/pkg/formatters/event_rate_limit/event_rate_limit_test.go @@ -3,7 +3,7 @@ package event_rate_limit import ( "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { @@ -17,8 +17,8 @@ var testset = map[string]struct { }{ "1pps-notags-pass": { processor: map[string]interface{}{ - "type": processorType, - "debug": true, + "type": processorType, + "debug": true, "per-second": 1.0, }, tests: []item{ @@ -35,7 +35,7 @@ var testset = map[string]struct { Timestamp: 0, }, { - Timestamp: 1e9+1, + Timestamp: 1e9 + 1, }, }, output: []*formatters.EventMsg{ @@ -43,7 +43,7 @@ var testset = map[string]struct { Timestamp: 0, }, { - Timestamp: 1e9+1, + Timestamp: 1e9 + 1, }, }, }, @@ -51,9 +51,9 @@ var testset = map[string]struct { }, "1pps-tags-pass": { processor: map[string]interface{}{ - "type": processorType, + "type": processorType, "per-second": 1.0, - "debug": true, + "debug": true, }, tests: []item{ { @@ -76,10 +76,10 @@ var testset = map[string]struct { Timestamp: 1, }, { - Timestamp: 1+1e9, + Timestamp: 1 + 1e9, }, { - Timestamp: 1e9+1, + Timestamp: 1e9 + 1, Tags: map[string]string{ "a": "val-x", "b": "val-y", @@ -98,10 +98,10 @@ var testset = map[string]struct { Timestamp: 1, }, { - Timestamp: 1+1e9, + Timestamp: 1 + 1e9, }, { - Timestamp: 1e9+1, + Timestamp: 1e9 + 1, Tags: map[string]string{ "a": "val-x", "b": "val-y", @@ -113,8 +113,8 @@ var testset = map[string]struct { }, "1pps-notags-drop": { processor: map[string]interface{}{ - "type": processorType, - "debug": true, + "type": processorType, + "debug": true, "per-second": 1.0, }, tests: []item{ @@ -131,7 +131,7 @@ var testset = map[string]struct { Timestamp: 0, }, { - Timestamp: 1e9-1, + Timestamp: 1e9 - 1, }, }, output: []*formatters.EventMsg{ @@ -144,9 +144,9 @@ var testset = map[string]struct { }, "1pps-tags-drop": { processor: map[string]interface{}{ - "type": processorType, + "type": processorType, "per-second": 1.0, - "debug": true, + "debug": true, }, tests: []item{ { @@ -169,7 +169,7 @@ var testset = map[string]struct { Timestamp: 1, }, { - Timestamp: 1e9-1, + Timestamp: 1e9 - 1, Tags: map[string]string{ "a": "val-x", "b": "val-y", @@ -193,9 +193,9 @@ var testset = map[string]struct { }, "100pps-tags-pass": { processor: map[string]interface{}{ - "type": processorType, + "type": processorType, "per-second": 100.0, - "debug": true, + "debug": true, }, tests: []item{ { @@ -218,7 +218,7 @@ var testset = map[string]struct { Timestamp: 1, }, { - Timestamp: 1e9/100, + Timestamp: 1e9 / 100, Tags: map[string]string{ "a": "val-x", "b": "val-y", @@ -237,7 +237,7 @@ var testset = map[string]struct { Timestamp: 1, }, { - Timestamp: 1e9/100, + Timestamp: 1e9 / 100, Tags: map[string]string{ "a": "val-x", "b": "val-y", @@ -249,9 +249,9 @@ var testset = map[string]struct { }, "100pps-tags-drop": { processor: map[string]interface{}{ - "type": processorType, + "type": processorType, "per-second": 100.0, - "debug": true, + "debug": true, }, tests: []item{ { @@ -274,7 +274,7 @@ var testset = map[string]struct { Timestamp: 1, }, { - Timestamp: 1e9/100-1, + Timestamp: 1e9/100 - 1, Tags: map[string]string{ "a": "val-x", "b": "val-y", @@ -298,9 +298,9 @@ var testset = map[string]struct { }, "same-ts-pass": { processor: map[string]interface{}{ - "type": processorType, + "type": processorType, "per-second": 100.0, - "debug": true, + "debug": true, }, tests: []item{ { diff --git a/formatters/event_starlark/dict.go b/pkg/formatters/event_starlark/dict.go similarity index 100% rename from formatters/event_starlark/dict.go rename to pkg/formatters/event_starlark/dict.go diff --git a/formatters/event_starlark/event.go b/pkg/formatters/event_starlark/event.go similarity index 99% rename from formatters/event_starlark/event.go rename to pkg/formatters/event_starlark/event.go index eb2c6236..8e943aa0 100644 --- a/formatters/event_starlark/event.go +++ b/pkg/formatters/event_starlark/event.go @@ -14,8 +14,9 @@ import ( "fmt" "reflect" - "github.com/openconfig/gnmic/formatters" "go.starlark.net/starlark" + + "github.com/openconfig/gnmic/pkg/formatters" ) type event struct { diff --git a/formatters/event_starlark/event_starlark.go b/pkg/formatters/event_starlark/event_starlark.go similarity index 97% rename from formatters/event_starlark/event_starlark.go rename to pkg/formatters/event_starlark/event_starlark.go index 18614b46..2b34f160 100644 --- a/formatters/event_starlark/event_starlark.go +++ b/pkg/formatters/event_starlark/event_starlark.go @@ -22,9 +22,9 @@ import ( "go.starlark.net/resolve" "go.starlark.net/starlark" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_starlark/event_starlark_test.go b/pkg/formatters/event_starlark/event_starlark_test.go similarity index 99% rename from formatters/event_starlark/event_starlark_test.go rename to pkg/formatters/event_starlark/event_starlark_test.go index c98b14ee..ba3e6871 100644 --- a/formatters/event_starlark/event_starlark_test.go +++ b/pkg/formatters/event_starlark/event_starlark_test.go @@ -14,7 +14,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) func Test_starlarkProc_Apply(t *testing.T) { diff --git a/formatters/event_strings/event_strings.go b/pkg/formatters/event_strings/event_strings.go similarity index 98% rename from formatters/event_strings/event_strings.go rename to pkg/formatters/event_strings/event_strings.go index db02b429..4c63dc6f 100644 --- a/formatters/event_strings/event_strings.go +++ b/pkg/formatters/event_strings/event_strings.go @@ -20,9 +20,9 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_strings/event_strings_test.go b/pkg/formatters/event_strings/event_strings_test.go similarity index 99% rename from formatters/event_strings/event_strings_test.go rename to pkg/formatters/event_strings/event_strings_test.go index c5db47b1..c00e3566 100644 --- a/formatters/event_strings/event_strings_test.go +++ b/pkg/formatters/event_strings/event_strings_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_test.go b/pkg/formatters/event_test.go similarity index 100% rename from formatters/event_test.go rename to pkg/formatters/event_test.go diff --git a/formatters/event_to_tag/event_to_tag.go b/pkg/formatters/event_to_tag/event_to_tag.go similarity index 96% rename from formatters/event_to_tag/event_to_tag.go rename to pkg/formatters/event_to_tag/event_to_tag.go index 7bd86695..577a216f 100644 --- a/formatters/event_to_tag/event_to_tag.go +++ b/pkg/formatters/event_to_tag/event_to_tag.go @@ -15,9 +15,9 @@ import ( "os" "regexp" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_to_tag/event_to_tag_test.go b/pkg/formatters/event_to_tag/event_to_tag_test.go similarity index 98% rename from formatters/event_to_tag/event_to_tag_test.go rename to pkg/formatters/event_to_tag/event_to_tag_test.go index e39fd58c..61057e32 100644 --- a/formatters/event_to_tag/event_to_tag_test.go +++ b/pkg/formatters/event_to_tag/event_to_tag_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_trigger/event_trigger.go b/pkg/formatters/event_trigger/event_trigger.go similarity index 95% rename from formatters/event_trigger/event_trigger.go rename to pkg/formatters/event_trigger/event_trigger.go index 4e6dd9e6..f61bb908 100644 --- a/formatters/event_trigger/event_trigger.go +++ b/pkg/formatters/event_trigger/event_trigger.go @@ -19,14 +19,16 @@ import ( "strings" "time" - "github.com/itchyny/gojq" "gopkg.in/yaml.v2" - "github.com/openconfig/gnmic/actions" - _ "github.com/openconfig/gnmic/actions/all" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/itchyny/gojq" + + "github.com/openconfig/gnmic/pkg/actions" + _ "github.com/openconfig/gnmic/pkg/actions/all" + gfile "github.com/openconfig/gnmic/pkg/file" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -215,7 +217,7 @@ func (p *trigger) readVars() error { p.vars = p.Vars return nil } - b, err := utils.ReadFile(context.TODO(), p.VarsFile) + b, err := gfile.ReadFile(context.TODO(), p.VarsFile) if err != nil { return err } diff --git a/formatters/event_trigger/event_trigger_test.go b/pkg/formatters/event_trigger/event_trigger_test.go similarity index 98% rename from formatters/event_trigger/event_trigger_test.go rename to pkg/formatters/event_trigger/event_trigger_test.go index 67912f2b..76542c36 100644 --- a/formatters/event_trigger/event_trigger_test.go +++ b/pkg/formatters/event_trigger/event_trigger_test.go @@ -15,8 +15,8 @@ import ( "time" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/utils" ) type item struct { diff --git a/formatters/event_value_tag/event_value_tag.go b/pkg/formatters/event_value_tag/event_value_tag.go similarity index 95% rename from formatters/event_value_tag/event_value_tag.go rename to pkg/formatters/event_value_tag/event_value_tag.go index 7614dad2..ecd4f2d2 100644 --- a/formatters/event_value_tag/event_value_tag.go +++ b/pkg/formatters/event_value_tag/event_value_tag.go @@ -15,9 +15,9 @@ import ( "log" "os" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_value_tag/event_value_tag_test.go b/pkg/formatters/event_value_tag/event_value_tag_test.go similarity index 99% rename from formatters/event_value_tag/event_value_tag_test.go rename to pkg/formatters/event_value_tag/event_value_tag_test.go index b6e50bf3..fc3898fb 100644 --- a/formatters/event_value_tag/event_value_tag_test.go +++ b/pkg/formatters/event_value_tag/event_value_tag_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/event_write/event_write.go b/pkg/formatters/event_write/event_write.go similarity index 97% rename from formatters/event_write/event_write.go rename to pkg/formatters/event_write/event_write.go index d1899616..c316e0bd 100644 --- a/formatters/event_write/event_write.go +++ b/pkg/formatters/event_write/event_write.go @@ -18,9 +18,9 @@ import ( "github.com/itchyny/gojq" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/formatters/event_write/event_write_test.go b/pkg/formatters/event_write/event_write_test.go similarity index 99% rename from formatters/event_write/event_write_test.go rename to pkg/formatters/event_write/event_write_test.go index a2df5fc9..912afabf 100644 --- a/formatters/event_write/event_write_test.go +++ b/pkg/formatters/event_write/event_write_test.go @@ -14,7 +14,7 @@ import ( "log" "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) type item struct { diff --git a/formatters/flat.go b/pkg/formatters/flat.go similarity index 87% rename from formatters/flat.go rename to pkg/formatters/flat.go index e456c21d..c1fa27b1 100644 --- a/formatters/flat.go +++ b/pkg/formatters/flat.go @@ -13,8 +13,9 @@ import ( "path/filepath" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/utils" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/path" ) func ResponsesFlat(msgs ...proto.Message) (map[string]interface{}, error) { @@ -36,9 +37,9 @@ func responseFlat(msg proto.Message) (map[string]interface{}, error) { case *gnmi.GetResponse: rs := make(map[string]interface{}) for _, n := range msg.GetNotification() { - prefix := utils.GnmiPathToXPath(n.GetPrefix(), false) + prefix := path.GnmiPathToXPath(n.GetPrefix(), false) for _, u := range n.GetUpdate() { - p := utils.GnmiPathToXPath(u.GetPath(), false) + p := path.GnmiPathToXPath(u.GetPath(), false) vmap, err := getValueFlat(filepath.Join(prefix, p), u.GetVal()) if err != nil { return nil, err @@ -57,9 +58,9 @@ func responseFlat(msg proto.Message) (map[string]interface{}, error) { rs := make(map[string]interface{}) n := msg.GetUpdate() if n != nil { - prefix := utils.GnmiPathToXPath(n.GetPrefix(), false) + prefix := path.GnmiPathToXPath(n.GetPrefix(), false) for _, u := range n.GetUpdate() { - p := utils.GnmiPathToXPath(u.GetPath(), false) + p := path.GnmiPathToXPath(u.GetPath(), false) vmap, err := getValueFlat(filepath.Join(prefix, p), u.GetVal()) if err != nil { return nil, err diff --git a/formatters/formats.go b/pkg/formatters/formats.go similarity index 99% rename from formatters/formats.go rename to pkg/formatters/formats.go index 8388e13e..c8268f93 100644 --- a/formatters/formats.go +++ b/pkg/formatters/formats.go @@ -15,10 +15,11 @@ import ( "sort" "time" - "github.com/openconfig/gnmi/proto/gnmi" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/prototext" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmi/proto/gnmi" ) type MarshalOptions struct { diff --git a/formatters/json.go b/pkg/formatters/json.go similarity index 88% rename from formatters/json.go rename to pkg/formatters/json.go index 48baa2bb..e4f45975 100644 --- a/formatters/json.go +++ b/pkg/formatters/json.go @@ -14,8 +14,9 @@ import ( "time" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/utils" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/path" ) // FormatJSON formats a proto.Message and returns a []byte and an error @@ -48,7 +49,7 @@ func (o *MarshalOptions) formatsubscribeRequest(m *gnmi.SubscribeRequest) ([]byt msg := subscribeReq{} switch m := m.Request.(type) { case *gnmi.SubscribeRequest_Subscribe: - msg.Subscribe.Prefix = utils.GnmiPathToXPath(m.Subscribe.GetPrefix(), false) + msg.Subscribe.Prefix = path.GnmiPathToXPath(m.Subscribe.GetPrefix(), false) msg.Subscribe.Target = m.Subscribe.GetPrefix().GetTarget() msg.Subscribe.Subscriptions = make([]subscription, 0, len(m.Subscribe.GetSubscription())) if m.Subscribe != nil { @@ -63,7 +64,7 @@ func (o *MarshalOptions) formatsubscribeRequest(m *gnmi.SubscribeRequest) ([]byt for _, sub := range m.Subscribe.Subscription { msg.Subscribe.Subscriptions = append(msg.Subscribe.Subscriptions, subscription{ - Path: utils.GnmiPathToXPath(sub.Path, false), + Path: path.GnmiPathToXPath(sub.Path, false), Mode: sub.GetMode().String(), SampleInterval: sub.SampleInterval, HeartbeatInterval: sub.HeartbeatInterval, @@ -76,7 +77,7 @@ func (o *MarshalOptions) formatsubscribeRequest(m *gnmi.SubscribeRequest) ([]byt // case *gnmi.SubscribeRequest_Aliases: // msg.Aliases = make(map[string]string) // for _, a := range m.Aliases.GetAlias() { - // msg.Aliases[a.Alias] = utils.GnmiPathToXPath(a.Path, false) + // msg.Aliases[a.Alias] = path.GnmiPathToXPath(a.Path, false) // } } if o.Multiline { @@ -103,7 +104,7 @@ func (o *MarshalOptions) formatSubscribeResponse(m *gnmi.SubscribeResponse, meta if meta == nil { meta = make(map[string]string) } - msg.Prefix = utils.GnmiPathToXPath(m.Update.GetPrefix(), false) + msg.Prefix = path.GnmiPathToXPath(m.Update.GetPrefix(), false) msg.Target = m.Update.Prefix.GetTarget() if s, ok := meta["source"]; ok { msg.Source = s @@ -128,13 +129,13 @@ func (o *MarshalOptions) formatSubscribeResponse(m *gnmi.SubscribeResponse, meta } msg.Updates = append(msg.Updates, update{ - Path: utils.GnmiPathToXPath(upd.Path, false), + Path: path.GnmiPathToXPath(upd.Path, false), Values: make(map[string]interface{}), }) msg.Updates[i].Values[strings.Join(pathElems, "/")] = value } for _, del := range m.Update.Delete { - msg.Deletes = append(msg.Deletes, utils.GnmiPathToXPath(del, false)) + msg.Deletes = append(msg.Deletes, path.GnmiPathToXPath(del, false)) } if o.Multiline { return json.MarshalIndent(msg, "", o.Indent) @@ -179,14 +180,14 @@ func (o *MarshalOptions) formatCapabilitiesResponse(m *gnmi.CapabilityResponse) func (o *MarshalOptions) formatGetRequest(m *gnmi.GetRequest) ([]byte, error) { msg := getRqMsg{ - Prefix: utils.GnmiPathToXPath(m.GetPrefix(), false), + Prefix: path.GnmiPathToXPath(m.GetPrefix(), false), Target: m.GetPrefix().GetTarget(), Paths: make([]string, 0, len(m.Path)), Encoding: m.GetEncoding().String(), DataType: m.GetType().String(), } for _, p := range m.Path { - msg.Paths = append(msg.Paths, utils.GnmiPathToXPath(p, false)) + msg.Paths = append(msg.Paths, path.GnmiPathToXPath(p, false)) } for _, um := range m.UseModels { msg.Models = append(msg.Models, @@ -206,7 +207,7 @@ func (o *MarshalOptions) formatGetResponse(m *gnmi.GetResponse, meta map[string] notifications := make([]NotificationRspMsg, 0, len(m.GetNotification())) for _, notif := range m.GetNotification() { msg := NotificationRspMsg{ - Prefix: utils.GnmiPathToXPath(notif.GetPrefix(), false), + Prefix: path.GnmiPathToXPath(notif.GetPrefix(), false), Updates: make([]update, 0, len(notif.GetUpdate())), Deletes: make([]string, 0, len(notif.GetDelete())), } @@ -223,7 +224,7 @@ func (o *MarshalOptions) formatGetResponse(m *gnmi.GetResponse, meta map[string] if meta == nil { meta = make(map[string]string) } - msg.Prefix = utils.GnmiPathToXPath(notif.GetPrefix(), false) + msg.Prefix = path.GnmiPathToXPath(notif.GetPrefix(), false) msg.Target = notif.GetPrefix().GetTarget() if s, ok := meta["source"]; ok { msg.Source = s @@ -239,13 +240,13 @@ func (o *MarshalOptions) formatGetResponse(m *gnmi.GetResponse, meta map[string] } msg.Updates = append(msg.Updates, update{ - Path: utils.GnmiPathToXPath(upd.GetPath(), false), + Path: path.GnmiPathToXPath(upd.GetPath(), false), Values: make(map[string]interface{}), }) msg.Updates[i].Values[strings.Join(pathElems, "/")] = value } for _, del := range notif.GetDelete() { - msg.Deletes = append(msg.Deletes, utils.GnmiPathToXPath(del, false)) + msg.Deletes = append(msg.Deletes, path.GnmiPathToXPath(del, false)) } notifications = append(notifications, msg) } @@ -269,7 +270,7 @@ func (o *MarshalOptions) formatGetResponse(m *gnmi.GetResponse, meta map[string] func (o *MarshalOptions) formatSetRequest(m *gnmi.SetRequest) ([]byte, error) { req := setReqMsg{ - Prefix: utils.GnmiPathToXPath(m.GetPrefix(), false), + Prefix: path.GnmiPathToXPath(m.GetPrefix(), false), Target: m.GetPrefix().GetTarget(), Delete: make([]string, 0, len(m.GetDelete())), Replace: make([]updateMsg, 0, len(m.GetReplace())), @@ -277,20 +278,20 @@ func (o *MarshalOptions) formatSetRequest(m *gnmi.SetRequest) ([]byte, error) { } for _, del := range m.GetDelete() { - p := utils.GnmiPathToXPath(del, false) + p := path.GnmiPathToXPath(del, false) req.Delete = append(req.Delete, p) } for _, upd := range m.GetReplace() { req.Replace = append(req.Replace, updateMsg{ - Path: utils.GnmiPathToXPath(upd.GetPath(), false), + Path: path.GnmiPathToXPath(upd.GetPath(), false), Val: upd.Val.String(), }) } for _, upd := range m.GetUpdate() { req.Update = append(req.Update, updateMsg{ - Path: utils.GnmiPathToXPath(upd.GetPath(), false), + Path: path.GnmiPathToXPath(upd.GetPath(), false), Val: upd.Val.String(), }) } @@ -302,7 +303,7 @@ func (o *MarshalOptions) formatSetRequest(m *gnmi.SetRequest) ([]byte, error) { func (o *MarshalOptions) formatSetResponse(m *gnmi.SetResponse, meta map[string]string) ([]byte, error) { msg := setRspMsg{} - msg.Prefix = utils.GnmiPathToXPath(m.GetPrefix(), false) + msg.Prefix = path.GnmiPathToXPath(m.GetPrefix(), false) msg.Target = m.GetPrefix().GetTarget() msg.Timestamp = m.Timestamp msg.Time = time.Unix(0, m.Timestamp) @@ -316,7 +317,7 @@ func (o *MarshalOptions) formatSetResponse(m *gnmi.SetResponse, meta map[string] for _, u := range m.GetResponse() { msg.Results = append(msg.Results, updateResultMsg{ Operation: u.Op.String(), - Path: utils.GnmiPathToXPath(u.GetPath(), false), + Path: path.GnmiPathToXPath(u.GetPath(), false), Target: u.GetPath().GetTarget(), }) } diff --git a/formatters/msg.go b/pkg/formatters/msg.go similarity index 100% rename from formatters/msg.go rename to pkg/formatters/msg.go diff --git a/formatters/processors.go b/pkg/formatters/processors.go similarity index 98% rename from formatters/processors.go rename to pkg/formatters/processors.go index 451620a0..df523a35 100644 --- a/formatters/processors.go +++ b/pkg/formatters/processors.go @@ -16,7 +16,7 @@ import ( "github.com/itchyny/gojq" "github.com/mitchellh/mapstructure" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" ) var EventProcessors = map[string]Initializer{} diff --git a/formatters/processors_test.go b/pkg/formatters/processors_test.go similarity index 100% rename from formatters/processors_test.go rename to pkg/formatters/processors_test.go diff --git a/utils/template.go b/pkg/gtemplate/template.go similarity index 98% rename from utils/template.go rename to pkg/gtemplate/template.go index 1c508940..aaf680e5 100644 --- a/utils/template.go +++ b/pkg/gtemplate/template.go @@ -6,7 +6,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package utils +package gtemplate import ( "path" diff --git a/pkg/gtemplate/template_funcs.go b/pkg/gtemplate/template_funcs.go new file mode 100644 index 00000000..f8d803b4 --- /dev/null +++ b/pkg/gtemplate/template_funcs.go @@ -0,0 +1,31 @@ +// © 2022 Nokia. +// +// This code is a Contribution to the gNMIc project (“Work”) made under the Google Software Grant and Corporate Contributor License Agreement (“CLA”) and governed by the Apache License 2.0. +// No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. +// This code is provided on an “as is” basis without any warranties of any kind. +// +// SPDX-License-Identifier: Apache-2.0 + +package gtemplate + +import ( + "context" + "text/template" + + "github.com/hairyhenderson/gomplate/v3" + "github.com/hairyhenderson/gomplate/v3/data" +) + +type templateEngine interface { + CreateFuncs() template.FuncMap +} + +func NewTemplateEngine() templateEngine { + return &gmplt{} +} + +type gmplt struct{} + +func (*gmplt) CreateFuncs() template.FuncMap { + return gomplate.CreateFuncs(context.TODO(), new(data.Data)) +} diff --git a/inputs/all/all.go b/pkg/inputs/all/all.go similarity index 74% rename from inputs/all/all.go rename to pkg/inputs/all/all.go index 1d5f7b45..71a461b2 100644 --- a/inputs/all/all.go +++ b/pkg/inputs/all/all.go @@ -9,7 +9,7 @@ package all import ( - _ "github.com/openconfig/gnmic/inputs/kafka_input" - _ "github.com/openconfig/gnmic/inputs/nats_input" - _ "github.com/openconfig/gnmic/inputs/stan_input" + _ "github.com/openconfig/gnmic/pkg/inputs/kafka_input" + _ "github.com/openconfig/gnmic/pkg/inputs/nats_input" + _ "github.com/openconfig/gnmic/pkg/inputs/stan_input" ) diff --git a/inputs/input.go b/pkg/inputs/input.go similarity index 94% rename from inputs/input.go rename to pkg/inputs/input.go index 3c705d0f..edf82f36 100644 --- a/inputs/input.go +++ b/pkg/inputs/input.go @@ -12,8 +12,8 @@ import ( "context" "log" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" ) type Input interface { diff --git a/inputs/kafka_input/kafka_input.go b/pkg/inputs/kafka_input/kafka_input.go similarity index 98% rename from inputs/kafka_input/kafka_input.go rename to pkg/inputs/kafka_input/kafka_input.go index 5d717870..9096924a 100644 --- a/inputs/kafka_input/kafka_input.go +++ b/pkg/inputs/kafka_input/kafka_input.go @@ -20,16 +20,17 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + "github.com/Shopify/sarama" "github.com/damiannolan/sasl/oauthbearer" "github.com/google/uuid" - "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/inputs" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/inputs" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/inputs/kafka_input/kafka_scram_client.go b/pkg/inputs/kafka_input/kafka_scram_client.go similarity index 100% rename from inputs/kafka_input/kafka_scram_client.go rename to pkg/inputs/kafka_input/kafka_scram_client.go diff --git a/inputs/nats_input/nats_input.go b/pkg/inputs/nats_input/nats_input.go similarity index 97% rename from inputs/nats_input/nats_input.go rename to pkg/inputs/nats_input/nats_input.go index 6aa87f76..d6b08f21 100644 --- a/inputs/nats_input/nats_input.go +++ b/pkg/inputs/nats_input/nats_input.go @@ -19,14 +19,15 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + "github.com/google/uuid" "github.com/nats-io/nats.go" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/inputs" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" - "google.golang.org/protobuf/proto" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/inputs" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/inputs/stan_input/stan_input.go b/pkg/inputs/stan_input/stan_input.go similarity index 97% rename from inputs/stan_input/stan_input.go rename to pkg/inputs/stan_input/stan_input.go index 0ae48ebb..848b156f 100644 --- a/inputs/stan_input/stan_input.go +++ b/pkg/inputs/stan_input/stan_input.go @@ -18,15 +18,16 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + "github.com/google/uuid" "github.com/nats-io/nats.go" "github.com/nats-io/stan.go" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/inputs" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" - "google.golang.org/protobuf/proto" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/inputs" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/actions/all/all.go b/pkg/loaders/all/all.go similarity index 67% rename from actions/all/all.go rename to pkg/loaders/all/all.go index ff99993e..6872ea95 100644 --- a/actions/all/all.go +++ b/pkg/loaders/all/all.go @@ -9,8 +9,8 @@ package all import ( - _ "github.com/openconfig/gnmic/actions/gnmi_action" - _ "github.com/openconfig/gnmic/actions/http_action" - _ "github.com/openconfig/gnmic/actions/script_action" - _ "github.com/openconfig/gnmic/actions/template_action" + _ "github.com/openconfig/gnmic/pkg/loaders/consul_loader" + _ "github.com/openconfig/gnmic/pkg/loaders/docker_loader" + _ "github.com/openconfig/gnmic/pkg/loaders/file_loader" + _ "github.com/openconfig/gnmic/pkg/loaders/http_loader" ) diff --git a/loaders/consul_loader/consul_loader.go b/pkg/loaders/consul_loader/consul_loader.go similarity index 98% rename from loaders/consul_loader/consul_loader.go rename to pkg/loaders/consul_loader/consul_loader.go index 9af78244..fe813ec2 100644 --- a/loaders/consul_loader/consul_loader.go +++ b/pkg/loaders/consul_loader/consul_loader.go @@ -20,14 +20,16 @@ import ( "sync" "time" + "gopkg.in/yaml.v2" + "github.com/hashicorp/consul/api" "github.com/mitchellh/mapstructure" - "gopkg.in/yaml.v2" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/loaders" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/actions" + gfile "github.com/openconfig/gnmic/pkg/file" + "github.com/openconfig/gnmic/pkg/loaders" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -450,7 +452,7 @@ func (c *consulLoader) readVars(ctx context.Context) error { c.vars = c.cfg.Vars return nil } - b, err := utils.ReadFile(ctx, c.cfg.VarsFile) + b, err := gfile.ReadFile(ctx, c.cfg.VarsFile) if err != nil { return err } diff --git a/loaders/consul_loader/consul_loader_metrics.go b/pkg/loaders/consul_loader/consul_loader_metrics.go similarity index 100% rename from loaders/consul_loader/consul_loader_metrics.go rename to pkg/loaders/consul_loader/consul_loader_metrics.go diff --git a/loaders/consul_loader/options.go b/pkg/loaders/consul_loader/options.go similarity index 95% rename from loaders/consul_loader/options.go rename to pkg/loaders/consul_loader/options.go index 13609ce0..a3da03aa 100644 --- a/loaders/consul_loader/options.go +++ b/pkg/loaders/consul_loader/options.go @@ -9,7 +9,7 @@ package consul_loader import ( - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/loaders/docker_loader/docker_loader.go b/pkg/loaders/docker_loader/docker_loader.go similarity index 97% rename from loaders/docker_loader/docker_loader.go rename to pkg/loaders/docker_loader/docker_loader.go index 0aed2d0e..e65dc042 100644 --- a/loaders/docker_loader/docker_loader.go +++ b/pkg/loaders/docker_loader/docker_loader.go @@ -22,15 +22,17 @@ import ( "sync" "time" + "gopkg.in/yaml.v2" + dtypes "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" dClient "github.com/docker/docker/client" "github.com/mitchellh/mapstructure" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/loaders" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" - "gopkg.in/yaml.v2" + "github.com/openconfig/gnmic/pkg/actions" + gfile "github.com/openconfig/gnmic/pkg/file" + "github.com/openconfig/gnmic/pkg/loaders" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -293,8 +295,11 @@ func (d *dockerLoader) getTargets(ctx context.Context) (map[string]*types.Target errChan := make(chan error, len(d.fl)) start := time.Now() - defer dockerLoaderListRequestDuration.WithLabelValues(loaderType). - Set(float64(time.Since(start).Nanoseconds())) + // https://github.com/golang/go/issues/60048 + defer func() { + dockerLoaderListRequestDuration.WithLabelValues(loaderType). + Set(float64(time.Since(start).Nanoseconds())) + }() for _, targetFilter := range d.fl { go func(fl *targetFilterComp) { @@ -529,7 +534,7 @@ func (d *dockerLoader) readVars(ctx context.Context) error { d.vars = d.cfg.Vars return nil } - b, err := utils.ReadFile(ctx, d.cfg.VarsFile) + b, err := gfile.ReadFile(ctx, d.cfg.VarsFile) if err != nil { return err } diff --git a/loaders/docker_loader/docker_loader_metrics.go b/pkg/loaders/docker_loader/docker_loader_metrics.go similarity index 100% rename from loaders/docker_loader/docker_loader_metrics.go rename to pkg/loaders/docker_loader/docker_loader_metrics.go diff --git a/loaders/docker_loader/options.go b/pkg/loaders/docker_loader/options.go similarity index 95% rename from loaders/docker_loader/options.go rename to pkg/loaders/docker_loader/options.go index ef20035b..27f19379 100644 --- a/loaders/docker_loader/options.go +++ b/pkg/loaders/docker_loader/options.go @@ -9,7 +9,7 @@ package docker_loader import ( - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/loaders/file_loader/file_loader.go b/pkg/loaders/file_loader/file_loader.go similarity index 96% rename from loaders/file_loader/file_loader.go rename to pkg/loaders/file_loader/file_loader.go index f558be10..eff62d7d 100644 --- a/loaders/file_loader/file_loader.go +++ b/pkg/loaders/file_loader/file_loader.go @@ -21,11 +21,14 @@ import ( "text/template" "time" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/loaders" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "gopkg.in/yaml.v2" + + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/loaders" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" + gfile "github.com/openconfig/gnmic/pkg/file" ) const ( @@ -111,7 +114,7 @@ func (f *fileLoader) Init(ctx context.Context, cfg map[string]interface{}, logge f.logger.SetFlags(logger.Flags()) } if f.cfg.Template != "" { - f.tpl, err = utils.CreateTemplate("file-loader-template", f.cfg.Template) + f.tpl, err = gtemplate.CreateTemplate("file-loader-template", f.cfg.Template) if err != nil { return err } @@ -215,7 +218,7 @@ func (f *fileLoader) getTargets(ctx context.Context) (map[string]*types.TargetCo // read file bytes based on the path prefix ctx, cancel := context.WithTimeout(ctx, f.cfg.Interval/2) defer cancel() - b, err := utils.ReadFile(ctx, f.cfg.Path) + b, err := gfile.ReadFile(ctx, f.cfg.Path) fileLoaderFileReadDuration.WithLabelValues(loaderType).Set(float64(time.Since(start).Nanoseconds())) if err != nil { fileLoaderFailedFileRead.WithLabelValues(loaderType, fmt.Sprintf("%v", err)).Add(1) @@ -303,7 +306,7 @@ func (f *fileLoader) readVars(ctx context.Context) error { f.vars = f.cfg.Vars return nil } - b, err := utils.ReadFile(ctx, f.cfg.VarsFile) + b, err := gfile.ReadFile(ctx, f.cfg.VarsFile) if err != nil { return err } diff --git a/loaders/file_loader/file_loader_metrics.go b/pkg/loaders/file_loader/file_loader_metrics.go similarity index 100% rename from loaders/file_loader/file_loader_metrics.go rename to pkg/loaders/file_loader/file_loader_metrics.go diff --git a/loaders/file_loader/options.go b/pkg/loaders/file_loader/options.go similarity index 95% rename from loaders/file_loader/options.go rename to pkg/loaders/file_loader/options.go index b295b7cd..c31d067c 100644 --- a/loaders/file_loader/options.go +++ b/pkg/loaders/file_loader/options.go @@ -9,7 +9,7 @@ package file_loader import ( - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/loaders/http_loader/http_loader.go b/pkg/loaders/http_loader/http_loader.go similarity index 96% rename from loaders/http_loader/http_loader.go rename to pkg/loaders/http_loader/http_loader.go index 514d2e31..c677f76e 100644 --- a/loaders/http_loader/http_loader.go +++ b/pkg/loaders/http_loader/http_loader.go @@ -20,12 +20,16 @@ import ( "text/template" "time" - "github.com/go-resty/resty/v2" - "github.com/openconfig/gnmic/actions" - "github.com/openconfig/gnmic/loaders" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "gopkg.in/yaml.v2" + + "github.com/go-resty/resty/v2" + + "github.com/openconfig/gnmic/pkg/actions" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/loaders" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" + gfile "github.com/openconfig/gnmic/pkg/file" ) const ( @@ -122,13 +126,13 @@ func (h *httpLoader) Init(ctx context.Context, cfg map[string]interface{}, logge h.logger.SetFlags(logger.Flags()) } if h.cfg.Template != "" { - h.tpl, err = utils.CreateTemplate("http-loader-template", h.cfg.Template) + h.tpl, err = gtemplate.CreateTemplate("http-loader-template", h.cfg.Template) if err != nil { return err } } if h.cfg.TemplateFile != "" { - h.tpl, err = utils.CreateFileTemplate(h.cfg.TemplateFile) + h.tpl, err = gtemplate.CreateFileTemplate(h.cfg.TemplateFile) if err != nil { return err } @@ -344,7 +348,7 @@ func (h *httpLoader) readVars(ctx context.Context) error { } ctx, cancel := context.WithTimeout(ctx, h.cfg.Interval) defer cancel() - b, err := utils.ReadFile(ctx, h.cfg.VarsFile) + b, err := gfile.ReadFile(ctx, h.cfg.VarsFile) if err != nil { return err } diff --git a/loaders/http_loader/http_loader_metrics.go b/pkg/loaders/http_loader/http_loader_metrics.go similarity index 100% rename from loaders/http_loader/http_loader_metrics.go rename to pkg/loaders/http_loader/http_loader_metrics.go diff --git a/loaders/http_loader/options.go b/pkg/loaders/http_loader/options.go similarity index 95% rename from loaders/http_loader/options.go rename to pkg/loaders/http_loader/options.go index d97539e8..be1537ad 100644 --- a/loaders/http_loader/options.go +++ b/pkg/loaders/http_loader/options.go @@ -9,7 +9,7 @@ package http_loader import ( - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/loaders/loaders.go b/pkg/loaders/loaders.go similarity index 98% rename from loaders/loaders.go rename to pkg/loaders/loaders.go index 1553c677..3456db93 100644 --- a/loaders/loaders.go +++ b/pkg/loaders/loaders.go @@ -13,8 +13,9 @@ import ( "log" "github.com/mitchellh/mapstructure" - "github.com/openconfig/gnmic/types" "github.com/prometheus/client_golang/prometheus" + + "github.com/openconfig/gnmic/pkg/types" ) // TargetLoader discovers a set of target configurations for gNMIc to run RPCs against. diff --git a/loaders/loaders_test.go b/pkg/loaders/loaders_test.go similarity index 98% rename from loaders/loaders_test.go rename to pkg/loaders/loaders_test.go index 9dbcee29..19e084f3 100644 --- a/loaders/loaders_test.go +++ b/pkg/loaders/loaders_test.go @@ -12,7 +12,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/openconfig/gnmic/types" + + "github.com/openconfig/gnmic/pkg/types" ) var testSet = map[string]struct { diff --git a/loaders/option.go b/pkg/loaders/option.go similarity index 96% rename from loaders/option.go rename to pkg/loaders/option.go index 8ea01be1..76553abe 100644 --- a/loaders/option.go +++ b/pkg/loaders/option.go @@ -9,8 +9,9 @@ package loaders import ( - "github.com/openconfig/gnmic/types" "github.com/prometheus/client_golang/prometheus" + + "github.com/openconfig/gnmic/pkg/types" ) type Option func(TargetLoader) diff --git a/lockers/all/all.go b/pkg/lockers/all/all.go similarity index 73% rename from lockers/all/all.go rename to pkg/lockers/all/all.go index e2d99a0f..df2b96ab 100644 --- a/lockers/all/all.go +++ b/pkg/lockers/all/all.go @@ -9,7 +9,7 @@ package all import ( - _ "github.com/openconfig/gnmic/lockers/consul_locker" - _ "github.com/openconfig/gnmic/lockers/k8s_locker" - _ "github.com/openconfig/gnmic/lockers/redis_locker" + _ "github.com/openconfig/gnmic/pkg/lockers/consul_locker" + _ "github.com/openconfig/gnmic/pkg/lockers/k8s_locker" + _ "github.com/openconfig/gnmic/pkg/lockers/redis_locker" ) diff --git a/lockers/consul_locker/consul_locker.go b/pkg/lockers/consul_locker/consul_locker.go similarity index 98% rename from lockers/consul_locker/consul_locker.go rename to pkg/lockers/consul_locker/consul_locker.go index 59f9d0cb..3b0a0833 100644 --- a/lockers/consul_locker/consul_locker.go +++ b/pkg/lockers/consul_locker/consul_locker.go @@ -18,8 +18,9 @@ import ( "time" "github.com/hashicorp/consul/api" - "github.com/openconfig/gnmic/lockers" - "github.com/openconfig/gnmic/utils" + + "github.com/openconfig/gnmic/pkg/lockers" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/lockers/consul_locker/consul_registration.go b/pkg/lockers/consul_locker/consul_registration.go similarity index 99% rename from lockers/consul_locker/consul_registration.go rename to pkg/lockers/consul_locker/consul_registration.go index 85611128..45aaeb97 100644 --- a/lockers/consul_locker/consul_registration.go +++ b/pkg/lockers/consul_locker/consul_registration.go @@ -15,7 +15,8 @@ import ( "time" "github.com/hashicorp/consul/api" - "github.com/openconfig/gnmic/lockers" + + "github.com/openconfig/gnmic/pkg/lockers" ) const defaultWatchTimeout = 1 * time.Minute diff --git a/lockers/k8s_locker/k8s_locker.go b/pkg/lockers/k8s_locker/k8s_locker.go similarity index 99% rename from lockers/k8s_locker/k8s_locker.go rename to pkg/lockers/k8s_locker/k8s_locker.go index 625b9f47..eda8b225 100644 --- a/lockers/k8s_locker/k8s_locker.go +++ b/pkg/lockers/k8s_locker/k8s_locker.go @@ -11,25 +11,25 @@ package k8s_locker import ( "context" "encoding/json" - "os" - "strings" - "fmt" "io" "log" + "os" + "strings" "sync" "time" - "github.com/google/uuid" - "github.com/openconfig/gnmic/lockers" - "github.com/openconfig/gnmic/utils" coordinationv1 "k8s.io/api/coordination/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" - "k8s.io/utils/pointer" + + "github.com/google/uuid" + + "github.com/openconfig/gnmic/pkg/lockers" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/lockers/k8s_locker/k8s_registration.go b/pkg/lockers/k8s_locker/k8s_registration.go similarity index 99% rename from lockers/k8s_locker/k8s_registration.go rename to pkg/lockers/k8s_locker/k8s_registration.go index 1810695a..35700c28 100644 --- a/lockers/k8s_locker/k8s_registration.go +++ b/pkg/lockers/k8s_locker/k8s_registration.go @@ -14,12 +14,13 @@ import ( "strings" "time" - "github.com/openconfig/gnmic/lockers" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/watch" + + "github.com/openconfig/gnmic/pkg/lockers" ) const defaultWatchTimeout = 10 * time.Second diff --git a/lockers/locker.go b/pkg/lockers/locker.go similarity index 100% rename from lockers/locker.go rename to pkg/lockers/locker.go diff --git a/lockers/redis_locker/redis_locker.go b/pkg/lockers/redis_locker/redis_locker.go similarity index 98% rename from lockers/redis_locker/redis_locker.go rename to pkg/lockers/redis_locker/redis_locker.go index a2da63ba..7e4b6ae3 100644 --- a/lockers/redis_locker/redis_locker.go +++ b/pkg/lockers/redis_locker/redis_locker.go @@ -13,9 +13,10 @@ import ( "github.com/go-redsync/redsync/v4" "github.com/go-redsync/redsync/v4/redis/goredis/v9" - "github.com/openconfig/gnmic/lockers" - "github.com/openconfig/gnmic/utils" goredislib "github.com/redis/go-redis/v9" + + "github.com/openconfig/gnmic/pkg/lockers" + "github.com/openconfig/gnmic/pkg/utils" ) const ( diff --git a/lockers/redis_locker/redis_registration.go b/pkg/lockers/redis_locker/redis_registration.go similarity index 99% rename from lockers/redis_locker/redis_registration.go rename to pkg/lockers/redis_locker/redis_registration.go index 3154127a..7613fd22 100644 --- a/lockers/redis_locker/redis_registration.go +++ b/pkg/lockers/redis_locker/redis_registration.go @@ -8,8 +8,9 @@ import ( "time" "github.com/go-redsync/redsync/v4" - "github.com/openconfig/gnmic/lockers" goredis "github.com/redis/go-redis/v9" + + "github.com/openconfig/gnmic/pkg/lockers" ) // defaultWatchTimeout diff --git a/pkg/outputs/all/all.go b/pkg/outputs/all/all.go new file mode 100644 index 00000000..343c2716 --- /dev/null +++ b/pkg/outputs/all/all.go @@ -0,0 +1,25 @@ +// © 2022 Nokia. +// +// This code is a Contribution to the gNMIc project (“Work”) made under the Google Software Grant and Corporate Contributor License Agreement (“CLA”) and governed by the Apache License 2.0. +// No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. +// This code is provided on an “as is” basis without any warranties of any kind. +// +// SPDX-License-Identifier: Apache-2.0 + +package all + +import ( + _ "github.com/openconfig/gnmic/pkg/outputs/asciigraph_output" + _ "github.com/openconfig/gnmic/pkg/outputs/file" + _ "github.com/openconfig/gnmic/pkg/outputs/gnmi_output" + _ "github.com/openconfig/gnmic/pkg/outputs/influxdb_output" + _ "github.com/openconfig/gnmic/pkg/outputs/kafka_output" + _ "github.com/openconfig/gnmic/pkg/outputs/nats_outputs/jetstream" + _ "github.com/openconfig/gnmic/pkg/outputs/nats_outputs/nats" + _ "github.com/openconfig/gnmic/pkg/outputs/nats_outputs/stan" + _ "github.com/openconfig/gnmic/pkg/outputs/prometheus_output/prometheus_output" + _ "github.com/openconfig/gnmic/pkg/outputs/prometheus_output/prometheus_write_output" + _ "github.com/openconfig/gnmic/pkg/outputs/snmp_output" + _ "github.com/openconfig/gnmic/pkg/outputs/tcp_output" + _ "github.com/openconfig/gnmic/pkg/outputs/udp_output" +) diff --git a/outputs/asciigraph_output/asciigraph.go b/pkg/outputs/asciigraph_output/asciigraph.go similarity index 97% rename from outputs/asciigraph_output/asciigraph.go rename to pkg/outputs/asciigraph_output/asciigraph.go index 6a14e30c..958dbc20 100644 --- a/outputs/asciigraph_output/asciigraph.go +++ b/pkg/outputs/asciigraph_output/asciigraph.go @@ -24,16 +24,18 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + "github.com/guptarohit/asciigraph" "github.com/nsf/termbox-go" "github.com/openconfig/gnmi/proto/gnmi" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -185,7 +187,7 @@ func (a *asciigraphOutput) Init(ctx context.Context, name string, cfg map[string if a.cfg.TargetTemplate == "" { a.targetTpl = outputs.DefaultTargetTemplate } else if a.cfg.AddTarget != "" { - a.targetTpl, err = utils.CreateTemplate("target-template", a.cfg.TargetTemplate) + a.targetTpl, err = gtemplate.CreateTemplate("target-template", a.cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/file/file_metrics.go b/pkg/outputs/file/file_metrics.go similarity index 100% rename from outputs/file/file_metrics.go rename to pkg/outputs/file/file_metrics.go diff --git a/outputs/file/file_output.go b/pkg/outputs/file/file_output.go similarity index 95% rename from outputs/file/file_output.go rename to pkg/outputs/file/file_output.go index 6aad7590..9d6b769a 100644 --- a/outputs/file/file_output.go +++ b/pkg/outputs/file/file_output.go @@ -19,14 +19,16 @@ import ( "text/template" "time" - "github.com/prometheus/client_golang/prometheus" "golang.org/x/sync/semaphore" "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/prometheus/client_golang/prometheus" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -194,7 +196,7 @@ func (f *File) Init(ctx context.Context, name string, cfg map[string]interface{} if f.cfg.TargetTemplate == "" { f.targetTpl = outputs.DefaultTargetTemplate } else if f.cfg.AddTarget != "" { - f.targetTpl, err = utils.CreateTemplate("target-template", f.cfg.TargetTemplate) + f.targetTpl, err = gtemplate.CreateTemplate("target-template", f.cfg.TargetTemplate) if err != nil { return err } @@ -202,7 +204,7 @@ func (f *File) Init(ctx context.Context, name string, cfg map[string]interface{} } if f.cfg.MsgTemplate != "" { - f.msgTpl, err = utils.CreateTemplate(fmt.Sprintf("%s-msg-template", name), f.cfg.MsgTemplate) + f.msgTpl, err = gtemplate.CreateTemplate(fmt.Sprintf("%s-msg-template", name), f.cfg.MsgTemplate) if err != nil { return err } diff --git a/outputs/gnmi_output/gnmi_output.go b/pkg/outputs/gnmi_output/gnmi_output.go similarity index 95% rename from outputs/gnmi_output/gnmi_output.go rename to pkg/outputs/gnmi_output/gnmi_output.go index 6bf38361..0e2e289c 100644 --- a/outputs/gnmi_output/gnmi_output.go +++ b/pkg/outputs/gnmi_output/gnmi_output.go @@ -18,18 +18,21 @@ import ( "strings" "text/template" - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - "github.com/openconfig/gnmi/cache" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" - "github.com/prometheus/client_golang/prometheus" "golang.org/x/sync/semaphore" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/protobuf/proto" + + grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" + "github.com/openconfig/gnmi/cache" + "github.com/openconfig/gnmi/proto/gnmi" + "github.com/prometheus/client_golang/prometheus" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -89,7 +92,7 @@ func (g *gNMIOutput) Init(ctx context.Context, name string, cfg map[string]inter } g.logger.SetPrefix(fmt.Sprintf(loggingPrefix, name)) if g.targetTpl == nil { - g.targetTpl, err = utils.CreateTemplate(fmt.Sprintf("%s-target-template", name), g.cfg.TargetTemplate) + g.targetTpl, err = gtemplate.CreateTemplate(fmt.Sprintf("%s-target-template", name), g.cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/gnmi_output/gnmi_server.go b/pkg/outputs/gnmi_output/gnmi_server.go similarity index 99% rename from outputs/gnmi_output/gnmi_server.go rename to pkg/outputs/gnmi_output/gnmi_server.go index 643dd63e..f41d660b 100644 --- a/outputs/gnmi_output/gnmi_server.go +++ b/pkg/outputs/gnmi_output/gnmi_server.go @@ -22,6 +22,11 @@ import ( "log" "sync" + "golang.org/x/sync/semaphore" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/status" + "github.com/openconfig/gnmi/cache" "github.com/openconfig/gnmi/coalesce" "github.com/openconfig/gnmi/ctree" @@ -29,11 +34,7 @@ import ( "github.com/openconfig/gnmi/path" "github.com/openconfig/gnmi/proto/gnmi" "github.com/openconfig/gnmi/subscribe" - "github.com/openconfig/gnmic/types" - "golang.org/x/sync/semaphore" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/peer" - "google.golang.org/grpc/status" + "github.com/openconfig/gnmic/pkg/types" ) type streamClient struct { diff --git a/outputs/gnmi_output/gnmi_server_get.go b/pkg/outputs/gnmi_output/gnmi_server_get.go similarity index 98% rename from outputs/gnmi_output/gnmi_server_get.go rename to pkg/outputs/gnmi_output/gnmi_server_get.go index 8c6768ce..485d77d9 100644 --- a/outputs/gnmi_output/gnmi_server_get.go +++ b/pkg/outputs/gnmi_output/gnmi_server_get.go @@ -15,14 +15,16 @@ import ( "sync" "time" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "google.golang.org/grpc/codes" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmi/proto/gnmi" + + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (s *server) Get(ctx context.Context, req *gnmi.GetRequest) (*gnmi.GetResponse, error) { diff --git a/outputs/gnmi_output/gnmi_server_set.go b/pkg/outputs/gnmi_output/gnmi_server_set.go similarity index 96% rename from outputs/gnmi_output/gnmi_server_set.go rename to pkg/outputs/gnmi_output/gnmi_server_set.go index 7e3a7e51..f5d6d6c5 100644 --- a/outputs/gnmi_output/gnmi_server_set.go +++ b/pkg/outputs/gnmi_output/gnmi_server_set.go @@ -14,14 +14,15 @@ import ( "sync" "time" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/target" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "google.golang.org/grpc/codes" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmi/proto/gnmi" + "github.com/openconfig/gnmic/pkg/target" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) func (s *server) Set(ctx context.Context, req *gnmi.SetRequest) (*gnmi.SetResponse, error) { diff --git a/outputs/gnmi_output/gnmi_server_subscribe.go b/pkg/outputs/gnmi_output/gnmi_server_subscribe.go similarity index 99% rename from outputs/gnmi_output/gnmi_server_subscribe.go rename to pkg/outputs/gnmi_output/gnmi_server_subscribe.go index 7f420b48..1b1d4568 100644 --- a/outputs/gnmi_output/gnmi_server_subscribe.go +++ b/pkg/outputs/gnmi_output/gnmi_server_subscribe.go @@ -13,11 +13,12 @@ import ( "io" "strings" - "github.com/openconfig/gnmi/coalesce" - "github.com/openconfig/gnmi/proto/gnmi" "google.golang.org/grpc/codes" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" + + "github.com/openconfig/gnmi/coalesce" + "github.com/openconfig/gnmi/proto/gnmi" ) func (s *server) Subscribe(stream gnmi.GNMI_SubscribeServer) error { diff --git a/outputs/influxdb_output/influxdb_cache.go b/pkg/outputs/influxdb_output/influxdb_cache.go similarity index 94% rename from outputs/influxdb_output/influxdb_cache.go rename to pkg/outputs/influxdb_output/influxdb_cache.go index 5a516f39..5eb522a6 100644 --- a/outputs/influxdb_output/influxdb_cache.go +++ b/pkg/outputs/influxdb_output/influxdb_cache.go @@ -13,9 +13,10 @@ import ( "time" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" + + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/outputs" ) func (i *influxDBOutput) initCache(ctx context.Context, name string) error { diff --git a/outputs/influxdb_output/influxdb_output.go b/pkg/outputs/influxdb_output/influxdb_output.go similarity index 97% rename from outputs/influxdb_output/influxdb_output.go rename to pkg/outputs/influxdb_output/influxdb_output.go index c0032f6e..238cb82c 100644 --- a/outputs/influxdb_output/influxdb_output.go +++ b/pkg/outputs/influxdb_output/influxdb_output.go @@ -20,15 +20,18 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + influxdb2 "github.com/influxdata/influxdb-client-go/v2" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -164,7 +167,7 @@ func (i *influxDBOutput) Init(ctx context.Context, name string, cfg map[string]i if i.Cfg.TargetTemplate == "" { i.targetTpl = outputs.DefaultTargetTemplate } else if i.Cfg.AddTarget != "" { - i.targetTpl, err = utils.CreateTemplate("target-template", i.Cfg.TargetTemplate) + i.targetTpl, err = gtemplate.CreateTemplate("target-template", i.Cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/kafka_output/kafka_metrics.go b/pkg/outputs/kafka_output/kafka_metrics.go similarity index 100% rename from outputs/kafka_output/kafka_metrics.go rename to pkg/outputs/kafka_output/kafka_metrics.go diff --git a/outputs/kafka_output/kafka_output.go b/pkg/outputs/kafka_output/kafka_output.go similarity index 97% rename from outputs/kafka_output/kafka_output.go rename to pkg/outputs/kafka_output/kafka_output.go index 69f8ee45..6cebd2c9 100644 --- a/outputs/kafka_output/kafka_output.go +++ b/pkg/outputs/kafka_output/kafka_output.go @@ -21,15 +21,18 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + "github.com/Shopify/sarama" "github.com/damiannolan/sasl/oauthbearer" "github.com/google/uuid" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -166,7 +169,7 @@ func (k *kafkaOutput) Init(ctx context.Context, name string, cfg map[string]inte if k.Cfg.TargetTemplate == "" { k.targetTpl = outputs.DefaultTargetTemplate } else if k.Cfg.AddTarget != "" { - k.targetTpl, err = utils.CreateTemplate("target-template", k.Cfg.TargetTemplate) + k.targetTpl, err = gtemplate.CreateTemplate("target-template", k.Cfg.TargetTemplate) if err != nil { return err } @@ -174,7 +177,7 @@ func (k *kafkaOutput) Init(ctx context.Context, name string, cfg map[string]inte } if k.Cfg.MsgTemplate != "" { - k.msgTpl, err = utils.CreateTemplate("msg-template", k.Cfg.MsgTemplate) + k.msgTpl, err = gtemplate.CreateTemplate("msg-template", k.Cfg.MsgTemplate) if err != nil { return err } diff --git a/outputs/kafka_output/kafka_scram_client.go b/pkg/outputs/kafka_output/kafka_scram_client.go similarity index 100% rename from outputs/kafka_output/kafka_scram_client.go rename to pkg/outputs/kafka_output/kafka_scram_client.go diff --git a/outputs/nats_outputs/jetstream/jetstream_output.go b/pkg/outputs/nats_outputs/jetstream/jetstream_output.go similarity index 98% rename from outputs/nats_outputs/jetstream/jetstream_output.go rename to pkg/outputs/nats_outputs/jetstream/jetstream_output.go index 9f8735f9..23a77db3 100644 --- a/outputs/nats_outputs/jetstream/jetstream_output.go +++ b/pkg/outputs/nats_outputs/jetstream/jetstream_output.go @@ -23,15 +23,18 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + "github.com/google/uuid" "github.com/nats-io/nats.go" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -140,7 +143,7 @@ func (n *jetstreamOutput) Init(ctx context.Context, name string, cfg map[string] if n.Cfg.TargetTemplate == "" { n.targetTpl = outputs.DefaultTargetTemplate } else if n.Cfg.AddTarget != "" { - n.targetTpl, err = utils.CreateTemplate("target-template", n.Cfg.TargetTemplate) + n.targetTpl, err = gtemplate.CreateTemplate("target-template", n.Cfg.TargetTemplate) if err != nil { return err } @@ -148,7 +151,7 @@ func (n *jetstreamOutput) Init(ctx context.Context, name string, cfg map[string] } if n.Cfg.MsgTemplate != "" { - n.msgTpl, err = utils.CreateTemplate("msg-template", n.Cfg.MsgTemplate) + n.msgTpl, err = gtemplate.CreateTemplate("msg-template", n.Cfg.MsgTemplate) if err != nil { return err } diff --git a/outputs/nats_outputs/jetstream/jetstream_output_metrics.go b/pkg/outputs/nats_outputs/jetstream/jetstream_output_metrics.go similarity index 100% rename from outputs/nats_outputs/jetstream/jetstream_output_metrics.go rename to pkg/outputs/nats_outputs/jetstream/jetstream_output_metrics.go diff --git a/outputs/nats_outputs/nats/nats_metrics.go b/pkg/outputs/nats_outputs/nats/nats_metrics.go similarity index 100% rename from outputs/nats_outputs/nats/nats_metrics.go rename to pkg/outputs/nats_outputs/nats/nats_metrics.go diff --git a/outputs/nats_outputs/nats/nats_output.go b/pkg/outputs/nats_outputs/nats/nats_output.go similarity index 96% rename from outputs/nats_outputs/nats/nats_output.go rename to pkg/outputs/nats_outputs/nats/nats_output.go index fb39a770..142c0ba1 100644 --- a/outputs/nats_outputs/nats/nats_output.go +++ b/pkg/outputs/nats_outputs/nats/nats_output.go @@ -20,14 +20,17 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + "github.com/google/uuid" "github.com/nats-io/nats.go" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -164,7 +167,7 @@ func (n *NatsOutput) Init(ctx context.Context, name string, cfg map[string]inter if n.Cfg.TargetTemplate == "" { n.targetTpl = outputs.DefaultTargetTemplate } else if n.Cfg.AddTarget != "" { - n.targetTpl, err = utils.CreateTemplate("target-template", n.Cfg.TargetTemplate) + n.targetTpl, err = gtemplate.CreateTemplate("target-template", n.Cfg.TargetTemplate) if err != nil { return err } @@ -172,7 +175,7 @@ func (n *NatsOutput) Init(ctx context.Context, name string, cfg map[string]inter } if n.Cfg.MsgTemplate != "" { - n.msgTpl, err = utils.CreateTemplate("msg-template", n.Cfg.MsgTemplate) + n.msgTpl, err = gtemplate.CreateTemplate("msg-template", n.Cfg.MsgTemplate) if err != nil { return err } diff --git a/outputs/nats_outputs/stan/stan_metrics.go b/pkg/outputs/nats_outputs/stan/stan_metrics.go similarity index 100% rename from outputs/nats_outputs/stan/stan_metrics.go rename to pkg/outputs/nats_outputs/stan/stan_metrics.go diff --git a/outputs/nats_outputs/stan/stan_output.go b/pkg/outputs/nats_outputs/stan/stan_output.go similarity index 97% rename from outputs/nats_outputs/stan/stan_output.go rename to pkg/outputs/nats_outputs/stan/stan_output.go index 6b183c58..d861946a 100644 --- a/outputs/nats_outputs/stan/stan_output.go +++ b/pkg/outputs/nats_outputs/stan/stan_output.go @@ -19,15 +19,18 @@ import ( "text/template" "time" + "google.golang.org/protobuf/reflect/protoreflect" + "github.com/google/uuid" "github.com/nats-io/nats.go" "github.com/nats-io/stan.go" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/reflect/protoreflect" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -162,7 +165,7 @@ func (s *StanOutput) Init(ctx context.Context, name string, cfg map[string]inter if s.Cfg.TargetTemplate == "" { s.targetTpl = outputs.DefaultTargetTemplate } else if s.Cfg.AddTarget != "" { - s.targetTpl, err = utils.CreateTemplate("target-template", s.Cfg.TargetTemplate) + s.targetTpl, err = gtemplate.CreateTemplate("target-template", s.Cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/options.go b/pkg/outputs/options.go similarity index 97% rename from outputs/options.go rename to pkg/outputs/options.go index 379714b2..e61ff606 100644 --- a/outputs/options.go +++ b/pkg/outputs/options.go @@ -11,7 +11,7 @@ package outputs import ( "log" - "github.com/openconfig/gnmic/types" + "github.com/openconfig/gnmic/pkg/types" "github.com/prometheus/client_golang/prometheus" ) diff --git a/outputs/output.go b/pkg/outputs/output.go similarity index 96% rename from outputs/output.go rename to pkg/outputs/output.go index 4b607828..2e163fe0 100644 --- a/outputs/output.go +++ b/pkg/outputs/output.go @@ -17,16 +17,17 @@ import ( "strings" "text/template" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" + "github.com/mitchellh/mapstructure" "github.com/openconfig/gnmi/proto/gnmi" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "github.com/openconfig/gnmic/formatters" - _ "github.com/openconfig/gnmic/formatters/all" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + _ "github.com/openconfig/gnmic/pkg/formatters/all" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) type Output interface { diff --git a/outputs/prometheus_output/prometheus_common.go b/pkg/outputs/prometheus_output/prometheus_common.go similarity index 98% rename from outputs/prometheus_output/prometheus_common.go rename to pkg/outputs/prometheus_output/prometheus_common.go index e1adf883..c08ed84f 100644 --- a/outputs/prometheus_output/prometheus_common.go +++ b/pkg/outputs/prometheus_output/prometheus_common.go @@ -21,7 +21,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/prompb" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) const ( diff --git a/outputs/prometheus_output/prometheus_common_test.go b/pkg/outputs/prometheus_output/prometheus_common_test.go similarity index 98% rename from outputs/prometheus_output/prometheus_common_test.go rename to pkg/outputs/prometheus_output/prometheus_common_test.go index e333b883..63cde927 100644 --- a/outputs/prometheus_output/prometheus_common_test.go +++ b/pkg/outputs/prometheus_output/prometheus_common_test.go @@ -11,7 +11,7 @@ package prometheus_output import ( "testing" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" "github.com/prometheus/prometheus/model/labels" ) diff --git a/outputs/prometheus_output/prometheus_output/prometheus_cache.go b/pkg/outputs/prometheus_output/prometheus_output/prometheus_cache.go similarity index 97% rename from outputs/prometheus_output/prometheus_output/prometheus_cache.go rename to pkg/outputs/prometheus_output/prometheus_output/prometheus_cache.go index e8feb0e2..3697cb5b 100644 --- a/outputs/prometheus_output/prometheus_output/prometheus_cache.go +++ b/pkg/outputs/prometheus_output/prometheus_output/prometheus_cache.go @@ -15,7 +15,7 @@ import ( "github.com/openconfig/gnmi/proto/gnmi" "github.com/prometheus/client_golang/prometheus" - "github.com/openconfig/gnmic/formatters" + "github.com/openconfig/gnmic/pkg/formatters" ) func (p *prometheusOutput) collectFromCache(ch chan<- prometheus.Metric) { diff --git a/outputs/prometheus_output/prometheus_output/prometheus_metrics.go b/pkg/outputs/prometheus_output/prometheus_output/prometheus_metrics.go similarity index 100% rename from outputs/prometheus_output/prometheus_output/prometheus_metrics.go rename to pkg/outputs/prometheus_output/prometheus_output/prometheus_metrics.go diff --git a/outputs/prometheus_output/prometheus_output/prometheus_output.go b/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go similarity index 97% rename from outputs/prometheus_output/prometheus_output/prometheus_output.go rename to pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go index a6739422..5e486368 100644 --- a/outputs/prometheus_output/prometheus_output/prometheus_output.go +++ b/pkg/outputs/prometheus_output/prometheus_output/prometheus_output.go @@ -37,12 +37,13 @@ import ( "github.com/prometheus/prometheus/prompb" "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - promcom "github.com/openconfig/gnmic/outputs/prometheus_output" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + promcom "github.com/openconfig/gnmic/pkg/outputs/prometheus_output" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -193,7 +194,7 @@ func (p *prometheusOutput) Init(ctx context.Context, name string, cfg map[string if p.cfg.TargetTemplate == "" { p.targetTpl = outputs.DefaultTargetTemplate } else if p.cfg.AddTarget != "" { - p.targetTpl, err = utils.CreateTemplate("target-template", p.cfg.TargetTemplate) + p.targetTpl, err = gtemplate.CreateTemplate("target-template", p.cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/prometheus_output/prometheus_output/prometheus_service_registration.go b/pkg/outputs/prometheus_output/prometheus_output/prometheus_service_registration.go similarity index 99% rename from outputs/prometheus_output/prometheus_output/prometheus_service_registration.go rename to pkg/outputs/prometheus_output/prometheus_output/prometheus_service_registration.go index 826d9f1c..3b5f49f5 100644 --- a/outputs/prometheus_output/prometheus_output/prometheus_service_registration.go +++ b/pkg/outputs/prometheus_output/prometheus_output/prometheus_service_registration.go @@ -17,7 +17,8 @@ import ( "time" "github.com/hashicorp/consul/api" - "github.com/openconfig/gnmic/lockers" + + "github.com/openconfig/gnmic/pkg/lockers" ) const ( diff --git a/outputs/prometheus_output/prometheus_write_output/prometheus_write_client.go b/pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_client.go similarity index 99% rename from outputs/prometheus_output/prometheus_write_output/prometheus_write_client.go rename to pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_client.go index 9353020f..7c92015c 100644 --- a/outputs/prometheus_output/prometheus_write_output/prometheus_write_client.go +++ b/pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_client.go @@ -22,7 +22,7 @@ import ( "github.com/golang/snappy" "github.com/prometheus/prometheus/prompb" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/utils" ) var ( diff --git a/outputs/prometheus_output/prometheus_write_output/prometheus_write_metrics.go b/pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_metrics.go similarity index 100% rename from outputs/prometheus_output/prometheus_write_output/prometheus_write_metrics.go rename to pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_metrics.go diff --git a/outputs/prometheus_output/prometheus_write_output/prometheus_write_output.go b/pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_output.go similarity index 97% rename from outputs/prometheus_output/prometheus_write_output/prometheus_write_output.go rename to pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_output.go index 7844f500..4ad7455d 100644 --- a/outputs/prometheus_output/prometheus_write_output/prometheus_write_output.go +++ b/pkg/outputs/prometheus_output/prometheus_write_output/prometheus_write_output.go @@ -21,16 +21,18 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + "github.com/openconfig/gnmi/proto/gnmi" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/prompb" - "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - promcom "github.com/openconfig/gnmic/outputs/prometheus_output" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + promcom "github.com/openconfig/gnmic/pkg/outputs/prometheus_output" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -150,7 +152,7 @@ func (p *promWriteOutput) Init(ctx context.Context, name string, cfg map[string] if p.cfg.TargetTemplate == "" { p.targetTpl = outputs.DefaultTargetTemplate } else if p.cfg.AddTarget != "" { - p.targetTpl, err = utils.CreateTemplate("target-template", p.cfg.TargetTemplate) + p.targetTpl, err = gtemplate.CreateTemplate("target-template", p.cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/protometa.go b/pkg/outputs/protometa.go similarity index 100% rename from outputs/protometa.go rename to pkg/outputs/protometa.go diff --git a/outputs/snmp_output/snmp_metrics.go b/pkg/outputs/snmp_output/snmp_metrics.go similarity index 100% rename from outputs/snmp_output/snmp_metrics.go rename to pkg/outputs/snmp_output/snmp_metrics.go diff --git a/outputs/snmp_output/snmp_output.go b/pkg/outputs/snmp_output/snmp_output.go similarity index 97% rename from outputs/snmp_output/snmp_output.go rename to pkg/outputs/snmp_output/snmp_output.go index fd4369a5..d0ddfb78 100644 --- a/outputs/snmp_output/snmp_output.go +++ b/pkg/outputs/snmp_output/snmp_output.go @@ -19,17 +19,20 @@ import ( "text/template" "time" + "google.golang.org/protobuf/proto" + g "github.com/gosnmp/gosnmp" "github.com/itchyny/gojq" + "github.com/openconfig/gnmi/proto/gnmi" "github.com/prometheus/client_golang/prometheus" - "google.golang.org/protobuf/proto" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/cache" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/cache" + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/path" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -185,7 +188,7 @@ func (s *snmpOutput) Init(ctx context.Context, name string, cfg map[string]inter if s.cfg.TargetTemplate == "" { s.targetTpl = outputs.DefaultTargetTemplate } else if s.cfg.AddTarget != "" { - s.targetTpl, err = utils.CreateTemplate("target-template", s.cfg.TargetTemplate) + s.targetTpl, err = gtemplate.CreateTemplate("target-template", s.cfg.TargetTemplate) if err != nil { return err } @@ -491,7 +494,7 @@ func (s *snmpOutput) buildPDUFromCache(bd *binding, targetName string, ev *forma return g.SnmpPDU{}, fmt.Errorf("unexpected XPATH result type: %T", pathResult) } - gp, err := utils.ParsePath(xpath) + gp, err := path.ParsePath(xpath) if err != nil { return g.SnmpPDU{}, err } diff --git a/outputs/tcp_output/tcp_output.go b/pkg/outputs/tcp_output/tcp_output.go similarity index 95% rename from outputs/tcp_output/tcp_output.go rename to pkg/outputs/tcp_output/tcp_output.go index 8b908ea3..252a35ba 100644 --- a/outputs/tcp_output/tcp_output.go +++ b/pkg/outputs/tcp_output/tcp_output.go @@ -18,12 +18,15 @@ import ( "text/template" "time" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" - "github.com/prometheus/client_golang/prometheus" "google.golang.org/protobuf/proto" + + "github.com/prometheus/client_golang/prometheus" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -143,7 +146,7 @@ func (t *tcpOutput) Init(ctx context.Context, name string, cfg map[string]interf if t.cfg.TargetTemplate == "" { t.targetTpl = outputs.DefaultTargetTemplate } else if t.cfg.AddTarget != "" { - t.targetTpl, err = utils.CreateTemplate("target-template", t.cfg.TargetTemplate) + t.targetTpl, err = gtemplate.CreateTemplate("target-template", t.cfg.TargetTemplate) if err != nil { return err } diff --git a/outputs/udp_output/udp_output.go b/pkg/outputs/udp_output/udp_output.go similarity index 95% rename from outputs/udp_output/udp_output.go rename to pkg/outputs/udp_output/udp_output.go index d76eecb5..1979e364 100644 --- a/outputs/udp_output/udp_output.go +++ b/pkg/outputs/udp_output/udp_output.go @@ -18,12 +18,15 @@ import ( "text/template" "time" - "github.com/openconfig/gnmic/formatters" - "github.com/openconfig/gnmic/outputs" - "github.com/openconfig/gnmic/types" - "github.com/openconfig/gnmic/utils" - "github.com/prometheus/client_golang/prometheus" "google.golang.org/protobuf/proto" + + "github.com/prometheus/client_golang/prometheus" + + "github.com/openconfig/gnmic/pkg/formatters" + "github.com/openconfig/gnmic/pkg/gtemplate" + "github.com/openconfig/gnmic/pkg/outputs" + "github.com/openconfig/gnmic/pkg/types" + "github.com/openconfig/gnmic/pkg/utils" ) const ( @@ -140,7 +143,7 @@ func (u *UDPSock) Init(ctx context.Context, name string, cfg map[string]interfac if u.Cfg.TargetTemplate == "" { u.targetTpl = outputs.DefaultTargetTemplate } else if u.Cfg.AddTarget != "" { - u.targetTpl, err = utils.CreateTemplate("target-template", u.Cfg.TargetTemplate) + u.targetTpl, err = gtemplate.CreateTemplate("target-template", u.Cfg.TargetTemplate) if err != nil { return err } diff --git a/pkg/path/go.mod b/pkg/path/go.mod new file mode 100644 index 00000000..d26cb52a --- /dev/null +++ b/pkg/path/go.mod @@ -0,0 +1,22 @@ +module github.com/openconfig/gnmic/pkg/path + +go 1.21.1 + +replace github.com/openconfig/gnmic/pkg/testutils => ../testutils + +require ( + github.com/google/go-cmp v0.6.0 + github.com/openconfig/gnmi v0.10.0 + github.com/openconfig/gnmic/pkg/testutils v0.33.0 +) + +require ( + github.com/golang/protobuf v1.5.3 // indirect + github.com/openconfig/grpctunnel v0.1.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect +) diff --git a/pkg/path/go.sum b/pkg/path/go.sum new file mode 100644 index 00000000..75857e7f --- /dev/null +++ b/pkg/path/go.sum @@ -0,0 +1,25 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= +github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= +github.com/openconfig/grpctunnel v0.1.0 h1:EN99qtlExZczgQgp5ANnHRC/Rs62cAG+Tz2BQ5m/maM= +github.com/openconfig/grpctunnel v0.1.0/go.mod h1:G04Pdu0pml98tdvXrvLaU+EBo3PxYfI9MYqpvdaEHLo= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/utils/path.go b/pkg/path/path.go similarity index 79% rename from utils/path.go rename to pkg/path/path.go index a610c275..f0d5a9ab 100644 --- a/utils/path.go +++ b/pkg/path/path.go @@ -6,10 +6,11 @@ // // SPDX-License-Identifier: Apache-2.0 -package utils +package path import ( "errors" + "sort" "strings" "github.com/openconfig/gnmi/proto/gnmi" @@ -186,3 +187,57 @@ func parseXPathKeys(s string) (map[string]string, error) { } return kvs, nil } + +func PathElems(pf, p *gnmi.Path) []*gnmi.PathElem { + r := make([]*gnmi.PathElem, 0, len(pf.GetElem())+len(p.GetElem())) + r = append(r, pf.GetElem()...) + return append(r, p.GetElem()...) +} + +func GnmiPathToXPath(p *gnmi.Path, noKeys bool) string { + if p == nil { + return "" + } + sb := &strings.Builder{} + if p.Origin != "" { + sb.WriteString(p.Origin) + sb.WriteString(":") + } + elems := p.GetElem() + numElems := len(elems) + + for i, pe := range elems { + sb.WriteString(pe.GetName()) + if !noKeys { + numKeys := len(pe.GetKey()) + switch numKeys { + case 0: + case 1: + for k := range pe.GetKey() { + writeKey(sb, k, pe.GetKey()[k]) + } + default: + keys := make([]string, 0, numKeys) + for k := range pe.GetKey() { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys { + writeKey(sb, k, pe.GetKey()[k]) + } + } + } + if i+1 != numElems { + sb.WriteString("/") + } + } + return sb.String() +} + +func writeKey(sb *strings.Builder, k, v string) { + sb.WriteString("[") + sb.WriteString(k) + sb.WriteString("=") + sb.WriteString(v) + sb.WriteString("]") +} diff --git a/utils/path_test.go b/pkg/path/path_test.go similarity index 99% rename from utils/path_test.go rename to pkg/path/path_test.go index 16a2e820..4e13001a 100644 --- a/utils/path_test.go +++ b/pkg/path/path_test.go @@ -6,7 +6,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package utils +package path import ( "reflect" @@ -15,7 +15,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmic/testutils" + "github.com/openconfig/gnmic/pkg/testutils" ) var prefixSet = map[string]*gnmi.Path{ diff --git a/pkg/target/go.mod b/pkg/target/go.mod new file mode 100644 index 00000000..2ca74988 --- /dev/null +++ b/pkg/target/go.mod @@ -0,0 +1,30 @@ +module github.com/openconfig/gnmic/pkg/target + +go 1.21.1 + +replace ( + github.com/openconfig/gnmic/pkg/types => ../types + github.com/openconfig/gnmic/pkg/utils => ../utils +) + +require ( + github.com/jhump/protoreflect v1.15.3 + github.com/openconfig/gnmi v0.10.0 + github.com/openconfig/gnmic/pkg/types v0.33.0 + golang.org/x/net v0.17.0 + golang.org/x/oauth2 v0.13.0 + google.golang.org/grpc v1.59.0 +) + +require ( + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/bufbuild/protocompile v0.6.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/openconfig/gnmic/pkg/utils v0.33.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/protobuf v1.31.0 // indirect +) diff --git a/pkg/target/go.sum b/pkg/target/go.sum new file mode 100644 index 00000000..c8f1e75d --- /dev/null +++ b/pkg/target/go.sum @@ -0,0 +1,44 @@ +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= +github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= +github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/target/subscribe.go b/pkg/target/subscribe.go similarity index 100% rename from target/subscribe.go rename to pkg/target/subscribe.go diff --git a/target/target.go b/pkg/target/target.go similarity index 99% rename from target/target.go rename to pkg/target/target.go index 5abedf11..9a9437d9 100644 --- a/target/target.go +++ b/pkg/target/target.go @@ -16,16 +16,17 @@ import ( "strings" "sync" - "github.com/jhump/protoreflect/desc" - "github.com/openconfig/gnmi/proto/gnmi" - "github.com/openconfig/gnmi/proto/gnmi_ext" "golang.org/x/net/proxy" "golang.org/x/oauth2" "google.golang.org/grpc" "google.golang.org/grpc/credentials/oauth" "google.golang.org/grpc/metadata" - "github.com/openconfig/gnmic/types" + "github.com/jhump/protoreflect/desc" + "github.com/openconfig/gnmi/proto/gnmi" + "github.com/openconfig/gnmi/proto/gnmi_ext" + + "github.com/openconfig/gnmic/pkg/types" ) type TargetError struct { diff --git a/pkg/testutils/go.mod b/pkg/testutils/go.mod new file mode 100644 index 00000000..c13f3d4d --- /dev/null +++ b/pkg/testutils/go.mod @@ -0,0 +1,19 @@ +module github.com/openconfig/gnmic/pkg/testutils + +go 1.21.1 + +require ( + github.com/google/go-cmp v0.6.0 + github.com/openconfig/gnmi v0.10.0 + github.com/openconfig/grpctunnel v0.1.0 +) + +require ( + github.com/golang/protobuf v1.5.3 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect +) diff --git a/pkg/testutils/go.sum b/pkg/testutils/go.sum new file mode 100644 index 00000000..75857e7f --- /dev/null +++ b/pkg/testutils/go.sum @@ -0,0 +1,25 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= +github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= +github.com/openconfig/grpctunnel v0.1.0 h1:EN99qtlExZczgQgp5ANnHRC/Rs62cAG+Tz2BQ5m/maM= +github.com/openconfig/grpctunnel v0.1.0/go.mod h1:G04Pdu0pml98tdvXrvLaU+EBo3PxYfI9MYqpvdaEHLo= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/testutils/utils.go b/pkg/testutils/utils.go similarity index 100% rename from testutils/utils.go rename to pkg/testutils/utils.go diff --git a/pkg/types/go.mod b/pkg/types/go.mod new file mode 100644 index 00000000..ac351a7d --- /dev/null +++ b/pkg/types/go.mod @@ -0,0 +1,23 @@ +module github.com/openconfig/gnmic/pkg/types + +go 1.21.1 + +replace github.com/openconfig/gnmic/pkg/utils => ../utils + +require ( + github.com/openconfig/gnmic/pkg/utils v0.33.0 + golang.org/x/oauth2 v0.13.0 + google.golang.org/grpc v1.59.0 +) + +require ( + cloud.google.com/go/compute v1.23.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + github.com/golang/protobuf v1.5.3 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/protobuf v1.31.0 // indirect +) diff --git a/pkg/types/go.sum b/pkg/types/go.sum new file mode 100644 index 00000000..127e7168 --- /dev/null +++ b/pkg/types/go.sum @@ -0,0 +1,36 @@ +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/types/sasl.go b/pkg/types/sasl.go similarity index 100% rename from types/sasl.go rename to pkg/types/sasl.go diff --git a/types/subscription.go b/pkg/types/subscription.go similarity index 100% rename from types/subscription.go rename to pkg/types/subscription.go diff --git a/types/target.go b/pkg/types/target.go similarity index 99% rename from types/target.go rename to pkg/types/target.go index 0f769f32..74c03a9a 100644 --- a/types/target.go +++ b/pkg/types/target.go @@ -23,7 +23,7 @@ import ( "google.golang.org/grpc/credentials/oauth" "google.golang.org/grpc/encoding/gzip" - "github.com/openconfig/gnmic/utils" + "github.com/openconfig/gnmic/pkg/utils" ) // TargetConfig // diff --git a/types/tls.go b/pkg/types/tls.go similarity index 100% rename from types/tls.go rename to pkg/types/tls.go diff --git a/pkg/utils/go.mod b/pkg/utils/go.mod new file mode 100644 index 00000000..9ed7926f --- /dev/null +++ b/pkg/utils/go.mod @@ -0,0 +1,5 @@ +module github.com/openconfig/gnmic/pkg/utils + +go 1.21.1 + +require github.com/google/go-cmp v0.6.0 diff --git a/pkg/utils/go.sum b/pkg/utils/go.sum new file mode 100644 index 00000000..5a8d551d --- /dev/null +++ b/pkg/utils/go.sum @@ -0,0 +1,2 @@ +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= diff --git a/utils/tls.go b/pkg/utils/tls.go similarity index 76% rename from utils/tls.go rename to pkg/utils/tls.go index 81bbcb44..664bc4f6 100644 --- a/utils/tls.go +++ b/pkg/utils/tls.go @@ -9,6 +9,7 @@ package utils import ( + "bufio" "bytes" "context" "crypto/rand" @@ -19,7 +20,9 @@ import ( "encoding/pem" "errors" "fmt" + "io" "math/big" + "os" "sync" "time" ) @@ -63,7 +66,7 @@ func NewTLSConfig(ca, cert, key, clientAuth string, skipVerify, genSelfSigned bo go func() { defer wg.Done() var err error - certBytes, err = ReadFile(ctx, cert) + certBytes, err = ReadLocalFile(ctx, cert) if err != nil { errCh <- err return @@ -72,7 +75,7 @@ func NewTLSConfig(ca, cert, key, clientAuth string, skipVerify, genSelfSigned bo go func() { defer wg.Done() var err error - keyBytes, err = ReadFile(ctx, key) + keyBytes, err = ReadLocalFile(ctx, key) if err != nil { errCh <- err return @@ -100,7 +103,7 @@ func NewTLSConfig(ca, cert, key, clientAuth string, skipVerify, genSelfSigned bo certPool := x509.NewCertPool() ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - caFile, err := ReadFile(ctx, ca) + caFile, err := ReadLocalFile(ctx, ca) if err != nil { return nil, err } @@ -147,3 +150,60 @@ func SelfSignedCerts() (tls.Certificate, error) { pem.Encode(keyBuff, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)}) return tls.X509KeyPair(certBuff.Bytes(), keyBuff.Bytes()) } + +// readLocalFile reads a file from the local file system, +// unmarshals the content into a map[string]*types.TargetConfig +// and returns +func ReadLocalFile(ctx context.Context, path string) ([]byte, error) { + // read from stdin + if path == "-" { + return readFromStdin(ctx) + } + + // local file + f, err := os.Open(path) + if err != nil { + return nil, err + } + defer f.Close() + + st, err := f.Stat() + if err != nil { + return nil, err + } + if st.IsDir() { + return nil, fmt.Errorf("%q is a directory", path) + } + data := make([]byte, st.Size()) + + rd := bufio.NewReader(f) + _, err = rd.Read(data) + if err != nil && err != io.EOF { + return nil, err + } + return data, nil +} + +// read bytes from stdin +func readFromStdin(ctx context.Context) ([]byte, error) { + // read from stdin + data := make([]byte, 0, 128) + rd := bufio.NewReader(os.Stdin) + buf := make([]byte, 128) + for { + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + n, err := rd.Read(buf) + if err == io.EOF { + data = append(data, buf[:n]...) + return data, nil + } + if err != nil { + return nil, err + } + data = append(data, buf[:n]...) + } + } +} diff --git a/utils/utils.go b/pkg/utils/utils.go similarity index 60% rename from utils/utils.go rename to pkg/utils/utils.go index 9cbb3c92..9fbab9be 100644 --- a/utils/utils.go +++ b/pkg/utils/utils.go @@ -12,10 +12,6 @@ import ( "log" "net" "reflect" - "sort" - "strings" - - "github.com/openconfig/gnmi/proto/gnmi" ) const ( @@ -48,60 +44,6 @@ func mapify(i interface{}) (map[string]interface{}, bool) { return map[string]interface{}{}, false } -func PathElems(pf, p *gnmi.Path) []*gnmi.PathElem { - r := make([]*gnmi.PathElem, 0, len(pf.GetElem())+len(p.GetElem())) - r = append(r, pf.GetElem()...) - return append(r, p.GetElem()...) -} - -func GnmiPathToXPath(p *gnmi.Path, noKeys bool) string { - if p == nil { - return "" - } - sb := &strings.Builder{} - if p.Origin != "" { - sb.WriteString(p.Origin) - sb.WriteString(":") - } - elems := p.GetElem() - numElems := len(elems) - - for i, pe := range elems { - sb.WriteString(pe.GetName()) - if !noKeys { - numKeys := len(pe.GetKey()) - switch numKeys { - case 0: - case 1: - for k := range pe.GetKey() { - writeKey(sb, k, pe.GetKey()[k]) - } - default: - keys := make([]string, 0, numKeys) - for k := range pe.GetKey() { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - writeKey(sb, k, pe.GetKey()[k]) - } - } - } - if i+1 != numElems { - sb.WriteString("/") - } - } - return sb.String() -} - -func writeKey(sb *strings.Builder, k, v string) { - sb.WriteString("[") - sb.WriteString(k) - sb.WriteString("=") - sb.WriteString(v) - sb.WriteString("]") -} - func GetHost(hostport string) string { h, _, err := net.SplitHostPort(hostport) if err != nil { diff --git a/utils/utils_test.go b/pkg/utils/utils_test.go similarity index 100% rename from utils/utils_test.go rename to pkg/utils/utils_test.go diff --git a/utils/template_funcs.go b/utils/template_funcs.go deleted file mode 100644 index c7c95562..00000000 --- a/utils/template_funcs.go +++ /dev/null @@ -1,23 +0,0 @@ -package utils - -import ( - "context" - "text/template" - - "github.com/hairyhenderson/gomplate/v3" - "github.com/hairyhenderson/gomplate/v3/data" -) - -type templateEngine interface { - CreateFuncs() template.FuncMap -} - -func NewTemplateEngine() templateEngine { - return &gmplt{} -} - -type gmplt struct{} - -func (*gmplt) CreateFuncs() template.FuncMap { - return gomplate.CreateFuncs(context.TODO(), new(data.Data)) -} From 6f67edac64ea3a96ed4dfd076afd7c97d2196485 Mon Sep 17 00:00:00 2001 From: Karim Radhouani Date: Wed, 8 Nov 2023 11:33:22 -0800 Subject: [PATCH 2/4] remove .work files --- .gitignore | 3 +- go.work | 12 -- go.work.sum | 480 ---------------------------------------------------- 3 files changed, 2 insertions(+), 493 deletions(-) delete mode 100644 go.work delete mode 100644 go.work.sum diff --git a/.gitignore b/.gitignore index b333f0e5..a44b777a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ builds/ dist *.log gnmic -*.tmp \ No newline at end of file +*.tmp +*.work.* \ No newline at end of file diff --git a/go.work b/go.work deleted file mode 100644 index 2f03fc80..00000000 --- a/go.work +++ /dev/null @@ -1,12 +0,0 @@ -go 1.21.1 - -use ( - . - ./pkg/api - ./pkg/cache - ./pkg/path - ./pkg/target - ./pkg/testutils - ./pkg/types - ./pkg/utils -) diff --git a/go.work.sum b/go.work.sum deleted file mode 100644 index f8c3b549..00000000 --- a/go.work.sum +++ /dev/null @@ -1,480 +0,0 @@ -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go/accessapproval v1.7.1/go.mod h1:JYczztsHRMK7NTXb6Xw+dwbs/WnOJxbo/2mTI+Kgg68= -cloud.google.com/go/accesscontextmanager v1.8.1/go.mod h1:JFJHfvuaTC+++1iL1coPiG1eu5D24db2wXCDWDjIrxo= -cloud.google.com/go/aiplatform v1.48.0/go.mod h1:Iu2Q7sC7QGhXUeOhAj/oCK9a+ULz1O4AotZiqjQ8MYA= -cloud.google.com/go/analytics v0.21.3/go.mod h1:U8dcUtmDmjrmUTnnnRnI4m6zKn/yaA5N9RlEkYFHpQo= -cloud.google.com/go/apigateway v1.6.1/go.mod h1:ufAS3wpbRjqfZrzpvLC2oh0MFlpRJm2E/ts25yyqmXA= -cloud.google.com/go/apigeeconnect v1.6.1/go.mod h1:C4awq7x0JpLtrlQCr8AzVIzAaYgngRqWf9S5Uhg+wWs= -cloud.google.com/go/apigeeregistry v0.7.1/go.mod h1:1XgyjZye4Mqtw7T9TsY4NW10U7BojBvG4RMD+vRDrIw= -cloud.google.com/go/apikeys v0.5.0/go.mod h1:5aQfwY4D+ewMMWScd3hm2en3hCj+BROlyrt3ytS7KLI= -cloud.google.com/go/appengine v1.8.1/go.mod h1:6NJXGLVhZCN9aQ/AEDvmfzKEfoYBlfB80/BHiKVputY= -cloud.google.com/go/area120 v0.8.1/go.mod h1:BVfZpGpB7KFVNxPiQBuHkX6Ed0rS51xIgmGyjrAfzsg= -cloud.google.com/go/artifactregistry v1.14.1/go.mod h1:nxVdG19jTaSTu7yA7+VbWL346r3rIdkZ142BSQqhn5E= -cloud.google.com/go/asset v1.14.1/go.mod h1:4bEJ3dnHCqWCDbWJ/6Vn7GVI9LerSi7Rfdi03hd+WTQ= -cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= -cloud.google.com/go/automl v1.13.1/go.mod h1:1aowgAHWYZU27MybSCFiukPO7xnyawv7pt3zK4bheQE= -cloud.google.com/go/baremetalsolution v1.1.1/go.mod h1:D1AV6xwOksJMV4OSlWHtWuFNZZYujJknMAP4Qa27QIA= -cloud.google.com/go/batch v1.3.1/go.mod h1:VguXeQKXIYaeeIYbuozUmBR13AfL4SJP7IltNPS+A4A= -cloud.google.com/go/beyondcorp v1.0.0/go.mod h1:YhxDWw946SCbmcWo3fAhw3V4XZMSpQ/VYfcKGAEU8/4= -cloud.google.com/go/bigquery v1.53.0/go.mod h1:3b/iXjRQGU4nKa87cXeg6/gogLjO8C6PmuM8i5Bi/u4= -cloud.google.com/go/billing v1.16.0/go.mod h1:y8vx09JSSJG02k5QxbycNRrN7FGZB6F3CAcgum7jvGA= -cloud.google.com/go/binaryauthorization v1.6.1/go.mod h1:TKt4pa8xhowwffiBmbrbcxijJRZED4zrqnwZ1lKH51U= -cloud.google.com/go/certificatemanager v1.7.1/go.mod h1:iW8J3nG6SaRYImIa+wXQ0g8IgoofDFRp5UMzaNk1UqI= -cloud.google.com/go/channel v1.16.0/go.mod h1:eN/q1PFSl5gyu0dYdmxNXscY/4Fi7ABmeHCJNf/oHmc= -cloud.google.com/go/cloudbuild v1.13.0/go.mod h1:lyJg7v97SUIPq4RC2sGsz/9tNczhyv2AjML/ci4ulzU= -cloud.google.com/go/clouddms v1.6.1/go.mod h1:Ygo1vL52Ov4TBZQquhz5fiw2CQ58gvu+PlS6PVXCpZI= -cloud.google.com/go/cloudtasks v1.12.1/go.mod h1:a9udmnou9KO2iulGscKR0qBYjreuX8oHwpmFsKspEvM= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= -cloud.google.com/go/compute v1.19.3/go.mod h1:qxvISKp/gYnXkSAD1ppcSOveRAmzxicEv/JlizULFrI= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/contactcenterinsights v1.10.0/go.mod h1:bsg/R7zGLYMVxFFzfh9ooLTruLRCG9fnzhH9KznHhbM= -cloud.google.com/go/container v1.24.0/go.mod h1:lTNExE2R7f+DLbAN+rJiKTisauFCaoDq6NURZ83eVH4= -cloud.google.com/go/containeranalysis v0.10.1/go.mod h1:Ya2jiILITMY68ZLPaogjmOMNkwsDrWBSTyBubGXO7j0= -cloud.google.com/go/datacatalog v1.16.0/go.mod h1:d2CevwTG4yedZilwe+v3E3ZBDRMobQfSG/a6cCCN5R4= -cloud.google.com/go/dataflow v0.9.1/go.mod h1:Wp7s32QjYuQDWqJPFFlnBKhkAtiFpMTdg00qGbnIHVw= -cloud.google.com/go/dataform v0.8.1/go.mod h1:3BhPSiw8xmppbgzeBbmDvmSWlwouuJkXsXsb8UBih9M= -cloud.google.com/go/datafusion v1.7.1/go.mod h1:KpoTBbFmoToDExJUso/fcCiguGDk7MEzOWXUsJo0wsI= -cloud.google.com/go/datalabeling v0.8.1/go.mod h1:XS62LBSVPbYR54GfYQsPXZjTW8UxCK2fkDciSrpRFdY= -cloud.google.com/go/dataplex v1.9.0/go.mod h1:7TyrDT6BCdI8/38Uvp0/ZxBslOslP2X2MPDucliyvSE= -cloud.google.com/go/dataproc v1.12.0/go.mod h1:zrF3aX0uV3ikkMz6z4uBbIKyhRITnxvr4i3IjKsKrw4= -cloud.google.com/go/dataproc/v2 v2.0.1/go.mod h1:7Ez3KRHdFGcfY7GcevBbvozX+zyWGcwLJvvAMwCaoZ4= -cloud.google.com/go/dataqna v0.8.1/go.mod h1:zxZM0Bl6liMePWsHA8RMGAfmTG34vJMapbHAxQ5+WA8= -cloud.google.com/go/datastore v1.13.0/go.mod h1:KjdB88W897MRITkvWWJrg2OUtrR5XVj1EoLgSp6/N70= -cloud.google.com/go/datastream v1.10.0/go.mod h1:hqnmr8kdUBmrnk65k5wNRoHSCYksvpdZIcZIEl8h43Q= -cloud.google.com/go/deploy v1.13.0/go.mod h1:tKuSUV5pXbn67KiubiUNUejqLs4f5cxxiCNCeyl0F2g= -cloud.google.com/go/dialogflow v1.40.0/go.mod h1:L7jnH+JL2mtmdChzAIcXQHXMvQkE3U4hTaNltEuxXn4= -cloud.google.com/go/dlp v1.10.1/go.mod h1:IM8BWz1iJd8njcNcG0+Kyd9OPnqnRNkDV8j42VT5KOI= -cloud.google.com/go/documentai v1.22.0/go.mod h1:yJkInoMcK0qNAEdRnqY/D5asy73tnPe88I1YTZT+a8E= -cloud.google.com/go/domains v0.9.1/go.mod h1:aOp1c0MbejQQ2Pjf1iJvnVyT+z6R6s8pX66KaCSDYfE= -cloud.google.com/go/edgecontainer v1.1.1/go.mod h1:O5bYcS//7MELQZs3+7mabRqoWQhXCzenBu0R8bz2rwk= -cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= -cloud.google.com/go/essentialcontacts v1.6.2/go.mod h1:T2tB6tX+TRak7i88Fb2N9Ok3PvY3UNbUsMag9/BARh4= -cloud.google.com/go/eventarc v1.13.0/go.mod h1:mAFCW6lukH5+IZjkvrEss+jmt2kOdYlN8aMx3sRJiAI= -cloud.google.com/go/filestore v1.7.1/go.mod h1:y10jsorq40JJnjR/lQ8AfFbbcGlw3g+Dp8oN7i7FjV4= -cloud.google.com/go/firestore v1.12.0/go.mod h1:b38dKhgzlmNNGTNZZwe7ZRFEuRab1Hay3/DBsIGKKy4= -cloud.google.com/go/functions v1.15.1/go.mod h1:P5yNWUTkyU+LvW/S9O6V+V423VZooALQlqoXdoPz5AE= -cloud.google.com/go/gaming v1.9.0/go.mod h1:Fc7kEmCObylSWLO334NcO+O9QMDyz+TKC4v1D7X+Bc0= -cloud.google.com/go/gkebackup v1.3.0/go.mod h1:vUDOu++N0U5qs4IhG1pcOnD1Mac79xWy6GoBFlWCWBU= -cloud.google.com/go/gkeconnect v0.8.1/go.mod h1:KWiK1g9sDLZqhxB2xEuPV8V9NYzrqTUmQR9shJHpOZw= -cloud.google.com/go/gkehub v0.14.1/go.mod h1:VEXKIJZ2avzrbd7u+zeMtW00Y8ddk/4V9511C9CQGTY= -cloud.google.com/go/gkemulticloud v1.0.0/go.mod h1:kbZ3HKyTsiwqKX7Yw56+wUGwwNZViRnxWK2DVknXWfw= -cloud.google.com/go/gsuiteaddons v1.6.1/go.mod h1:CodrdOqRZcLp5WOwejHWYBjZvfY0kOphkAKpF/3qdZY= -cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= -cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/iap v1.8.1/go.mod h1:sJCbeqg3mvWLqjZNsI6dfAtbbV1DL2Rl7e1mTyXYREQ= -cloud.google.com/go/ids v1.4.1/go.mod h1:np41ed8YMU8zOgv53MMMoCntLTn2lF+SUzlM+O3u/jw= -cloud.google.com/go/iot v1.7.1/go.mod h1:46Mgw7ev1k9KqK1ao0ayW9h0lI+3hxeanz+L1zmbbbk= -cloud.google.com/go/kms v1.15.0/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/language v1.10.1/go.mod h1:CPp94nsdVNiQEt1CNjF5WkTcisLiHPyIbMhvR8H2AW0= -cloud.google.com/go/lifesciences v0.9.1/go.mod h1:hACAOd1fFbCGLr/+weUKRAJas82Y4vrL3O5326N//Wc= -cloud.google.com/go/logging v1.7.0/go.mod h1:3xjP2CjkM3ZkO73aj4ASA5wRPGGCRrPIAeNqVNkzY8M= -cloud.google.com/go/longrunning v0.5.0/go.mod h1:0JNuqRShmscVAhIACGtskSAWtqtOoPkwP0YF1oVEchc= -cloud.google.com/go/longrunning v0.5.1/go.mod h1:spvimkwdz6SPWKEt/XBij79E9fiTkHSQl/fRUUQJYJc= -cloud.google.com/go/managedidentities v1.6.1/go.mod h1:h/irGhTN2SkZ64F43tfGPMbHnypMbu4RB3yl8YcuEak= -cloud.google.com/go/maps v1.4.0/go.mod h1:6mWTUv+WhnOwAgjVsSW2QPPECmW+s3PcRyOa9vgG/5s= -cloud.google.com/go/mediatranslation v0.8.1/go.mod h1:L/7hBdEYbYHQJhX2sldtTO5SZZ1C1vkapubj0T2aGig= -cloud.google.com/go/memcache v1.10.1/go.mod h1:47YRQIarv4I3QS5+hoETgKO40InqzLP6kpNLvyXuyaA= -cloud.google.com/go/metastore v1.12.0/go.mod h1:uZuSo80U3Wd4zi6C22ZZliOUJ3XeM/MlYi/z5OAOWRA= -cloud.google.com/go/monitoring v1.15.1/go.mod h1:lADlSAlFdbqQuwwpaImhsJXu1QSdd3ojypXrFSMr2rM= -cloud.google.com/go/networkconnectivity v1.12.1/go.mod h1:PelxSWYM7Sh9/guf8CFhi6vIqf19Ir/sbfZRUwXh92E= -cloud.google.com/go/networkmanagement v1.8.0/go.mod h1:Ho/BUGmtyEqrttTgWEe7m+8vDdK74ibQc+Be0q7Fof0= -cloud.google.com/go/networksecurity v0.9.1/go.mod h1:MCMdxOKQ30wsBI1eI659f9kEp4wuuAueoC9AJKSPWZQ= -cloud.google.com/go/notebooks v1.9.1/go.mod h1:zqG9/gk05JrzgBt4ghLzEepPHNwE5jgPcHZRKhlC1A8= -cloud.google.com/go/optimization v1.4.1/go.mod h1:j64vZQP7h9bO49m2rVaTVoNM0vEBEN5eKPUPbZyXOrk= -cloud.google.com/go/orchestration v1.8.1/go.mod h1:4sluRF3wgbYVRqz7zJ1/EUNc90TTprliq9477fGobD8= -cloud.google.com/go/orgpolicy v1.11.1/go.mod h1:8+E3jQcpZJQliP+zaFfayC2Pg5bmhuLK755wKhIIUCE= -cloud.google.com/go/osconfig v1.12.1/go.mod h1:4CjBxND0gswz2gfYRCUoUzCm9zCABp91EeTtWXyz0tE= -cloud.google.com/go/oslogin v1.10.1/go.mod h1:x692z7yAue5nE7CsSnoG0aaMbNoRJRXO4sn73R+ZqAs= -cloud.google.com/go/phishingprotection v0.8.1/go.mod h1:AxonW7GovcA8qdEk13NfHq9hNx5KPtfxXNeUxTDxB6I= -cloud.google.com/go/policytroubleshooter v1.8.0/go.mod h1:tmn5Ir5EToWe384EuboTcVQT7nTag2+DuH3uHmKd1HU= -cloud.google.com/go/privatecatalog v0.9.1/go.mod h1:0XlDXW2unJXdf9zFz968Hp35gl/bhF4twwpXZAW50JA= -cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/pubsublite v1.8.1/go.mod h1:fOLdU4f5xldK4RGJrBMm+J7zMWNj/k4PxwEZXy39QS0= -cloud.google.com/go/recaptchaenterprise/v2 v2.7.2/go.mod h1:kR0KjsJS7Jt1YSyWFkseQ756D45kaYNTlDPPaRAvDBU= -cloud.google.com/go/recommendationengine v0.8.1/go.mod h1:MrZihWwtFYWDzE6Hz5nKcNz3gLizXVIDI/o3G1DLcrE= -cloud.google.com/go/recommender v1.10.1/go.mod h1:XFvrE4Suqn5Cq0Lf+mCP6oBHD/yRMA8XxP5sb7Q7gpA= -cloud.google.com/go/redis v1.13.1/go.mod h1:VP7DGLpE91M6bcsDdMuyCm2hIpB6Vp2hI090Mfd1tcg= -cloud.google.com/go/resourcemanager v1.9.1/go.mod h1:dVCuosgrh1tINZ/RwBufr8lULmWGOkPS8gL5gqyjdT8= -cloud.google.com/go/resourcesettings v1.6.1/go.mod h1:M7mk9PIZrC5Fgsu1kZJci6mpgN8o0IUzVx3eJU3y4Jw= -cloud.google.com/go/retail v1.14.1/go.mod h1:y3Wv3Vr2k54dLNIrCzenyKG8g8dhvhncT2NcNjb/6gE= -cloud.google.com/go/run v1.2.0/go.mod h1:36V1IlDzQ0XxbQjUx6IYbw8H3TJnWvhii963WW3B/bo= -cloud.google.com/go/scheduler v1.10.1/go.mod h1:R63Ldltd47Bs4gnhQkmNDse5w8gBRrhObZ54PxgR2Oo= -cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw= -cloud.google.com/go/security v1.15.1/go.mod h1:MvTnnbsWnehoizHi09zoiZob0iCHVcL4AUBj76h9fXA= -cloud.google.com/go/securitycenter v1.23.0/go.mod h1:8pwQ4n+Y9WCWM278R8W3nF65QtY172h4S8aXyI9/hsQ= -cloud.google.com/go/servicecontrol v1.11.0/go.mod h1:kFmTzYzTUIuZs0ycVqRHNaNhgR+UMUpw9n02l/pY+mc= -cloud.google.com/go/servicedirectory v1.11.0/go.mod h1:Xv0YVH8s4pVOwfM/1eMTl0XJ6bzIOSLDt8f8eLaGOxQ= -cloud.google.com/go/servicemanagement v1.6.0/go.mod h1:aWns7EeeCOtGEX4OvZUWCCJONRZeFKiptqKf1D0l/Jc= -cloud.google.com/go/serviceusage v1.5.0/go.mod h1:w8U1JvqUqwJNPEOTQjrMHkw3IaIFLoLsPLvsE3xueec= -cloud.google.com/go/shell v1.7.1/go.mod h1:u1RaM+huXFaTojTbW4g9P5emOrrmLE69KrxqQahKn4g= -cloud.google.com/go/spanner v1.47.0/go.mod h1:IXsJwVW2j4UKs0eYDqodab6HgGuA1bViSqW4uH9lfUI= -cloud.google.com/go/speech v1.19.0/go.mod h1:8rVNzU43tQvxDaGvqOhpDqgkJTFowBpDvCJ14kGlJYo= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= -cloud.google.com/go/storagetransfer v1.10.0/go.mod h1:DM4sTlSmGiNczmV6iZyceIh2dbs+7z2Ayg6YAiQlYfA= -cloud.google.com/go/talent v1.6.2/go.mod h1:CbGvmKCG61mkdjcqTcLOkb2ZN1SrQI8MDyma2l7VD24= -cloud.google.com/go/texttospeech v1.7.1/go.mod h1:m7QfG5IXxeneGqTapXNxv2ItxP/FS0hCZBwXYqucgSk= -cloud.google.com/go/tpu v1.6.1/go.mod h1:sOdcHVIgDEEOKuqUoi6Fq53MKHJAtOwtz0GuKsWSH3E= -cloud.google.com/go/trace v1.10.1/go.mod h1:gbtL94KE5AJLH3y+WVpfWILmqgc6dXcqgNXdOPAQTYk= -cloud.google.com/go/translate v1.8.2/go.mod h1:d1ZH5aaOA0CNhWeXeC8ujd4tdCFw8XoNWRljklu5RHs= -cloud.google.com/go/video v1.19.0/go.mod h1:9qmqPqw/Ib2tLqaeHgtakU+l5TcJxCJbhFXM7UJjVzU= -cloud.google.com/go/videointelligence v1.11.1/go.mod h1:76xn/8InyQHarjTWsBR058SmlPCwQjgcvoW0aZykOvo= -cloud.google.com/go/vision/v2 v2.7.2/go.mod h1:jKa8oSYBWhYiXarHPvP4USxYANYUEdEsQrloLjrSwJU= -cloud.google.com/go/vmmigration v1.7.1/go.mod h1:WD+5z7a/IpZ5bKK//YmT9E047AD+rjycCAvyMxGJbro= -cloud.google.com/go/vmwareengine v1.0.0/go.mod h1:Px64x+BvjPZwWuc4HdmVhoygcXqEkGHXoa7uyfTgSI0= -cloud.google.com/go/vpcaccess v1.7.1/go.mod h1:FogoD46/ZU+JUBX9D606X21EnxiszYi2tArQwLY4SXs= -cloud.google.com/go/webrisk v1.9.1/go.mod h1:4GCmXKcOa2BZcZPn6DCEvE7HypmEJcJkr4mtM+sqYPc= -cloud.google.com/go/websecurityscanner v1.6.1/go.mod h1:Njgaw3rttgRHXzwCB8kgCYqv5/rGpFCsBOvPbYgszpg= -cloud.google.com/go/workflows v1.11.1/go.mod h1:Z+t10G1wF7h8LgdY/EmRcQY8ptBD/nvofaL6FqlET6g= -github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.1/go.mod h1:DffdKW9RFqa5VgmsjUOsS7UE7eiA5iAvYUs63bhKQ0M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= -github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.44.206/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.44.276/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= -github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= -github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= -github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= -github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= -github.com/digitalocean/godo v1.99.0/go.mod h1:SsS2oXo2rznfM/nORlZ/6JaUJZFhmKTib1YhopUc8NA= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQLaTEw+YhGluxZkrTmD0g= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= -github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= -github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= -github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= -github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gophercloud/gophercloud v1.4.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= -github.com/hashicorp/consul/api v1.13.0/go.mod h1:ZlVrynguJKcYr54zGaDbaL3fOvKC9m72FhPvA8T35KQ= -github.com/hashicorp/consul/api v1.25.1/go.mod h1:iiLVwR/htV7mas/sy0O+XSuEnrdBUUydemjxcUrAt4g= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-msgpack v1.1.5/go.mod h1:gWVc3sv/wbDmR3rQsj1CAktEZzoz1YNK9NfGLXJ69/4= -github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= -github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= -github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= -github.com/hashicorp/nomad/api v0.0.0-20230605233119-67e39d5d248f/go.mod h1:Xjd3OXUTfsWbCCBsQd3EdfPTz5evDi+fxqdvpN+WqQg= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hetznercloud/hcloud-go v1.45.1/go.mod h1:aAUGxSfSnB8/lVXHNEDxtCT1jykaul8kqjD7f5KQXF8= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/ionos-cloud/sdk-go/v6 v6.1.7/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b/go.mod h1:pcaDhQK0/NJZEvtCO0qQPPropqV0sJOJ6YW7X+9kRwM= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/linode/linodego v1.17.0/go.mod h1:/omzPxie0/YI6S0sTw1q47qDt5IYSlbO/infRR4UG+A= -github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/miekg/dns v1.1.54/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY= -github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= -github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/ovh/go-ovh v1.4.1/go.mod h1:6bL6pPyUT7tBfI0pqOegJgRjgjuO+mOo+MyXd1EEC0M= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/prometheus/alertmanager v0.25.0/go.mod h1:MEZ3rFVHqKZsw7IcNS/m4AWZeXThmJhumpiWR4eHU/w= -github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= -github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI= -github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= -github.com/prometheus/exporter-toolkit v0.10.0/go.mod h1:+sVFzuvV5JDyw+Ih6p3zFxZNVnKQa3x5qPmDSiPu4ZY= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/protocolbuffers/txtpbfmt v0.0.0-20220608084003-fc78c767cd6a/go.mod h1:KjY0wibdYKc4DYkerHSbguaf3JeIPGhNJBp2BNiFH78= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= -github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.17/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= -github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= -github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= -github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0/go.mod h1:XiYsayHc36K3EByOO6nbAXnAWbrUxdjUROCEeeROOH8= -go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0/go.mod h1:vLarbg68dH2Wa77g71zmKQqlQ8+8Rq3GRG31uc0WcWI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0/go.mod h1:JgXSGah17croqhJfhByOLVY719k1emAXC8MVhCIJlRs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0/go.mod h1:I33vtIe0sR96wfrUcilIzLoA3mLHhRmz9S9Te0S3gDo= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0/go.mod h1:hGXzO5bhhSHZnKvrDaXB82Y9DRFour0Nz/KrBh7reWw= -go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= -go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= -go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20190424220101-1e8e1cfdf96b/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= -google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220527130721-00d5c0f3be58/go.mod h1:yKyY4AMRwFiC8yMMNaMi+RkCnjZJt9LoWuvhXjMs+To= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230320184635-7606e756e683/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20230803162519-f966b187b2e5/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.51.0-dev/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= -k8s.io/api v0.27.3/go.mod h1:C4BNvZnQOF7JA/0Xed2S+aUyJSfTGkGFxLXz9MnpIpg= -k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= -k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= -k8s.io/client-go v0.27.3/go.mod h1:2MBEKuTo6V1lbKy3z1euEGnhPfGZLKTS9tiJ2xodM48= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 771ac07c0c43c3e5fe2121c30cf9293a8788fee3 Mon Sep 17 00:00:00 2001 From: Karim Radhouani Date: Wed, 8 Nov 2023 13:19:28 -0800 Subject: [PATCH 3/4] fix tests --- .github/workflows/test.yml | 8 +--- .gitignore | 2 +- pkg/cache/go.mod | 4 ++ pkg/cache/go.sum | 84 +++++++++++++++++++++++++++++++++----- tests/run_tests.sh | 22 ++++++++++ 5 files changed, 102 insertions(+), 18 deletions(-) create mode 100755 tests/run_tests.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dfee85f..084f6ba7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,13 +26,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.GOVER }} - - run: | - go test -cover ./... - go test -cover ./pkg/utils - go test -cover ./pkg/target - go test -cover ./pkg/path - go test -cover ./pkg/cache - go test -cover ./pkg/api + - run: ./tests/run_tests.sh env: CGO_ENABLED: 0 # run staticcheck diff --git a/.gitignore b/.gitignore index a44b777a..3e6eeb78 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ dist *.log gnmic *.tmp -*.work.* \ No newline at end of file +*.work* \ No newline at end of file diff --git a/pkg/cache/go.mod b/pkg/cache/go.mod index f06aa59d..ec7468a6 100644 --- a/pkg/cache/go.mod +++ b/pkg/cache/go.mod @@ -19,6 +19,7 @@ require ( ) require ( + github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/golang/glog v1.1.2 // indirect @@ -28,6 +29,9 @@ require ( github.com/nats-io/jwt/v2 v2.5.2 // indirect github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect + github.com/onsi/gomega v1.27.4 // indirect + github.com/openconfig/goyang v1.4.2 // indirect + github.com/openconfig/ygot v0.29.2 // indirect golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect diff --git a/pkg/cache/go.sum b/pkg/cache/go.sum index d1562558..3d4f5ab3 100644 --- a/pkg/cache/go.sum +++ b/pkg/cache/go.sum @@ -1,21 +1,41 @@ -github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/protobuf v3.11.4+incompatible/go.mod h1:lUQ9D1ePzbH2PrIS7ob/bjm9HXyH5WHB0Akwh7URreM= github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -36,37 +56,81 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= +github.com/openconfig/gnmi v0.0.0-20200414194230-1597cc0f2600/go.mod h1:M/EcuapNQgvzxo1DDXHK4tx3QpYM/uG4l591v33jG2A= github.com/openconfig/gnmi v0.10.0 h1:kQEZ/9ek3Vp2Y5IVuV2L/ba8/77TgjdXg505QXvYmg8= github.com/openconfig/gnmi v0.10.0/go.mod h1:Y9os75GmSkhHw2wX8sMsxfI7qRGAEcDh8NTa5a8vj6E= -github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea h1:5MyIz4bN4vpH6aHDN339bkWXAjTkhg1ZKMhR4aIi5Rk= github.com/openconfig/goyang v0.0.0-20200115183954-d0a48929f0ea/go.mod h1:dhXaV0JgHJzdrHi2l+w0fZrwArtXL7jEFoiqLEdmkvU= +github.com/openconfig/goyang v1.4.2 h1:inJe/BwVSBIhDN003MVKPUNeLDlLPJrvNV+ZsXdKNxc= +github.com/openconfig/goyang v1.4.2/go.mod h1:vX61x01Q46AzbZUzG617vWqh/cB+aisc+RrNkXRd3W8= github.com/openconfig/grpctunnel v0.1.0 h1:EN99qtlExZczgQgp5ANnHRC/Rs62cAG+Tz2BQ5m/maM= github.com/openconfig/grpctunnel v0.1.0/go.mod h1:G04Pdu0pml98tdvXrvLaU+EBo3PxYfI9MYqpvdaEHLo= -github.com/openconfig/ygot v0.6.0 h1:kJJFPBrczC6TDnz/HMlFTJEdW2CuyUftV13XveIukg0= github.com/openconfig/ygot v0.6.0/go.mod h1:o30svNf7O0xK+R35tlx95odkDmZWS9JyWWQSmIhqwAs= +github.com/openconfig/ygot v0.29.2 h1:K0cRipc6LluVEQv6+/CCyr8dJuAI9PHhOFtgJHwhCjI= +github.com/openconfig/ygot v0.29.2/go.mod h1:i0wozoTfFxK7SuMBHhAigyl6+e2BTCb1QYsFW9NLmjQ= +github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 00000000..4a00e915 --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +function testmodule +{ + cd $1 + go test -cover ./... + cd $SCRIPTPATH/.. +} + +declare -a modules=("." "pkg/api" "pkg/cache" "pkg/path" "pkg/target" "pkg/testutils" "pkg/types" "pkg/utils") + +SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" + +cd $SCRIPTPATH/.. + +for i in "${modules[@]}" +do + echo "Running tests for module $i" + testmodule "$i" +done From 212eb32acec9b95b912264fcf05ec096101102f4 Mon Sep 17 00:00:00 2001 From: Karim Radhouani Date: Thu, 9 Nov 2023 08:06:01 -0800 Subject: [PATCH 4/4] fix release action tests --- .github/workflows/release.yml | 8 +------- go.mod | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcdb2d75..4acc0ee0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,13 +24,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: ${{ env.GOVER }} - - run: | - go test -cover ./... - go test -cover ./pkg/utils - go test -cover ./pkg/target - go test -cover ./pkg/path - go test -cover ./pkg/cache - go test -cover ./pkg/api + - run: ./tests/run_tests.sh env: CGO_ENABLED: 0 diff --git a/go.mod b/go.mod index 2032f43e..8905979f 100644 --- a/go.mod +++ b/go.mod @@ -48,8 +48,8 @@ require ( github.com/nsf/termbox-go v1.1.1 github.com/olekukonko/tablewriter v0.0.5 github.com/openconfig/gnmi v0.10.0 - github.com/openconfig/gnmic/pkg/api v0.0.0 - github.com/openconfig/gnmic/pkg/cache v0.0.0 + github.com/openconfig/gnmic/pkg/api v0.33.0 + github.com/openconfig/gnmic/pkg/cache v0.33.0 github.com/openconfig/gnmic/pkg/path v0.33.0 github.com/openconfig/gnmic/pkg/target v0.33.0 github.com/openconfig/gnmic/pkg/testutils v0.33.0