diff --git a/api/api.go b/pkg/api/api.go similarity index 100% rename from api/api.go rename to pkg/api/api.go diff --git a/api/ccache.go b/pkg/api/ccache.go similarity index 100% rename from api/ccache.go rename to pkg/api/ccache.go diff --git a/api/ccache_test.go b/pkg/api/ccache_test.go similarity index 100% rename from api/ccache_test.go rename to pkg/api/ccache_test.go diff --git a/api/cluster.go b/pkg/api/cluster.go similarity index 100% rename from api/cluster.go rename to pkg/api/cluster.go diff --git a/api/config.go b/pkg/api/config.go similarity index 100% rename from api/config.go rename to pkg/api/config.go diff --git a/api/dataprocessor.go b/pkg/api/dataprocessor.go similarity index 100% rename from api/dataprocessor.go rename to pkg/api/dataprocessor.go diff --git a/api/dataprocessor_test.go b/pkg/api/dataprocessor_test.go similarity index 100% rename from api/dataprocessor_test.go rename to pkg/api/dataprocessor_test.go diff --git a/api/graphite.go b/pkg/api/graphite.go similarity index 100% rename from api/graphite.go rename to pkg/api/graphite.go diff --git a/api/graphite_proxy.go b/pkg/api/graphite_proxy.go similarity index 100% rename from api/graphite_proxy.go rename to pkg/api/graphite_proxy.go diff --git a/api/graphite_req.go b/pkg/api/graphite_req.go similarity index 100% rename from api/graphite_req.go rename to pkg/api/graphite_req.go diff --git a/api/graphite_test.go b/pkg/api/graphite_test.go similarity index 100% rename from api/graphite_test.go rename to pkg/api/graphite_test.go diff --git a/api/init.go b/pkg/api/init.go similarity index 100% rename from api/init.go rename to pkg/api/init.go diff --git a/api/middleware/capturebody.go b/pkg/api/middleware/capturebody.go similarity index 100% rename from api/middleware/capturebody.go rename to pkg/api/middleware/capturebody.go diff --git a/api/middleware/cluster.go b/pkg/api/middleware/cluster.go similarity index 100% rename from api/middleware/cluster.go rename to pkg/api/middleware/cluster.go diff --git a/api/middleware/logger.go b/pkg/api/middleware/logger.go similarity index 100% rename from api/middleware/logger.go rename to pkg/api/middleware/logger.go diff --git a/api/middleware/middleware.go b/pkg/api/middleware/middleware.go similarity index 100% rename from api/middleware/middleware.go rename to pkg/api/middleware/middleware.go diff --git a/api/middleware/stats.go b/pkg/api/middleware/stats.go similarity index 100% rename from api/middleware/stats.go rename to pkg/api/middleware/stats.go diff --git a/api/middleware/tracer.go b/pkg/api/middleware/tracer.go similarity index 100% rename from api/middleware/tracer.go rename to pkg/api/middleware/tracer.go diff --git a/api/models/ccache.go b/pkg/api/models/ccache.go similarity index 100% rename from api/models/ccache.go rename to pkg/api/models/ccache.go diff --git a/api/models/cluster.go b/pkg/api/models/cluster.go similarity index 100% rename from api/models/cluster.go rename to pkg/api/models/cluster.go diff --git a/api/models/cluster_gen.go b/pkg/api/models/cluster_gen.go similarity index 100% rename from api/models/cluster_gen.go rename to pkg/api/models/cluster_gen.go diff --git a/api/models/cluster_gen_test.go b/pkg/api/models/cluster_gen_test.go similarity index 100% rename from api/models/cluster_gen_test.go rename to pkg/api/models/cluster_gen_test.go diff --git a/api/models/cluster_test.go b/pkg/api/models/cluster_test.go similarity index 100% rename from api/models/cluster_test.go rename to pkg/api/models/cluster_test.go diff --git a/api/models/graphite.go b/pkg/api/models/graphite.go similarity index 100% rename from api/models/graphite.go rename to pkg/api/models/graphite.go diff --git a/api/models/graphite_gen.go b/pkg/api/models/graphite_gen.go similarity index 100% rename from api/models/graphite_gen.go rename to pkg/api/models/graphite_gen.go diff --git a/api/models/graphite_gen_test.go b/pkg/api/models/graphite_gen_test.go similarity index 100% rename from api/models/graphite_gen_test.go rename to pkg/api/models/graphite_gen_test.go diff --git a/api/models/graphite_render_meta.go b/pkg/api/models/graphite_render_meta.go similarity index 100% rename from api/models/graphite_render_meta.go rename to pkg/api/models/graphite_render_meta.go diff --git a/api/models/graphite_test.go b/pkg/api/models/graphite_test.go similarity index 100% rename from api/models/graphite_test.go rename to pkg/api/models/graphite_test.go diff --git a/api/models/init_test.go b/pkg/api/models/init_test.go similarity index 100% rename from api/models/init_test.go rename to pkg/api/models/init_test.go diff --git a/api/models/meta_records.go b/pkg/api/models/meta_records.go similarity index 100% rename from api/models/meta_records.go rename to pkg/api/models/meta_records.go diff --git a/api/models/node.go b/pkg/api/models/node.go similarity index 100% rename from api/models/node.go rename to pkg/api/models/node.go diff --git a/api/models/pointslicepool.go b/pkg/api/models/pointslicepool.go similarity index 100% rename from api/models/pointslicepool.go rename to pkg/api/models/pointslicepool.go diff --git a/api/models/request.go b/pkg/api/models/request.go similarity index 100% rename from api/models/request.go rename to pkg/api/models/request.go diff --git a/api/models/request_gen.go b/pkg/api/models/request_gen.go similarity index 100% rename from api/models/request_gen.go rename to pkg/api/models/request_gen.go diff --git a/api/models/request_gen_test.go b/pkg/api/models/request_gen_test.go similarity index 100% rename from api/models/request_gen_test.go rename to pkg/api/models/request_gen_test.go diff --git a/api/models/series.go b/pkg/api/models/series.go similarity index 100% rename from api/models/series.go rename to pkg/api/models/series.go diff --git a/api/models/series_gen.go b/pkg/api/models/series_gen.go similarity index 100% rename from api/models/series_gen.go rename to pkg/api/models/series_gen.go diff --git a/api/models/series_gen_test.go b/pkg/api/models/series_gen_test.go similarity index 100% rename from api/models/series_gen_test.go rename to pkg/api/models/series_gen_test.go diff --git a/api/models/series_msgp_manual.go b/pkg/api/models/series_msgp_manual.go similarity index 100% rename from api/models/series_msgp_manual.go rename to pkg/api/models/series_msgp_manual.go diff --git a/api/models/series_msgp_manual_test.go b/pkg/api/models/series_msgp_manual_test.go similarity index 100% rename from api/models/series_msgp_manual_test.go rename to pkg/api/models/series_msgp_manual_test.go diff --git a/api/models/series_test.go b/pkg/api/models/series_test.go similarity index 100% rename from api/models/series_test.go rename to pkg/api/models/series_test.go diff --git a/api/models/storagestats.go b/pkg/api/models/storagestats.go similarity index 100% rename from api/models/storagestats.go rename to pkg/api/models/storagestats.go diff --git a/api/models/storagestats_gen.go b/pkg/api/models/storagestats_gen.go similarity index 100% rename from api/models/storagestats_gen.go rename to pkg/api/models/storagestats_gen.go diff --git a/api/models/storagestats_gen_test.go b/pkg/api/models/storagestats_gen_test.go similarity index 100% rename from api/models/storagestats_gen_test.go rename to pkg/api/models/storagestats_gen_test.go diff --git a/api/pprof.go b/pkg/api/pprof.go similarity index 100% rename from api/pprof.go rename to pkg/api/pprof.go diff --git a/api/query_engine.go b/pkg/api/query_engine.go similarity index 100% rename from api/query_engine.go rename to pkg/api/query_engine.go diff --git a/api/query_engine_helpers_test.go b/pkg/api/query_engine_helpers_test.go similarity index 100% rename from api/query_engine_helpers_test.go rename to pkg/api/query_engine_helpers_test.go diff --git a/api/query_engine_test.go b/pkg/api/query_engine_test.go similarity index 100% rename from api/query_engine_test.go rename to pkg/api/query_engine_test.go diff --git a/api/response/csv.go b/pkg/api/response/csv.go similarity index 100% rename from api/response/csv.go rename to pkg/api/response/csv.go diff --git a/api/response/csv_test.go b/pkg/api/response/csv_test.go similarity index 100% rename from api/response/csv_test.go rename to pkg/api/response/csv_test.go diff --git a/api/response/error.go b/pkg/api/response/error.go similarity index 100% rename from api/response/error.go rename to pkg/api/response/error.go diff --git a/api/response/fast_json.go b/pkg/api/response/fast_json.go similarity index 100% rename from api/response/fast_json.go rename to pkg/api/response/fast_json.go diff --git a/api/response/fast_json_test.go b/pkg/api/response/fast_json_test.go similarity index 100% rename from api/response/fast_json_test.go rename to pkg/api/response/fast_json_test.go diff --git a/api/response/init_test.go b/pkg/api/response/init_test.go similarity index 100% rename from api/response/init_test.go rename to pkg/api/response/init_test.go diff --git a/api/response/json.go b/pkg/api/response/json.go similarity index 100% rename from api/response/json.go rename to pkg/api/response/json.go diff --git a/api/response/json_test.go b/pkg/api/response/json_test.go similarity index 100% rename from api/response/json_test.go rename to pkg/api/response/json_test.go diff --git a/api/response/msgp.go b/pkg/api/response/msgp.go similarity index 100% rename from api/response/msgp.go rename to pkg/api/response/msgp.go diff --git a/api/response/msgp_test.go b/pkg/api/response/msgp_test.go similarity index 100% rename from api/response/msgp_test.go rename to pkg/api/response/msgp_test.go diff --git a/api/response/msgpack.go b/pkg/api/response/msgpack.go similarity index 100% rename from api/response/msgpack.go rename to pkg/api/response/msgpack.go diff --git a/api/response/msgpack_test.go b/pkg/api/response/msgpack_test.go similarity index 100% rename from api/response/msgpack_test.go rename to pkg/api/response/msgpack_test.go diff --git a/api/response/pickle.go b/pkg/api/response/pickle.go similarity index 100% rename from api/response/pickle.go rename to pkg/api/response/pickle.go diff --git a/api/response/pickle_test.go b/pkg/api/response/pickle_test.go similarity index 100% rename from api/response/pickle_test.go rename to pkg/api/response/pickle_test.go diff --git a/api/response/response.go b/pkg/api/response/response.go similarity index 100% rename from api/response/response.go rename to pkg/api/response/response.go diff --git a/api/response/response_test.go b/pkg/api/response/response_test.go similarity index 100% rename from api/response/response_test.go rename to pkg/api/response/response_test.go diff --git a/api/routes.go b/pkg/api/routes.go similarity index 100% rename from api/routes.go rename to pkg/api/routes.go diff --git a/api/seriescycle/seriescycle.go b/pkg/api/seriescycle/seriescycle.go similarity index 100% rename from api/seriescycle/seriescycle.go rename to pkg/api/seriescycle/seriescycle.go diff --git a/api/tz/tz.go b/pkg/api/tz/tz.go similarity index 100% rename from api/tz/tz.go rename to pkg/api/tz/tz.go diff --git a/archives/archives.go b/pkg/archives/archives.go similarity index 100% rename from archives/archives.go rename to pkg/archives/archives.go diff --git a/archives/index.go b/pkg/archives/index.go similarity index 100% rename from archives/index.go rename to pkg/archives/index.go diff --git a/batch/LICENSE.TXT b/pkg/batch/LICENSE.TXT similarity index 100% rename from batch/LICENSE.TXT rename to pkg/batch/LICENSE.TXT diff --git a/batch/aggregator.go b/pkg/batch/aggregator.go similarity index 100% rename from batch/aggregator.go rename to pkg/batch/aggregator.go diff --git a/benchmarks/cluster-queries/README.md b/pkg/benchmarks/cluster-queries/README.md similarity index 100% rename from benchmarks/cluster-queries/README.md rename to pkg/benchmarks/cluster-queries/README.md diff --git a/benchmarks/cluster-queries/alerting-input b/pkg/benchmarks/cluster-queries/alerting-input similarity index 100% rename from benchmarks/cluster-queries/alerting-input rename to pkg/benchmarks/cluster-queries/alerting-input diff --git a/benchmarks/cluster-queries/run-alerting.sh b/pkg/benchmarks/cluster-queries/run-alerting.sh similarity index 100% rename from benchmarks/cluster-queries/run-alerting.sh rename to pkg/benchmarks/cluster-queries/run-alerting.sh diff --git a/benchmarks/cluster-queries/run-exploration.sh b/pkg/benchmarks/cluster-queries/run-exploration.sh similarity index 100% rename from benchmarks/cluster-queries/run-exploration.sh rename to pkg/benchmarks/cluster-queries/run-exploration.sh diff --git a/benchmarks/cluster-queries/run.sh b/pkg/benchmarks/cluster-queries/run.sh similarity index 100% rename from benchmarks/cluster-queries/run.sh rename to pkg/benchmarks/cluster-queries/run.sh diff --git a/benchmarks/ingest-backfill-speed.sh b/pkg/benchmarks/ingest-backfill-speed.sh similarity index 100% rename from benchmarks/ingest-backfill-speed.sh rename to pkg/benchmarks/ingest-backfill-speed.sh diff --git a/benchmarks/ingest-mdm-v1-vs-v2.sh b/pkg/benchmarks/ingest-mdm-v1-vs-v2.sh similarity index 100% rename from benchmarks/ingest-mdm-v1-vs-v2.sh rename to pkg/benchmarks/ingest-mdm-v1-vs-v2.sh diff --git a/benchmarks/realistic-workload-single-tenant.sh b/pkg/benchmarks/realistic-workload-single-tenant.sh similarity index 100% rename from benchmarks/realistic-workload-single-tenant.sh rename to pkg/benchmarks/realistic-workload-single-tenant.sh diff --git a/benchmarks/simulate-lock-congestion/README.md b/pkg/benchmarks/simulate-lock-congestion/README.md similarity index 100% rename from benchmarks/simulate-lock-congestion/README.md rename to pkg/benchmarks/simulate-lock-congestion/README.md diff --git a/benchmarks/simulate-lock-congestion/gnuplot.sh b/pkg/benchmarks/simulate-lock-congestion/gnuplot.sh similarity index 100% rename from benchmarks/simulate-lock-congestion/gnuplot.sh rename to pkg/benchmarks/simulate-lock-congestion/gnuplot.sh diff --git a/benchmarks/simulate-lock-congestion/run.sh b/pkg/benchmarks/simulate-lock-congestion/run.sh similarity index 100% rename from benchmarks/simulate-lock-congestion/run.sh rename to pkg/benchmarks/simulate-lock-congestion/run.sh diff --git a/bigtable/util.go b/pkg/bigtable/util.go similarity index 100% rename from bigtable/util.go rename to pkg/bigtable/util.go diff --git a/cassandra/cassandra_session.go b/pkg/cassandra/cassandra_session.go similarity index 100% rename from cassandra/cassandra_session.go rename to pkg/cassandra/cassandra_session.go diff --git a/cassandra/metrics.go b/pkg/cassandra/metrics.go similarity index 100% rename from cassandra/metrics.go rename to pkg/cassandra/metrics.go diff --git a/cassandra/util.go b/pkg/cassandra/util.go similarity index 100% rename from cassandra/util.go rename to pkg/cassandra/util.go diff --git a/clock/clock.go b/pkg/clock/clock.go similarity index 100% rename from clock/clock.go rename to pkg/clock/clock.go diff --git a/clock/clock_test.go b/pkg/clock/clock_test.go similarity index 100% rename from clock/clock_test.go rename to pkg/clock/clock_test.go diff --git a/clock/randomticker.go b/pkg/clock/randomticker.go similarity index 100% rename from clock/randomticker.go rename to pkg/clock/randomticker.go diff --git a/cluster/cluster.go b/pkg/cluster/cluster.go similarity index 100% rename from cluster/cluster.go rename to pkg/cluster/cluster.go diff --git a/cluster/cluster_test.go b/pkg/cluster/cluster_test.go similarity index 100% rename from cluster/cluster_test.go rename to pkg/cluster/cluster_test.go diff --git a/cluster/config.go b/pkg/cluster/config.go similarity index 100% rename from cluster/config.go rename to pkg/cluster/config.go diff --git a/cluster/if.go b/pkg/cluster/if.go similarity index 100% rename from cluster/if.go rename to pkg/cluster/if.go diff --git a/cluster/manager.go b/pkg/cluster/manager.go similarity index 100% rename from cluster/manager.go rename to pkg/cluster/manager.go diff --git a/cluster/mock.go b/pkg/cluster/mock.go similarity index 100% rename from cluster/mock.go rename to pkg/cluster/mock.go diff --git a/cluster/node.go b/pkg/cluster/node.go similarity index 100% rename from cluster/node.go rename to pkg/cluster/node.go diff --git a/cluster/nodemode_string.go b/pkg/cluster/nodemode_string.go similarity index 100% rename from cluster/nodemode_string.go rename to pkg/cluster/nodemode_string.go diff --git a/cluster/nodestate_string.go b/pkg/cluster/nodestate_string.go similarity index 100% rename from cluster/nodestate_string.go rename to pkg/cluster/nodestate_string.go diff --git a/cluster/partitioner/partitioner.go b/pkg/cluster/partitioner/partitioner.go similarity index 100% rename from cluster/partitioner/partitioner.go rename to pkg/cluster/partitioner/partitioner.go diff --git a/cluster/traceable.go b/pkg/cluster/traceable.go similarity index 100% rename from cluster/traceable.go rename to pkg/cluster/traceable.go diff --git a/cmd-dev/mt-simulate-memory-idx-lock-contention/README.md b/pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/README.md similarity index 100% rename from cmd-dev/mt-simulate-memory-idx-lock-contention/README.md rename to pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/README.md diff --git a/cmd-dev/mt-simulate-memory-idx-lock-contention/main.go b/pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/main.go similarity index 100% rename from cmd-dev/mt-simulate-memory-idx-lock-contention/main.go rename to pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/main.go diff --git a/cmd-dev/mt-simulate-memory-idx-lock-contention/runner/stat.go b/pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/runner/stat.go similarity index 100% rename from cmd-dev/mt-simulate-memory-idx-lock-contention/runner/stat.go rename to pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/runner/stat.go diff --git a/cmd-dev/mt-simulate-memory-idx-lock-contention/runner/test_runner.go b/pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/runner/test_runner.go similarity index 100% rename from cmd-dev/mt-simulate-memory-idx-lock-contention/runner/test_runner.go rename to pkg/cmd-dev/mt-simulate-memory-idx-lock-contention/runner/test_runner.go diff --git a/conf/aggregations.go b/pkg/conf/aggregations.go similarity index 100% rename from conf/aggregations.go rename to pkg/conf/aggregations.go diff --git a/conf/aggregations_test.go b/pkg/conf/aggregations_test.go similarity index 100% rename from conf/aggregations_test.go rename to pkg/conf/aggregations_test.go diff --git a/conf/indexrules.go b/pkg/conf/indexrules.go similarity index 100% rename from conf/indexrules.go rename to pkg/conf/indexrules.go diff --git a/conf/indexrules_test.go b/pkg/conf/indexrules_test.go similarity index 100% rename from conf/indexrules_test.go rename to pkg/conf/indexrules_test.go diff --git a/conf/init.go b/pkg/conf/init.go similarity index 100% rename from conf/init.go rename to pkg/conf/init.go diff --git a/conf/method.go b/pkg/conf/method.go similarity index 100% rename from conf/method.go rename to pkg/conf/method.go diff --git a/conf/retention.go b/pkg/conf/retention.go similarity index 100% rename from conf/retention.go rename to pkg/conf/retention.go diff --git a/conf/retention_test.go b/pkg/conf/retention_test.go similarity index 100% rename from conf/retention_test.go rename to pkg/conf/retention_test.go diff --git a/conf/schemas.go b/pkg/conf/schemas.go similarity index 100% rename from conf/schemas.go rename to pkg/conf/schemas.go diff --git a/conf/schemas_test.go b/pkg/conf/schemas_test.go similarity index 100% rename from conf/schemas_test.go rename to pkg/conf/schemas_test.go diff --git a/conf/schemas_test_files/bad_pattern.schemas b/pkg/conf/schemas_test_files/bad_pattern.schemas similarity index 100% rename from conf/schemas_test_files/bad_pattern.schemas rename to pkg/conf/schemas_test_files/bad_pattern.schemas diff --git a/conf/schemas_test_files/bad_retention.schemas b/pkg/conf/schemas_test_files/bad_retention.schemas similarity index 100% rename from conf/schemas_test_files/bad_retention.schemas rename to pkg/conf/schemas_test_files/bad_retention.schemas diff --git a/conf/schemas_test_files/empty.schemas b/pkg/conf/schemas_test_files/empty.schemas similarity index 100% rename from conf/schemas_test_files/empty.schemas rename to pkg/conf/schemas_test_files/empty.schemas diff --git a/conf/schemas_test_files/multiple.schemas b/pkg/conf/schemas_test_files/multiple.schemas similarity index 100% rename from conf/schemas_test_files/multiple.schemas rename to pkg/conf/schemas_test_files/multiple.schemas diff --git a/conf/schemas_test_files/no_pattern.schemas b/pkg/conf/schemas_test_files/no_pattern.schemas similarity index 100% rename from conf/schemas_test_files/no_pattern.schemas rename to pkg/conf/schemas_test_files/no_pattern.schemas diff --git a/conf/schemas_test_files/reorder_buffer.schemas b/pkg/conf/schemas_test_files/reorder_buffer.schemas similarity index 100% rename from conf/schemas_test_files/reorder_buffer.schemas rename to pkg/conf/schemas_test_files/reorder_buffer.schemas diff --git a/conf/schemas_test_files/reorder_buffer_allow_update.schemas b/pkg/conf/schemas_test_files/reorder_buffer_allow_update.schemas similarity index 100% rename from conf/schemas_test_files/reorder_buffer_allow_update.schemas rename to pkg/conf/schemas_test_files/reorder_buffer_allow_update.schemas diff --git a/conf/schemas_test_files/simple.schemas b/pkg/conf/schemas_test_files/simple.schemas similarity index 100% rename from conf/schemas_test_files/simple.schemas rename to pkg/conf/schemas_test_files/simple.schemas diff --git a/consolidation/LICENSE.TXT b/pkg/consolidation/LICENSE.TXT similarity index 100% rename from consolidation/LICENSE.TXT rename to pkg/consolidation/LICENSE.TXT diff --git a/consolidation/consolidate.go b/pkg/consolidation/consolidate.go similarity index 100% rename from consolidation/consolidate.go rename to pkg/consolidation/consolidate.go diff --git a/consolidation/consolidate_test.go b/pkg/consolidation/consolidate_test.go similarity index 100% rename from consolidation/consolidate_test.go rename to pkg/consolidation/consolidate_test.go diff --git a/consolidation/consolidation.go b/pkg/consolidation/consolidation.go similarity index 100% rename from consolidation/consolidation.go rename to pkg/consolidation/consolidation.go diff --git a/consolidation/consolidation_gen.go b/pkg/consolidation/consolidation_gen.go similarity index 100% rename from consolidation/consolidation_gen.go rename to pkg/consolidation/consolidation_gen.go diff --git a/consolidation/consolidation_gen_test.go b/pkg/consolidation/consolidation_gen_test.go similarity index 100% rename from consolidation/consolidation_gen_test.go rename to pkg/consolidation/consolidation_gen_test.go diff --git a/errors/errors.go b/pkg/errors/errors.go similarity index 100% rename from errors/errors.go rename to pkg/errors/errors.go diff --git a/expr/LICENSE b/pkg/expr/LICENSE similarity index 100% rename from expr/LICENSE rename to pkg/expr/LICENSE diff --git a/expr/cowcycler.go b/pkg/expr/cowcycler.go similarity index 100% rename from expr/cowcycler.go rename to pkg/expr/cowcycler.go diff --git a/expr/data_test.go b/pkg/expr/data_test.go similarity index 100% rename from expr/data_test.go rename to pkg/expr/data_test.go diff --git a/expr/datamap.go b/pkg/expr/datamap.go similarity index 100% rename from expr/datamap.go rename to pkg/expr/datamap.go diff --git a/expr/expr.go b/pkg/expr/expr.go similarity index 100% rename from expr/expr.go rename to pkg/expr/expr.go diff --git a/expr/exprtype_string.go b/pkg/expr/exprtype_string.go similarity index 100% rename from expr/exprtype_string.go rename to pkg/expr/exprtype_string.go diff --git a/expr/func_absolute.go b/pkg/expr/func_absolute.go similarity index 100% rename from expr/func_absolute.go rename to pkg/expr/func_absolute.go diff --git a/expr/func_absolute_test.go b/pkg/expr/func_absolute_test.go similarity index 100% rename from expr/func_absolute_test.go rename to pkg/expr/func_absolute_test.go diff --git a/expr/func_aggregate.go b/pkg/expr/func_aggregate.go similarity index 100% rename from expr/func_aggregate.go rename to pkg/expr/func_aggregate.go diff --git a/expr/func_aggregate_test.go b/pkg/expr/func_aggregate_test.go similarity index 100% rename from expr/func_aggregate_test.go rename to pkg/expr/func_aggregate_test.go diff --git a/expr/func_aggregatewithwildcards.go b/pkg/expr/func_aggregatewithwildcards.go similarity index 100% rename from expr/func_aggregatewithwildcards.go rename to pkg/expr/func_aggregatewithwildcards.go diff --git a/expr/func_aggregatewithwildcards_test.go b/pkg/expr/func_aggregatewithwildcards_test.go similarity index 100% rename from expr/func_aggregatewithwildcards_test.go rename to pkg/expr/func_aggregatewithwildcards_test.go diff --git a/expr/func_alias.go b/pkg/expr/func_alias.go similarity index 100% rename from expr/func_alias.go rename to pkg/expr/func_alias.go diff --git a/expr/func_alias_test.go b/pkg/expr/func_alias_test.go similarity index 100% rename from expr/func_alias_test.go rename to pkg/expr/func_alias_test.go diff --git a/expr/func_aliasbymetric.go b/pkg/expr/func_aliasbymetric.go similarity index 100% rename from expr/func_aliasbymetric.go rename to pkg/expr/func_aliasbymetric.go diff --git a/expr/func_aliasbymetric_test.go b/pkg/expr/func_aliasbymetric_test.go similarity index 100% rename from expr/func_aliasbymetric_test.go rename to pkg/expr/func_aliasbymetric_test.go diff --git a/expr/func_aliasbynode.go b/pkg/expr/func_aliasbynode.go similarity index 100% rename from expr/func_aliasbynode.go rename to pkg/expr/func_aliasbynode.go diff --git a/expr/func_aliasbynode_test.go b/pkg/expr/func_aliasbynode_test.go similarity index 100% rename from expr/func_aliasbynode_test.go rename to pkg/expr/func_aliasbynode_test.go diff --git a/expr/func_aliassub.go b/pkg/expr/func_aliassub.go similarity index 100% rename from expr/func_aliassub.go rename to pkg/expr/func_aliassub.go diff --git a/expr/func_aliassub_test.go b/pkg/expr/func_aliassub_test.go similarity index 100% rename from expr/func_aliassub_test.go rename to pkg/expr/func_aliassub_test.go diff --git a/expr/func_aspercent.go b/pkg/expr/func_aspercent.go similarity index 100% rename from expr/func_aspercent.go rename to pkg/expr/func_aspercent.go diff --git a/expr/func_aspercent_test.go b/pkg/expr/func_aspercent_test.go similarity index 100% rename from expr/func_aspercent_test.go rename to pkg/expr/func_aspercent_test.go diff --git a/expr/func_consolidateby.go b/pkg/expr/func_consolidateby.go similarity index 100% rename from expr/func_consolidateby.go rename to pkg/expr/func_consolidateby.go diff --git a/expr/func_consolidateby_test.go b/pkg/expr/func_consolidateby_test.go similarity index 100% rename from expr/func_consolidateby_test.go rename to pkg/expr/func_consolidateby_test.go diff --git a/expr/func_constantline.go b/pkg/expr/func_constantline.go similarity index 100% rename from expr/func_constantline.go rename to pkg/expr/func_constantline.go diff --git a/expr/func_constantline_test.go b/pkg/expr/func_constantline_test.go similarity index 100% rename from expr/func_constantline_test.go rename to pkg/expr/func_constantline_test.go diff --git a/expr/func_countseries.go b/pkg/expr/func_countseries.go similarity index 100% rename from expr/func_countseries.go rename to pkg/expr/func_countseries.go diff --git a/expr/func_countseries_test.go b/pkg/expr/func_countseries_test.go similarity index 100% rename from expr/func_countseries_test.go rename to pkg/expr/func_countseries_test.go diff --git a/expr/func_derivative.go b/pkg/expr/func_derivative.go similarity index 100% rename from expr/func_derivative.go rename to pkg/expr/func_derivative.go diff --git a/expr/func_derivative_test.go b/pkg/expr/func_derivative_test.go similarity index 100% rename from expr/func_derivative_test.go rename to pkg/expr/func_derivative_test.go diff --git a/expr/func_divideseries.go b/pkg/expr/func_divideseries.go similarity index 100% rename from expr/func_divideseries.go rename to pkg/expr/func_divideseries.go diff --git a/expr/func_divideseries_test.go b/pkg/expr/func_divideseries_test.go similarity index 100% rename from expr/func_divideseries_test.go rename to pkg/expr/func_divideseries_test.go diff --git a/expr/func_divideserieslists.go b/pkg/expr/func_divideserieslists.go similarity index 100% rename from expr/func_divideserieslists.go rename to pkg/expr/func_divideserieslists.go diff --git a/expr/func_divideserieslists_test.go b/pkg/expr/func_divideserieslists_test.go similarity index 100% rename from expr/func_divideserieslists_test.go rename to pkg/expr/func_divideserieslists_test.go diff --git a/expr/func_fallbackSeries.go b/pkg/expr/func_fallbackSeries.go similarity index 100% rename from expr/func_fallbackSeries.go rename to pkg/expr/func_fallbackSeries.go diff --git a/expr/func_fallbackseries_test.go b/pkg/expr/func_fallbackseries_test.go similarity index 100% rename from expr/func_fallbackseries_test.go rename to pkg/expr/func_fallbackseries_test.go diff --git a/expr/func_filterseries.go b/pkg/expr/func_filterseries.go similarity index 100% rename from expr/func_filterseries.go rename to pkg/expr/func_filterseries.go diff --git a/expr/func_filterseries_test.go b/pkg/expr/func_filterseries_test.go similarity index 100% rename from expr/func_filterseries_test.go rename to pkg/expr/func_filterseries_test.go diff --git a/expr/func_get.go b/pkg/expr/func_get.go similarity index 100% rename from expr/func_get.go rename to pkg/expr/func_get.go diff --git a/expr/func_grep.go b/pkg/expr/func_grep.go similarity index 100% rename from expr/func_grep.go rename to pkg/expr/func_grep.go diff --git a/expr/func_grep_test.go b/pkg/expr/func_grep_test.go similarity index 100% rename from expr/func_grep_test.go rename to pkg/expr/func_grep_test.go diff --git a/expr/func_group.go b/pkg/expr/func_group.go similarity index 100% rename from expr/func_group.go rename to pkg/expr/func_group.go diff --git a/expr/func_group_test.go b/pkg/expr/func_group_test.go similarity index 100% rename from expr/func_group_test.go rename to pkg/expr/func_group_test.go diff --git a/expr/func_groupbynodes.go b/pkg/expr/func_groupbynodes.go similarity index 100% rename from expr/func_groupbynodes.go rename to pkg/expr/func_groupbynodes.go diff --git a/expr/func_groupbynodes_test.go b/pkg/expr/func_groupbynodes_test.go similarity index 100% rename from expr/func_groupbynodes_test.go rename to pkg/expr/func_groupbynodes_test.go diff --git a/expr/func_groupbytags.go b/pkg/expr/func_groupbytags.go similarity index 100% rename from expr/func_groupbytags.go rename to pkg/expr/func_groupbytags.go diff --git a/expr/func_groupbytags_test.go b/pkg/expr/func_groupbytags_test.go similarity index 100% rename from expr/func_groupbytags_test.go rename to pkg/expr/func_groupbytags_test.go diff --git a/expr/func_highestlowest.go b/pkg/expr/func_highestlowest.go similarity index 100% rename from expr/func_highestlowest.go rename to pkg/expr/func_highestlowest.go diff --git a/expr/func_highestlowest_test.go b/pkg/expr/func_highestlowest_test.go similarity index 100% rename from expr/func_highestlowest_test.go rename to pkg/expr/func_highestlowest_test.go diff --git a/expr/func_integral.go b/pkg/expr/func_integral.go similarity index 100% rename from expr/func_integral.go rename to pkg/expr/func_integral.go diff --git a/expr/func_integral_test.go b/pkg/expr/func_integral_test.go similarity index 100% rename from expr/func_integral_test.go rename to pkg/expr/func_integral_test.go diff --git a/expr/func_invert.go b/pkg/expr/func_invert.go similarity index 100% rename from expr/func_invert.go rename to pkg/expr/func_invert.go diff --git a/expr/func_invert_test.go b/pkg/expr/func_invert_test.go similarity index 100% rename from expr/func_invert_test.go rename to pkg/expr/func_invert_test.go diff --git a/expr/func_isnonnull.go b/pkg/expr/func_isnonnull.go similarity index 100% rename from expr/func_isnonnull.go rename to pkg/expr/func_isnonnull.go diff --git a/expr/func_isnonnull_test.go b/pkg/expr/func_isnonnull_test.go similarity index 100% rename from expr/func_isnonnull_test.go rename to pkg/expr/func_isnonnull_test.go diff --git a/expr/func_keeplastvalue.go b/pkg/expr/func_keeplastvalue.go similarity index 100% rename from expr/func_keeplastvalue.go rename to pkg/expr/func_keeplastvalue.go diff --git a/expr/func_keeplastvalue_test.go b/pkg/expr/func_keeplastvalue_test.go similarity index 100% rename from expr/func_keeplastvalue_test.go rename to pkg/expr/func_keeplastvalue_test.go diff --git a/expr/func_log.go b/pkg/expr/func_log.go similarity index 100% rename from expr/func_log.go rename to pkg/expr/func_log.go diff --git a/expr/func_log_test.go b/pkg/expr/func_log_test.go similarity index 100% rename from expr/func_log_test.go rename to pkg/expr/func_log_test.go diff --git a/expr/func_minmax.go b/pkg/expr/func_minmax.go similarity index 100% rename from expr/func_minmax.go rename to pkg/expr/func_minmax.go diff --git a/expr/func_minmax_test.go b/pkg/expr/func_minmax_test.go similarity index 100% rename from expr/func_minmax_test.go rename to pkg/expr/func_minmax_test.go diff --git a/expr/func_mock_test.go b/pkg/expr/func_mock_test.go similarity index 100% rename from expr/func_mock_test.go rename to pkg/expr/func_mock_test.go diff --git a/expr/func_movingwindow.go b/pkg/expr/func_movingwindow.go similarity index 100% rename from expr/func_movingwindow.go rename to pkg/expr/func_movingwindow.go diff --git a/expr/func_movingwindow_test.go b/pkg/expr/func_movingwindow_test.go similarity index 100% rename from expr/func_movingwindow_test.go rename to pkg/expr/func_movingwindow_test.go diff --git a/expr/func_nonnegativederivative.go b/pkg/expr/func_nonnegativederivative.go similarity index 100% rename from expr/func_nonnegativederivative.go rename to pkg/expr/func_nonnegativederivative.go diff --git a/expr/func_nonnegativederivative_test.go b/pkg/expr/func_nonnegativederivative_test.go similarity index 100% rename from expr/func_nonnegativederivative_test.go rename to pkg/expr/func_nonnegativederivative_test.go diff --git a/expr/func_offset.go b/pkg/expr/func_offset.go similarity index 100% rename from expr/func_offset.go rename to pkg/expr/func_offset.go diff --git a/expr/func_offset_test.go b/pkg/expr/func_offset_test.go similarity index 100% rename from expr/func_offset_test.go rename to pkg/expr/func_offset_test.go diff --git a/expr/func_offsettozero.go b/pkg/expr/func_offsettozero.go similarity index 100% rename from expr/func_offsettozero.go rename to pkg/expr/func_offsettozero.go diff --git a/expr/func_offsettozero_test.go b/pkg/expr/func_offsettozero_test.go similarity index 100% rename from expr/func_offsettozero_test.go rename to pkg/expr/func_offsettozero_test.go diff --git a/expr/func_persecond.go b/pkg/expr/func_persecond.go similarity index 100% rename from expr/func_persecond.go rename to pkg/expr/func_persecond.go diff --git a/expr/func_persecond_test.go b/pkg/expr/func_persecond_test.go similarity index 100% rename from expr/func_persecond_test.go rename to pkg/expr/func_persecond_test.go diff --git a/expr/func_removeabovebelowpercentile.go b/pkg/expr/func_removeabovebelowpercentile.go similarity index 100% rename from expr/func_removeabovebelowpercentile.go rename to pkg/expr/func_removeabovebelowpercentile.go diff --git a/expr/func_removeabovebelowpercentile_test.go b/pkg/expr/func_removeabovebelowpercentile_test.go similarity index 100% rename from expr/func_removeabovebelowpercentile_test.go rename to pkg/expr/func_removeabovebelowpercentile_test.go diff --git a/expr/func_removeabovebelowvalue.go b/pkg/expr/func_removeabovebelowvalue.go similarity index 100% rename from expr/func_removeabovebelowvalue.go rename to pkg/expr/func_removeabovebelowvalue.go diff --git a/expr/func_removeabovebelowvalue_test.go b/pkg/expr/func_removeabovebelowvalue_test.go similarity index 100% rename from expr/func_removeabovebelowvalue_test.go rename to pkg/expr/func_removeabovebelowvalue_test.go diff --git a/expr/func_removeemptyseries.go b/pkg/expr/func_removeemptyseries.go similarity index 100% rename from expr/func_removeemptyseries.go rename to pkg/expr/func_removeemptyseries.go diff --git a/expr/func_removeemptyseries_test.go b/pkg/expr/func_removeemptyseries_test.go similarity index 100% rename from expr/func_removeemptyseries_test.go rename to pkg/expr/func_removeemptyseries_test.go diff --git a/expr/func_removezeroseries.go b/pkg/expr/func_removezeroseries.go similarity index 100% rename from expr/func_removezeroseries.go rename to pkg/expr/func_removezeroseries.go diff --git a/expr/func_removezeroseries_test.go b/pkg/expr/func_removezeroseries_test.go similarity index 100% rename from expr/func_removezeroseries_test.go rename to pkg/expr/func_removezeroseries_test.go diff --git a/expr/func_round.go b/pkg/expr/func_round.go similarity index 100% rename from expr/func_round.go rename to pkg/expr/func_round.go diff --git a/expr/func_round_test.go b/pkg/expr/func_round_test.go similarity index 100% rename from expr/func_round_test.go rename to pkg/expr/func_round_test.go diff --git a/expr/func_scale.go b/pkg/expr/func_scale.go similarity index 100% rename from expr/func_scale.go rename to pkg/expr/func_scale.go diff --git a/expr/func_scale_test.go b/pkg/expr/func_scale_test.go similarity index 100% rename from expr/func_scale_test.go rename to pkg/expr/func_scale_test.go diff --git a/expr/func_scaletoseconds.go b/pkg/expr/func_scaletoseconds.go similarity index 100% rename from expr/func_scaletoseconds.go rename to pkg/expr/func_scaletoseconds.go diff --git a/expr/func_scaletoseconds_test.go b/pkg/expr/func_scaletoseconds_test.go similarity index 100% rename from expr/func_scaletoseconds_test.go rename to pkg/expr/func_scaletoseconds_test.go diff --git a/expr/func_smartsummarize.go b/pkg/expr/func_smartsummarize.go similarity index 100% rename from expr/func_smartsummarize.go rename to pkg/expr/func_smartsummarize.go diff --git a/expr/func_sortby.go b/pkg/expr/func_sortby.go similarity index 100% rename from expr/func_sortby.go rename to pkg/expr/func_sortby.go diff --git a/expr/func_sortby_test.go b/pkg/expr/func_sortby_test.go similarity index 100% rename from expr/func_sortby_test.go rename to pkg/expr/func_sortby_test.go diff --git a/expr/func_sortbyname.go b/pkg/expr/func_sortbyname.go similarity index 100% rename from expr/func_sortbyname.go rename to pkg/expr/func_sortbyname.go diff --git a/expr/func_sortbyname_test.go b/pkg/expr/func_sortbyname_test.go similarity index 100% rename from expr/func_sortbyname_test.go rename to pkg/expr/func_sortbyname_test.go diff --git a/expr/func_substr.go b/pkg/expr/func_substr.go similarity index 100% rename from expr/func_substr.go rename to pkg/expr/func_substr.go diff --git a/expr/func_substr_test.go b/pkg/expr/func_substr_test.go similarity index 100% rename from expr/func_substr_test.go rename to pkg/expr/func_substr_test.go diff --git a/expr/func_summarize.go b/pkg/expr/func_summarize.go similarity index 100% rename from expr/func_summarize.go rename to pkg/expr/func_summarize.go diff --git a/expr/func_summarize_test.go b/pkg/expr/func_summarize_test.go similarity index 100% rename from expr/func_summarize_test.go rename to pkg/expr/func_summarize_test.go diff --git a/expr/func_timeshift.go b/pkg/expr/func_timeshift.go similarity index 100% rename from expr/func_timeshift.go rename to pkg/expr/func_timeshift.go diff --git a/expr/func_timeshift_test.go b/pkg/expr/func_timeshift_test.go similarity index 100% rename from expr/func_timeshift_test.go rename to pkg/expr/func_timeshift_test.go diff --git a/expr/func_transformnull.go b/pkg/expr/func_transformnull.go similarity index 100% rename from expr/func_transformnull.go rename to pkg/expr/func_transformnull.go diff --git a/expr/func_transformnull_test.go b/pkg/expr/func_transformnull_test.go similarity index 100% rename from expr/func_transformnull_test.go rename to pkg/expr/func_transformnull_test.go diff --git a/expr/func_unique.go b/pkg/expr/func_unique.go similarity index 100% rename from expr/func_unique.go rename to pkg/expr/func_unique.go diff --git a/expr/func_unique_test.go b/pkg/expr/func_unique_test.go similarity index 100% rename from expr/func_unique_test.go rename to pkg/expr/func_unique_test.go diff --git a/expr/funcs.go b/pkg/expr/funcs.go similarity index 100% rename from expr/funcs.go rename to pkg/expr/funcs.go diff --git a/expr/init_test.go b/pkg/expr/init_test.go similarity index 100% rename from expr/init_test.go rename to pkg/expr/init_test.go diff --git a/expr/normalize.go b/pkg/expr/normalize.go similarity index 100% rename from expr/normalize.go rename to pkg/expr/normalize.go diff --git a/expr/normalize_test.go b/pkg/expr/normalize_test.go similarity index 100% rename from expr/normalize_test.go rename to pkg/expr/normalize_test.go diff --git a/expr/parse.go b/pkg/expr/parse.go similarity index 100% rename from expr/parse.go rename to pkg/expr/parse.go diff --git a/expr/parse_test.go b/pkg/expr/parse_test.go similarity index 100% rename from expr/parse_test.go rename to pkg/expr/parse_test.go diff --git a/expr/plan.go b/pkg/expr/plan.go similarity index 100% rename from expr/plan.go rename to pkg/expr/plan.go diff --git a/expr/plan_test.go b/pkg/expr/plan_test.go similarity index 100% rename from expr/plan_test.go rename to pkg/expr/plan_test.go diff --git a/expr/pool.go b/pkg/expr/pool.go similarity index 100% rename from expr/pool.go rename to pkg/expr/pool.go diff --git a/expr/seriesaggregator_test.go b/pkg/expr/seriesaggregator_test.go similarity index 100% rename from expr/seriesaggregator_test.go rename to pkg/expr/seriesaggregator_test.go diff --git a/expr/seriesaggregators.go b/pkg/expr/seriesaggregators.go similarity index 100% rename from expr/seriesaggregators.go rename to pkg/expr/seriesaggregators.go diff --git a/expr/tagquery/expression.go b/pkg/expr/tagquery/expression.go similarity index 100% rename from expr/tagquery/expression.go rename to pkg/expr/tagquery/expression.go diff --git a/expr/tagquery/expression_common.go b/pkg/expr/tagquery/expression_common.go similarity index 100% rename from expr/tagquery/expression_common.go rename to pkg/expr/tagquery/expression_common.go diff --git a/expr/tagquery/expression_equal.go b/pkg/expr/tagquery/expression_equal.go similarity index 100% rename from expr/tagquery/expression_equal.go rename to pkg/expr/tagquery/expression_equal.go diff --git a/expr/tagquery/expression_has_tag.go b/pkg/expr/tagquery/expression_has_tag.go similarity index 100% rename from expr/tagquery/expression_has_tag.go rename to pkg/expr/tagquery/expression_has_tag.go diff --git a/expr/tagquery/expression_match.go b/pkg/expr/tagquery/expression_match.go similarity index 100% rename from expr/tagquery/expression_match.go rename to pkg/expr/tagquery/expression_match.go diff --git a/expr/tagquery/expression_match_all.go b/pkg/expr/tagquery/expression_match_all.go similarity index 100% rename from expr/tagquery/expression_match_all.go rename to pkg/expr/tagquery/expression_match_all.go diff --git a/expr/tagquery/expression_match_none.go b/pkg/expr/tagquery/expression_match_none.go similarity index 100% rename from expr/tagquery/expression_match_none.go rename to pkg/expr/tagquery/expression_match_none.go diff --git a/expr/tagquery/expression_match_tag.go b/pkg/expr/tagquery/expression_match_tag.go similarity index 100% rename from expr/tagquery/expression_match_tag.go rename to pkg/expr/tagquery/expression_match_tag.go diff --git a/expr/tagquery/expression_not_equal.go b/pkg/expr/tagquery/expression_not_equal.go similarity index 100% rename from expr/tagquery/expression_not_equal.go rename to pkg/expr/tagquery/expression_not_equal.go diff --git a/expr/tagquery/expression_not_has_tag.go b/pkg/expr/tagquery/expression_not_has_tag.go similarity index 100% rename from expr/tagquery/expression_not_has_tag.go rename to pkg/expr/tagquery/expression_not_has_tag.go diff --git a/expr/tagquery/expression_not_match.go b/pkg/expr/tagquery/expression_not_match.go similarity index 100% rename from expr/tagquery/expression_not_match.go rename to pkg/expr/tagquery/expression_not_match.go diff --git a/expr/tagquery/expression_prefix.go b/pkg/expr/tagquery/expression_prefix.go similarity index 100% rename from expr/tagquery/expression_prefix.go rename to pkg/expr/tagquery/expression_prefix.go diff --git a/expr/tagquery/expression_prefix_tag.go b/pkg/expr/tagquery/expression_prefix_tag.go similarity index 100% rename from expr/tagquery/expression_prefix_tag.go rename to pkg/expr/tagquery/expression_prefix_tag.go diff --git a/expr/tagquery/expression_test.go b/pkg/expr/tagquery/expression_test.go similarity index 100% rename from expr/tagquery/expression_test.go rename to pkg/expr/tagquery/expression_test.go diff --git a/expr/tagquery/meta_tag_record.go b/pkg/expr/tagquery/meta_tag_record.go similarity index 100% rename from expr/tagquery/meta_tag_record.go rename to pkg/expr/tagquery/meta_tag_record.go diff --git a/expr/tagquery/meta_tag_record_test.go b/pkg/expr/tagquery/meta_tag_record_test.go similarity index 100% rename from expr/tagquery/meta_tag_record_test.go rename to pkg/expr/tagquery/meta_tag_record_test.go diff --git a/expr/tagquery/query.go b/pkg/expr/tagquery/query.go similarity index 100% rename from expr/tagquery/query.go rename to pkg/expr/tagquery/query.go diff --git a/expr/tagquery/query_test.go b/pkg/expr/tagquery/query_test.go similarity index 100% rename from expr/tagquery/query_test.go rename to pkg/expr/tagquery/query_test.go diff --git a/expr/tagquery/tag.go b/pkg/expr/tagquery/tag.go similarity index 100% rename from expr/tagquery/tag.go rename to pkg/expr/tagquery/tag.go diff --git a/expr/tagquery/tag_gen.go b/pkg/expr/tagquery/tag_gen.go similarity index 100% rename from expr/tagquery/tag_gen.go rename to pkg/expr/tagquery/tag_gen.go diff --git a/expr/tagquery/tag_gen_test.go b/pkg/expr/tagquery/tag_gen_test.go similarity index 100% rename from expr/tagquery/tag_gen_test.go rename to pkg/expr/tagquery/tag_gen_test.go diff --git a/expr/tagquery/tag_test.go b/pkg/expr/tagquery/tag_test.go similarity index 100% rename from expr/tagquery/tag_test.go rename to pkg/expr/tagquery/tag_test.go diff --git a/expr/tagquery/utils.go b/pkg/expr/tagquery/utils.go similarity index 100% rename from expr/tagquery/utils.go rename to pkg/expr/tagquery/utils.go diff --git a/expr/test.go b/pkg/expr/test.go similarity index 100% rename from expr/test.go rename to pkg/expr/test.go diff --git a/expr/types.go b/pkg/expr/types.go similarity index 100% rename from expr/types.go rename to pkg/expr/types.go diff --git a/expr/validator.go b/pkg/expr/validator.go similarity index 100% rename from expr/validator.go rename to pkg/expr/validator.go diff --git a/expr/xfilesfactor.go b/pkg/expr/xfilesfactor.go similarity index 100% rename from expr/xfilesfactor.go rename to pkg/expr/xfilesfactor.go diff --git a/idx/bigtable/bigtable.go b/pkg/idx/bigtable/bigtable.go similarity index 100% rename from idx/bigtable/bigtable.go rename to pkg/idx/bigtable/bigtable.go diff --git a/idx/bigtable/config.go b/pkg/idx/bigtable/config.go similarity index 100% rename from idx/bigtable/config.go rename to pkg/idx/bigtable/config.go diff --git a/idx/bigtable/schema.go b/pkg/idx/bigtable/schema.go similarity index 100% rename from idx/bigtable/schema.go rename to pkg/idx/bigtable/schema.go diff --git a/idx/cassandra/cassandra.go b/pkg/idx/cassandra/cassandra.go similarity index 100% rename from idx/cassandra/cassandra.go rename to pkg/idx/cassandra/cassandra.go diff --git a/idx/cassandra/cassandra_test.go b/pkg/idx/cassandra/cassandra_test.go similarity index 100% rename from idx/cassandra/cassandra_test.go rename to pkg/idx/cassandra/cassandra_test.go diff --git a/idx/cassandra/config.go b/pkg/idx/cassandra/config.go similarity index 100% rename from idx/cassandra/config.go rename to pkg/idx/cassandra/config.go diff --git a/idx/idx.go b/pkg/idx/idx.go similarity index 100% rename from idx/idx.go rename to pkg/idx/idx.go diff --git a/idx/idx_gen.go b/pkg/idx/idx_gen.go similarity index 100% rename from idx/idx_gen.go rename to pkg/idx/idx_gen.go diff --git a/idx/idx_gen_test.go b/pkg/idx/idx_gen_test.go similarity index 100% rename from idx/idx_gen_test.go rename to pkg/idx/idx_gen_test.go diff --git a/idx/memory/find_cache.go b/pkg/idx/memory/find_cache.go similarity index 100% rename from idx/memory/find_cache.go rename to pkg/idx/memory/find_cache.go diff --git a/idx/memory/find_cache_test.go b/pkg/idx/memory/find_cache_test.go similarity index 100% rename from idx/memory/find_cache_test.go rename to pkg/idx/memory/find_cache_test.go diff --git a/idx/memory/memory.go b/pkg/idx/memory/memory.go similarity index 100% rename from idx/memory/memory.go rename to pkg/idx/memory/memory.go diff --git a/idx/memory/memory_find_test.go b/pkg/idx/memory/memory_find_test.go similarity index 100% rename from idx/memory/memory_find_test.go rename to pkg/idx/memory/memory_find_test.go diff --git a/idx/memory/memory_test.go b/pkg/idx/memory/memory_test.go similarity index 100% rename from idx/memory/memory_test.go rename to pkg/idx/memory/memory_test.go diff --git a/idx/memory/meta_tags.go b/pkg/idx/memory/meta_tags.go similarity index 100% rename from idx/memory/meta_tags.go rename to pkg/idx/memory/meta_tags.go diff --git a/idx/memory/meta_tags_query_test.go b/pkg/idx/memory/meta_tags_query_test.go similarity index 100% rename from idx/memory/meta_tags_query_test.go rename to pkg/idx/memory/meta_tags_query_test.go diff --git a/idx/memory/meta_tags_test.go b/pkg/idx/memory/meta_tags_test.go similarity index 100% rename from idx/memory/meta_tags_test.go rename to pkg/idx/memory/meta_tags_test.go diff --git a/idx/memory/partitioned_idx.go b/pkg/idx/memory/partitioned_idx.go similarity index 100% rename from idx/memory/partitioned_idx.go rename to pkg/idx/memory/partitioned_idx.go diff --git a/idx/memory/priority_lock.go b/pkg/idx/memory/priority_lock.go similarity index 100% rename from idx/memory/priority_lock.go rename to pkg/idx/memory/priority_lock.go diff --git a/idx/memory/stats.go b/pkg/idx/memory/stats.go similarity index 100% rename from idx/memory/stats.go rename to pkg/idx/memory/stats.go diff --git a/idx/memory/tag_query.go b/pkg/idx/memory/tag_query.go similarity index 100% rename from idx/memory/tag_query.go rename to pkg/idx/memory/tag_query.go diff --git a/idx/memory/tag_query_id_filter.go b/pkg/idx/memory/tag_query_id_filter.go similarity index 100% rename from idx/memory/tag_query_id_filter.go rename to pkg/idx/memory/tag_query_id_filter.go diff --git a/idx/memory/tag_query_id_filter_test.go b/pkg/idx/memory/tag_query_id_filter_test.go similarity index 100% rename from idx/memory/tag_query_id_filter_test.go rename to pkg/idx/memory/tag_query_id_filter_test.go diff --git a/idx/memory/tag_query_id_selector.go b/pkg/idx/memory/tag_query_id_selector.go similarity index 100% rename from idx/memory/tag_query_id_selector.go rename to pkg/idx/memory/tag_query_id_selector.go diff --git a/idx/memory/tag_query_id_selector_test.go b/pkg/idx/memory/tag_query_id_selector_test.go similarity index 100% rename from idx/memory/tag_query_id_selector_test.go rename to pkg/idx/memory/tag_query_id_selector_test.go diff --git a/idx/memory/tag_query_test.go b/pkg/idx/memory/tag_query_test.go similarity index 100% rename from idx/memory/tag_query_test.go rename to pkg/idx/memory/tag_query_test.go diff --git a/idx/memory/time_limit.go b/pkg/idx/memory/time_limit.go similarity index 100% rename from idx/memory/time_limit.go rename to pkg/idx/memory/time_limit.go diff --git a/idx/memory/time_limit_test.go b/pkg/idx/memory/time_limit_test.go similarity index 100% rename from idx/memory/time_limit_test.go rename to pkg/idx/memory/time_limit_test.go diff --git a/idx/memory/write_queue.go b/pkg/idx/memory/write_queue.go similarity index 100% rename from idx/memory/write_queue.go rename to pkg/idx/memory/write_queue.go diff --git a/idx/memory/write_queue_test.go b/pkg/idx/memory/write_queue_test.go similarity index 100% rename from idx/memory/write_queue_test.go rename to pkg/idx/memory/write_queue_test.go diff --git a/idx/metatags/bigtable/config.go b/pkg/idx/metatags/bigtable/config.go similarity index 100% rename from idx/metatags/bigtable/config.go rename to pkg/idx/metatags/bigtable/config.go diff --git a/idx/metatags/bigtable/meta_record_idx.go b/pkg/idx/metatags/bigtable/meta_record_idx.go similarity index 100% rename from idx/metatags/bigtable/meta_record_idx.go rename to pkg/idx/metatags/bigtable/meta_record_idx.go diff --git a/idx/metatags/cassandra/config.go b/pkg/idx/metatags/cassandra/config.go similarity index 100% rename from idx/metatags/cassandra/config.go rename to pkg/idx/metatags/cassandra/config.go diff --git a/idx/metatags/cassandra/meta_record_idx.go b/pkg/idx/metatags/cassandra/meta_record_idx.go similarity index 100% rename from idx/metatags/cassandra/meta_record_idx.go rename to pkg/idx/metatags/cassandra/meta_record_idx.go diff --git a/idx/metatags/meta_record_status.go b/pkg/idx/metatags/meta_record_status.go similarity index 100% rename from idx/metatags/meta_record_status.go rename to pkg/idx/metatags/meta_record_status.go diff --git a/idx/metatags/meta_record_status_test.go b/pkg/idx/metatags/meta_record_status_test.go similarity index 100% rename from idx/metatags/meta_record_status_test.go rename to pkg/idx/metatags/meta_record_status_test.go diff --git a/input/carbon/carbon.go b/pkg/input/carbon/carbon.go similarity index 100% rename from input/carbon/carbon.go rename to pkg/input/carbon/carbon.go diff --git a/input/carbon/intervalgetter.go b/pkg/input/carbon/intervalgetter.go similarity index 100% rename from input/carbon/intervalgetter.go rename to pkg/input/carbon/intervalgetter.go diff --git a/input/input.go b/pkg/input/input.go similarity index 100% rename from input/input.go rename to pkg/input/input.go diff --git a/input/input_test.go b/pkg/input/input_test.go similarity index 100% rename from input/input_test.go rename to pkg/input/input_test.go diff --git a/input/kafkamdm/kafkamdm.go b/pkg/input/kafkamdm/kafkamdm.go similarity index 100% rename from input/kafkamdm/kafkamdm.go rename to pkg/input/kafkamdm/kafkamdm.go diff --git a/input/kafkamdm/lag_monitor.go b/pkg/input/kafkamdm/lag_monitor.go similarity index 100% rename from input/kafkamdm/lag_monitor.go rename to pkg/input/kafkamdm/lag_monitor.go diff --git a/input/kafkamdm/lag_monitor_test.go b/pkg/input/kafkamdm/lag_monitor_test.go similarity index 100% rename from input/kafkamdm/lag_monitor_test.go rename to pkg/input/kafkamdm/lag_monitor_test.go diff --git a/input/plugin.go b/pkg/input/plugin.go similarity index 100% rename from input/plugin.go rename to pkg/input/plugin.go diff --git a/jaeger/jaeger.go b/pkg/jaeger/jaeger.go similarity index 100% rename from jaeger/jaeger.go rename to pkg/jaeger/jaeger.go diff --git a/kafka/cfg.go b/pkg/kafka/cfg.go similarity index 100% rename from kafka/cfg.go rename to pkg/kafka/cfg.go diff --git a/kafka/partitions.go b/pkg/kafka/partitions.go similarity index 100% rename from kafka/partitions.go rename to pkg/kafka/partitions.go diff --git a/kafka/scram.go b/pkg/kafka/scram.go similarity index 100% rename from kafka/scram.go rename to pkg/kafka/scram.go diff --git a/logger/logger.go b/pkg/logger/logger.go similarity index 100% rename from logger/logger.go rename to pkg/logger/logger.go diff --git a/mdata/aggmetric.go b/pkg/mdata/aggmetric.go similarity index 100% rename from mdata/aggmetric.go rename to pkg/mdata/aggmetric.go diff --git a/mdata/aggmetric_test.go b/pkg/mdata/aggmetric_test.go similarity index 100% rename from mdata/aggmetric_test.go rename to pkg/mdata/aggmetric_test.go diff --git a/mdata/aggmetrics.go b/pkg/mdata/aggmetrics.go similarity index 100% rename from mdata/aggmetrics.go rename to pkg/mdata/aggmetrics.go diff --git a/mdata/aggmetrics_test.go b/pkg/mdata/aggmetrics_test.go similarity index 100% rename from mdata/aggmetrics_test.go rename to pkg/mdata/aggmetrics_test.go diff --git a/mdata/aggregation.go b/pkg/mdata/aggregation.go similarity index 100% rename from mdata/aggregation.go rename to pkg/mdata/aggregation.go diff --git a/mdata/aggregator.go b/pkg/mdata/aggregator.go similarity index 100% rename from mdata/aggregator.go rename to pkg/mdata/aggregator.go diff --git a/mdata/aggregator_test.go b/pkg/mdata/aggregator_test.go similarity index 100% rename from mdata/aggregator_test.go rename to pkg/mdata/aggregator_test.go diff --git a/mdata/cache/accnt/flat_accnt.go b/pkg/mdata/cache/accnt/flat_accnt.go similarity index 100% rename from mdata/cache/accnt/flat_accnt.go rename to pkg/mdata/cache/accnt/flat_accnt.go diff --git a/mdata/cache/accnt/flat_accnt_test.go b/pkg/mdata/cache/accnt/flat_accnt_test.go similarity index 100% rename from mdata/cache/accnt/flat_accnt_test.go rename to pkg/mdata/cache/accnt/flat_accnt_test.go diff --git a/mdata/cache/accnt/if.go b/pkg/mdata/cache/accnt/if.go similarity index 100% rename from mdata/cache/accnt/if.go rename to pkg/mdata/cache/accnt/if.go diff --git a/mdata/cache/accnt/lru.go b/pkg/mdata/cache/accnt/lru.go similarity index 100% rename from mdata/cache/accnt/lru.go rename to pkg/mdata/cache/accnt/lru.go diff --git a/mdata/cache/accnt/lru_test.go b/pkg/mdata/cache/accnt/lru_test.go similarity index 100% rename from mdata/cache/accnt/lru_test.go rename to pkg/mdata/cache/accnt/lru_test.go diff --git a/mdata/cache/accnt/sort_uint32.go b/pkg/mdata/cache/accnt/sort_uint32.go similarity index 100% rename from mdata/cache/accnt/sort_uint32.go rename to pkg/mdata/cache/accnt/sort_uint32.go diff --git a/mdata/cache/accnt/stats.go b/pkg/mdata/cache/accnt/stats.go similarity index 100% rename from mdata/cache/accnt/stats.go rename to pkg/mdata/cache/accnt/stats.go diff --git a/mdata/cache/cache_mock.go b/pkg/mdata/cache/cache_mock.go similarity index 100% rename from mdata/cache/cache_mock.go rename to pkg/mdata/cache/cache_mock.go diff --git a/mdata/cache/ccache.go b/pkg/mdata/cache/ccache.go similarity index 100% rename from mdata/cache/ccache.go rename to pkg/mdata/cache/ccache.go diff --git a/mdata/cache/ccache_chunk.go b/pkg/mdata/cache/ccache_chunk.go similarity index 100% rename from mdata/cache/ccache_chunk.go rename to pkg/mdata/cache/ccache_chunk.go diff --git a/mdata/cache/ccache_metric.go b/pkg/mdata/cache/ccache_metric.go similarity index 100% rename from mdata/cache/ccache_metric.go rename to pkg/mdata/cache/ccache_metric.go diff --git a/mdata/cache/ccache_metric_test.go b/pkg/mdata/cache/ccache_metric_test.go similarity index 100% rename from mdata/cache/ccache_metric_test.go rename to pkg/mdata/cache/ccache_metric_test.go diff --git a/mdata/cache/ccache_test.go b/pkg/mdata/cache/ccache_test.go similarity index 100% rename from mdata/cache/ccache_test.go rename to pkg/mdata/cache/ccache_test.go diff --git a/mdata/cache/if.go b/pkg/mdata/cache/if.go similarity index 100% rename from mdata/cache/if.go rename to pkg/mdata/cache/if.go diff --git a/mdata/cache/resulttype_string.go b/pkg/mdata/cache/resulttype_string.go similarity index 100% rename from mdata/cache/resulttype_string.go rename to pkg/mdata/cache/resulttype_string.go diff --git a/mdata/chunk/archive/archive.go b/pkg/mdata/chunk/archive/archive.go similarity index 100% rename from mdata/chunk/archive/archive.go rename to pkg/mdata/chunk/archive/archive.go diff --git a/mdata/chunk/archive/archive_gen.go b/pkg/mdata/chunk/archive/archive_gen.go similarity index 100% rename from mdata/chunk/archive/archive_gen.go rename to pkg/mdata/chunk/archive/archive_gen.go diff --git a/mdata/chunk/archive/archive_gen_test.go b/pkg/mdata/chunk/archive/archive_gen_test.go similarity index 100% rename from mdata/chunk/archive/archive_gen_test.go rename to pkg/mdata/chunk/archive/archive_gen_test.go diff --git a/mdata/chunk/chunk.go b/pkg/mdata/chunk/chunk.go similarity index 100% rename from mdata/chunk/chunk.go rename to pkg/mdata/chunk/chunk.go diff --git a/mdata/chunk/chunk_test.go b/pkg/mdata/chunk/chunk_test.go similarity index 100% rename from mdata/chunk/chunk_test.go rename to pkg/mdata/chunk/chunk_test.go diff --git a/mdata/chunk/encode.go b/pkg/mdata/chunk/encode.go similarity index 100% rename from mdata/chunk/encode.go rename to pkg/mdata/chunk/encode.go diff --git a/mdata/chunk/format.go b/pkg/mdata/chunk/format.go similarity index 100% rename from mdata/chunk/format.go rename to pkg/mdata/chunk/format.go diff --git a/mdata/chunk/format_string.go b/pkg/mdata/chunk/format_string.go similarity index 100% rename from mdata/chunk/format_string.go rename to pkg/mdata/chunk/format_string.go diff --git a/mdata/chunk/itergen.go b/pkg/mdata/chunk/itergen.go similarity index 100% rename from mdata/chunk/itergen.go rename to pkg/mdata/chunk/itergen.go diff --git a/mdata/chunk/itergen_gen.go b/pkg/mdata/chunk/itergen_gen.go similarity index 100% rename from mdata/chunk/itergen_gen.go rename to pkg/mdata/chunk/itergen_gen.go diff --git a/mdata/chunk/itergen_gen_test.go b/pkg/mdata/chunk/itergen_gen_test.go similarity index 100% rename from mdata/chunk/itergen_gen_test.go rename to pkg/mdata/chunk/itergen_gen_test.go diff --git a/mdata/chunk/spans.go b/pkg/mdata/chunk/spans.go similarity index 100% rename from mdata/chunk/spans.go rename to pkg/mdata/chunk/spans.go diff --git a/mdata/chunk/tsz/LICENSE b/pkg/mdata/chunk/tsz/LICENSE similarity index 100% rename from mdata/chunk/tsz/LICENSE rename to pkg/mdata/chunk/tsz/LICENSE diff --git a/mdata/chunk/tsz/bstream.go b/pkg/mdata/chunk/tsz/bstream.go similarity index 100% rename from mdata/chunk/tsz/bstream.go rename to pkg/mdata/chunk/tsz/bstream.go diff --git a/mdata/chunk/tsz/finish.go b/pkg/mdata/chunk/tsz/finish.go similarity index 100% rename from mdata/chunk/tsz/finish.go rename to pkg/mdata/chunk/tsz/finish.go diff --git a/mdata/chunk/tsz/fuzz.go b/pkg/mdata/chunk/tsz/fuzz.go similarity index 100% rename from mdata/chunk/tsz/fuzz.go rename to pkg/mdata/chunk/tsz/fuzz.go diff --git a/mdata/chunk/tsz/iter.go b/pkg/mdata/chunk/tsz/iter.go similarity index 100% rename from mdata/chunk/tsz/iter.go rename to pkg/mdata/chunk/tsz/iter.go diff --git a/mdata/chunk/tsz/series_test.go b/pkg/mdata/chunk/tsz/series_test.go similarity index 100% rename from mdata/chunk/tsz/series_test.go rename to pkg/mdata/chunk/tsz/series_test.go diff --git a/mdata/chunk/tsz/testdata/data.go b/pkg/mdata/chunk/tsz/testdata/data.go similarity index 100% rename from mdata/chunk/tsz/testdata/data.go rename to pkg/mdata/chunk/tsz/testdata/data.go diff --git a/mdata/chunk/tsz/tsz.go b/pkg/mdata/chunk/tsz/tsz.go similarity index 100% rename from mdata/chunk/tsz/tsz.go rename to pkg/mdata/chunk/tsz/tsz.go diff --git a/mdata/chunk/tsz/tsz_test.go b/pkg/mdata/chunk/tsz/tsz_test.go similarity index 100% rename from mdata/chunk/tsz/tsz_test.go rename to pkg/mdata/chunk/tsz/tsz_test.go diff --git a/mdata/chunk/tsz/tszlong.go b/pkg/mdata/chunk/tsz/tszlong.go similarity index 100% rename from mdata/chunk/tsz/tszlong.go rename to pkg/mdata/chunk/tsz/tszlong.go diff --git a/mdata/cwr.go b/pkg/mdata/cwr.go similarity index 100% rename from mdata/cwr.go rename to pkg/mdata/cwr.go diff --git a/mdata/cwr_gen.go b/pkg/mdata/cwr_gen.go similarity index 100% rename from mdata/cwr_gen.go rename to pkg/mdata/cwr_gen.go diff --git a/mdata/cwr_gen_test.go b/pkg/mdata/cwr_gen_test.go similarity index 100% rename from mdata/cwr_gen_test.go rename to pkg/mdata/cwr_gen_test.go diff --git a/mdata/errors/errors.go b/pkg/mdata/errors/errors.go similarity index 100% rename from mdata/errors/errors.go rename to pkg/mdata/errors/errors.go diff --git a/mdata/helper.go b/pkg/mdata/helper.go similarity index 100% rename from mdata/helper.go rename to pkg/mdata/helper.go diff --git a/mdata/ifaces.go b/pkg/mdata/ifaces.go similarity index 100% rename from mdata/ifaces.go rename to pkg/mdata/ifaces.go diff --git a/mdata/importer/archive_request.go b/pkg/mdata/importer/archive_request.go similarity index 100% rename from mdata/importer/archive_request.go rename to pkg/mdata/importer/archive_request.go diff --git a/mdata/importer/archive_request_gen.go b/pkg/mdata/importer/archive_request_gen.go similarity index 100% rename from mdata/importer/archive_request_gen.go rename to pkg/mdata/importer/archive_request_gen.go diff --git a/mdata/importer/archive_request_gen_test.go b/pkg/mdata/importer/archive_request_gen_test.go similarity index 100% rename from mdata/importer/archive_request_gen_test.go rename to pkg/mdata/importer/archive_request_gen_test.go diff --git a/mdata/importer/chunk_encoder.go b/pkg/mdata/importer/chunk_encoder.go similarity index 100% rename from mdata/importer/chunk_encoder.go rename to pkg/mdata/importer/chunk_encoder.go diff --git a/mdata/importer/chunk_encoder_test.go b/pkg/mdata/importer/chunk_encoder_test.go similarity index 100% rename from mdata/importer/chunk_encoder_test.go rename to pkg/mdata/importer/chunk_encoder_test.go diff --git a/mdata/importer/converter.go b/pkg/mdata/importer/converter.go similarity index 100% rename from mdata/importer/converter.go rename to pkg/mdata/importer/converter.go diff --git a/mdata/importer/converter_test.go b/pkg/mdata/importer/converter_test.go similarity index 100% rename from mdata/importer/converter_test.go rename to pkg/mdata/importer/converter_test.go diff --git a/mdata/importer/cwr.go b/pkg/mdata/importer/cwr.go similarity index 100% rename from mdata/importer/cwr.go rename to pkg/mdata/importer/cwr.go diff --git a/mdata/importer/cwr_gen.go b/pkg/mdata/importer/cwr_gen.go similarity index 100% rename from mdata/importer/cwr_gen.go rename to pkg/mdata/importer/cwr_gen.go diff --git a/mdata/importer/cwr_gen_test.go b/pkg/mdata/importer/cwr_gen_test.go similarity index 100% rename from mdata/importer/cwr_gen_test.go rename to pkg/mdata/importer/cwr_gen_test.go diff --git a/mdata/init.go b/pkg/mdata/init.go similarity index 100% rename from mdata/init.go rename to pkg/mdata/init.go diff --git a/mdata/notifier.go b/pkg/mdata/notifier.go similarity index 100% rename from mdata/notifier.go rename to pkg/mdata/notifier.go diff --git a/mdata/notifierKafka/cfg.go b/pkg/mdata/notifierKafka/cfg.go similarity index 100% rename from mdata/notifierKafka/cfg.go rename to pkg/mdata/notifierKafka/cfg.go diff --git a/mdata/notifierKafka/notifierKafka.go b/pkg/mdata/notifierKafka/notifierKafka.go similarity index 100% rename from mdata/notifierKafka/notifierKafka.go rename to pkg/mdata/notifierKafka/notifierKafka.go diff --git a/mdata/notifierKafka/scram.go b/pkg/mdata/notifierKafka/scram.go similarity index 100% rename from mdata/notifierKafka/scram.go rename to pkg/mdata/notifierKafka/scram.go diff --git a/mdata/reorder_buffer.go b/pkg/mdata/reorder_buffer.go similarity index 100% rename from mdata/reorder_buffer.go rename to pkg/mdata/reorder_buffer.go diff --git a/mdata/reorder_buffer_test.go b/pkg/mdata/reorder_buffer_test.go similarity index 100% rename from mdata/reorder_buffer_test.go rename to pkg/mdata/reorder_buffer_test.go diff --git a/mdata/result.go b/pkg/mdata/result.go similarity index 100% rename from mdata/result.go rename to pkg/mdata/result.go diff --git a/mdata/schema.go b/pkg/mdata/schema.go similarity index 100% rename from mdata/schema.go rename to pkg/mdata/schema.go diff --git a/mdata/store_mock.go b/pkg/mdata/store_mock.go similarity index 100% rename from mdata/store_mock.go rename to pkg/mdata/store_mock.go diff --git a/pointslicepool/pointslicepool.go b/pkg/pointslicepool/pointslicepool.go similarity index 100% rename from pointslicepool/pointslicepool.go rename to pkg/pointslicepool/pointslicepool.go diff --git a/publish/kafka/keycache/cache.go b/pkg/publish/kafka/keycache/cache.go similarity index 100% rename from publish/kafka/keycache/cache.go rename to pkg/publish/kafka/keycache/cache.go diff --git a/publish/kafka/keycache/keycache.go b/pkg/publish/kafka/keycache/keycache.go similarity index 100% rename from publish/kafka/keycache/keycache.go rename to pkg/publish/kafka/keycache/keycache.go diff --git a/publish/kafka/keycache/shard.go b/pkg/publish/kafka/keycache/shard.go similarity index 100% rename from publish/kafka/keycache/shard.go rename to pkg/publish/kafka/keycache/shard.go diff --git a/publish/kafka/publish.go b/pkg/publish/kafka/publish.go similarity index 100% rename from publish/kafka/publish.go rename to pkg/publish/kafka/publish.go diff --git a/publish/kafka/publish_test.go b/pkg/publish/kafka/publish_test.go similarity index 100% rename from publish/kafka/publish_test.go rename to pkg/publish/kafka/publish_test.go diff --git a/publish/publish.go b/pkg/publish/publish.go similarity index 100% rename from publish/publish.go rename to pkg/publish/publish.go diff --git a/schema/LICENSE b/pkg/schema/LICENSE similarity index 100% rename from schema/LICENSE rename to pkg/schema/LICENSE diff --git a/schema/archive.go b/pkg/schema/archive.go similarity index 100% rename from schema/archive.go rename to pkg/schema/archive.go diff --git a/schema/archive_gen.go b/pkg/schema/archive_gen.go similarity index 100% rename from schema/archive_gen.go rename to pkg/schema/archive_gen.go diff --git a/schema/archive_gen_test.go b/pkg/schema/archive_gen_test.go similarity index 100% rename from schema/archive_gen_test.go rename to pkg/schema/archive_gen_test.go diff --git a/schema/archive_test.go b/pkg/schema/archive_test.go similarity index 100% rename from schema/archive_test.go rename to pkg/schema/archive_test.go diff --git a/schema/control.go b/pkg/schema/control.go similarity index 100% rename from schema/control.go rename to pkg/schema/control.go diff --git a/schema/control_gen.go b/pkg/schema/control_gen.go similarity index 100% rename from schema/control_gen.go rename to pkg/schema/control_gen.go diff --git a/schema/control_gen_test.go b/pkg/schema/control_gen_test.go similarity index 100% rename from schema/control_gen_test.go rename to pkg/schema/control_gen_test.go diff --git a/schema/key.go b/pkg/schema/key.go similarity index 100% rename from schema/key.go rename to pkg/schema/key.go diff --git a/schema/key_gen.go b/pkg/schema/key_gen.go similarity index 100% rename from schema/key_gen.go rename to pkg/schema/key_gen.go diff --git a/schema/key_gen_test.go b/pkg/schema/key_gen_test.go similarity index 100% rename from schema/key_gen_test.go rename to pkg/schema/key_gen_test.go diff --git a/schema/key_test.go b/pkg/schema/key_test.go similarity index 100% rename from schema/key_test.go rename to pkg/schema/key_test.go diff --git a/schema/method_string.go b/pkg/schema/method_string.go similarity index 100% rename from schema/method_string.go rename to pkg/schema/method_string.go diff --git a/schema/metric.go b/pkg/schema/metric.go similarity index 100% rename from schema/metric.go rename to pkg/schema/metric.go diff --git a/schema/metric_gen.go b/pkg/schema/metric_gen.go similarity index 100% rename from schema/metric_gen.go rename to pkg/schema/metric_gen.go diff --git a/schema/metric_gen_test.go b/pkg/schema/metric_gen_test.go similarity index 100% rename from schema/metric_gen_test.go rename to pkg/schema/metric_gen_test.go diff --git a/schema/metric_serialization_gob_test.go b/pkg/schema/metric_serialization_gob_test.go similarity index 100% rename from schema/metric_serialization_gob_test.go rename to pkg/schema/metric_serialization_gob_test.go diff --git a/schema/metric_serialization_json_test.go b/pkg/schema/metric_serialization_json_test.go similarity index 100% rename from schema/metric_serialization_json_test.go rename to pkg/schema/metric_serialization_json_test.go diff --git a/schema/metric_serialization_metricpoint_test.go b/pkg/schema/metric_serialization_metricpoint_test.go similarity index 100% rename from schema/metric_serialization_metricpoint_test.go rename to pkg/schema/metric_serialization_metricpoint_test.go diff --git a/schema/metric_serialization_metricpoint_withoutorg_test.go b/pkg/schema/metric_serialization_metricpoint_withoutorg_test.go similarity index 100% rename from schema/metric_serialization_metricpoint_withoutorg_test.go rename to pkg/schema/metric_serialization_metricpoint_withoutorg_test.go diff --git a/schema/metric_serialization_msgp_test.go b/pkg/schema/metric_serialization_msgp_test.go similarity index 100% rename from schema/metric_serialization_msgp_test.go rename to pkg/schema/metric_serialization_msgp_test.go diff --git a/schema/metric_serialization_test.go b/pkg/schema/metric_serialization_test.go similarity index 100% rename from schema/metric_serialization_test.go rename to pkg/schema/metric_serialization_test.go diff --git a/schema/metric_test.go b/pkg/schema/metric_test.go similarity index 100% rename from schema/metric_test.go rename to pkg/schema/metric_test.go diff --git a/schema/metricpoint.go b/pkg/schema/metricpoint.go similarity index 100% rename from schema/metricpoint.go rename to pkg/schema/metricpoint.go diff --git a/schema/metricpoint_test.go b/pkg/schema/metricpoint_test.go similarity index 100% rename from schema/metricpoint_test.go rename to pkg/schema/metricpoint_test.go diff --git a/schema/metricpoint_withoutorg_test.go b/pkg/schema/metricpoint_withoutorg_test.go similarity index 100% rename from schema/metricpoint_withoutorg_test.go rename to pkg/schema/metricpoint_withoutorg_test.go diff --git a/schema/msg/format.go b/pkg/schema/msg/format.go similarity index 100% rename from schema/msg/format.go rename to pkg/schema/msg/format.go diff --git a/schema/msg/format_string.go b/pkg/schema/msg/format_string.go similarity index 100% rename from schema/msg/format_string.go rename to pkg/schema/msg/format_string.go diff --git a/schema/msg/msg.go b/pkg/schema/msg/msg.go similarity index 100% rename from schema/msg/msg.go rename to pkg/schema/msg/msg.go diff --git a/schema/msg/msg_test.go b/pkg/schema/msg/msg_test.go similarity index 100% rename from schema/msg/msg_test.go rename to pkg/schema/msg/msg_test.go diff --git a/schema/operation_string.go b/pkg/schema/operation_string.go similarity index 100% rename from schema/operation_string.go rename to pkg/schema/operation_string.go diff --git a/schema/partition.go b/pkg/schema/partition.go similarity index 100% rename from schema/partition.go rename to pkg/schema/partition.go diff --git a/schema/partition_test.go b/pkg/schema/partition_test.go similarity index 100% rename from schema/partition_test.go rename to pkg/schema/partition_test.go diff --git a/schema/point.go b/pkg/schema/point.go similarity index 100% rename from schema/point.go rename to pkg/schema/point.go diff --git a/schema/point_gen.go b/pkg/schema/point_gen.go similarity index 100% rename from schema/point_gen.go rename to pkg/schema/point_gen.go diff --git a/schema/point_gen_test.go b/pkg/schema/point_gen_test.go similarity index 100% rename from schema/point_gen_test.go rename to pkg/schema/point_gen_test.go diff --git a/schema/reslice.go b/pkg/schema/reslice.go similarity index 100% rename from schema/reslice.go rename to pkg/schema/reslice.go diff --git a/schema/reslice_test.go b/pkg/schema/reslice_test.go similarity index 100% rename from schema/reslice_test.go rename to pkg/schema/reslice_test.go diff --git a/stacktest/README.md b/pkg/stacktest/README.md similarity index 100% rename from stacktest/README.md rename to pkg/stacktest/README.md diff --git a/stacktest/docker/docker.go b/pkg/stacktest/docker/docker.go similarity index 100% rename from stacktest/docker/docker.go rename to pkg/stacktest/docker/docker.go diff --git a/stacktest/fakemetrics/fakemetrics.go b/pkg/stacktest/fakemetrics/fakemetrics.go similarity index 100% rename from stacktest/fakemetrics/fakemetrics.go rename to pkg/stacktest/fakemetrics/fakemetrics.go diff --git a/stacktest/grafana/grafana.go b/pkg/stacktest/grafana/grafana.go similarity index 100% rename from stacktest/grafana/grafana.go rename to pkg/stacktest/grafana/grafana.go diff --git a/stacktest/graphite/comparator.go b/pkg/stacktest/graphite/comparator.go similarity index 100% rename from stacktest/graphite/comparator.go rename to pkg/stacktest/graphite/comparator.go diff --git a/stacktest/graphite/graphite.go b/pkg/stacktest/graphite/graphite.go similarity index 100% rename from stacktest/graphite/graphite.go rename to pkg/stacktest/graphite/graphite.go diff --git a/stacktest/graphite/response.go b/pkg/stacktest/graphite/response.go similarity index 100% rename from stacktest/graphite/response.go rename to pkg/stacktest/graphite/response.go diff --git a/stacktest/graphite/validate.go b/pkg/stacktest/graphite/validate.go similarity index 100% rename from stacktest/graphite/validate.go rename to pkg/stacktest/graphite/validate.go diff --git a/stacktest/tests/chaos_cluster/README.md b/pkg/stacktest/tests/chaos_cluster/README.md similarity index 100% rename from stacktest/tests/chaos_cluster/README.md rename to pkg/stacktest/tests/chaos_cluster/README.md diff --git a/stacktest/tests/chaos_cluster/analyze-mt4-out.sh b/pkg/stacktest/tests/chaos_cluster/analyze-mt4-out.sh similarity index 100% rename from stacktest/tests/chaos_cluster/analyze-mt4-out.sh rename to pkg/stacktest/tests/chaos_cluster/analyze-mt4-out.sh diff --git a/stacktest/tests/chaos_cluster/chaos_cluster_test.go b/pkg/stacktest/tests/chaos_cluster/chaos_cluster_test.go similarity index 100% rename from stacktest/tests/chaos_cluster/chaos_cluster_test.go rename to pkg/stacktest/tests/chaos_cluster/chaos_cluster_test.go diff --git a/stacktest/tests/chaos_cluster/notes b/pkg/stacktest/tests/chaos_cluster/notes similarity index 100% rename from stacktest/tests/chaos_cluster/notes rename to pkg/stacktest/tests/chaos_cluster/notes diff --git a/stacktest/tests/end2end_carbon/end2end_carbon_test.go b/pkg/stacktest/tests/end2end_carbon/end2end_carbon_test.go similarity index 100% rename from stacktest/tests/end2end_carbon/end2end_carbon_test.go rename to pkg/stacktest/tests/end2end_carbon/end2end_carbon_test.go diff --git a/stacktest/tests/end2end_carbon/notes b/pkg/stacktest/tests/end2end_carbon/notes similarity index 100% rename from stacktest/tests/end2end_carbon/notes rename to pkg/stacktest/tests/end2end_carbon/notes diff --git a/stacktest/tests/end2end_carbon_bigtable/end2end_carbon_test.go b/pkg/stacktest/tests/end2end_carbon_bigtable/end2end_carbon_test.go similarity index 100% rename from stacktest/tests/end2end_carbon_bigtable/end2end_carbon_test.go rename to pkg/stacktest/tests/end2end_carbon_bigtable/end2end_carbon_test.go diff --git a/stacktest/tests/end2end_carbon_bigtable/notes b/pkg/stacktest/tests/end2end_carbon_bigtable/notes similarity index 100% rename from stacktest/tests/end2end_carbon_bigtable/notes rename to pkg/stacktest/tests/end2end_carbon_bigtable/notes diff --git a/stacktest/tests/predictable-tag-query-render-workload/README.md b/pkg/stacktest/tests/predictable-tag-query-render-workload/README.md similarity index 100% rename from stacktest/tests/predictable-tag-query-render-workload/README.md rename to pkg/stacktest/tests/predictable-tag-query-render-workload/README.md diff --git a/stacktest/tests/predictable-tag-query-render-workload/main.go b/pkg/stacktest/tests/predictable-tag-query-render-workload/main.go similarity index 100% rename from stacktest/tests/predictable-tag-query-render-workload/main.go rename to pkg/stacktest/tests/predictable-tag-query-render-workload/main.go diff --git a/stacktest/track/tracker.go b/pkg/stacktest/track/tracker.go similarity index 100% rename from stacktest/track/tracker.go rename to pkg/stacktest/track/tracker.go diff --git a/stats/bool.go b/pkg/stats/bool.go similarity index 100% rename from stats/bool.go rename to pkg/stats/bool.go diff --git a/stats/config/init.go b/pkg/stats/config/init.go similarity index 100% rename from stats/config/init.go rename to pkg/stats/config/init.go diff --git a/stats/counter32.go b/pkg/stats/counter32.go similarity index 100% rename from stats/counter32.go rename to pkg/stats/counter32.go diff --git a/stats/counter64.go b/pkg/stats/counter64.go similarity index 100% rename from stats/counter64.go rename to pkg/stats/counter64.go diff --git a/stats/counterrate32.go b/pkg/stats/counterrate32.go similarity index 100% rename from stats/counterrate32.go rename to pkg/stats/counterrate32.go diff --git a/stats/gauge32.go b/pkg/stats/gauge32.go similarity index 100% rename from stats/gauge32.go rename to pkg/stats/gauge32.go diff --git a/stats/gauge64.go b/pkg/stats/gauge64.go similarity index 100% rename from stats/gauge64.go rename to pkg/stats/gauge64.go diff --git a/stats/init.go b/pkg/stats/init.go similarity index 100% rename from stats/init.go rename to pkg/stats/init.go diff --git a/stats/kafka.go b/pkg/stats/kafka.go similarity index 100% rename from stats/kafka.go rename to pkg/stats/kafka.go diff --git a/stats/latencyhistogram12h32.go b/pkg/stats/latencyhistogram12h32.go similarity index 100% rename from stats/latencyhistogram12h32.go rename to pkg/stats/latencyhistogram12h32.go diff --git a/stats/latencyhistogram15s32.go b/pkg/stats/latencyhistogram15s32.go similarity index 100% rename from stats/latencyhistogram15s32.go rename to pkg/stats/latencyhistogram15s32.go diff --git a/stats/memory_reporter.go b/pkg/stats/memory_reporter.go similarity index 100% rename from stats/memory_reporter.go rename to pkg/stats/memory_reporter.go diff --git a/stats/meter32.go b/pkg/stats/meter32.go similarity index 100% rename from stats/meter32.go rename to pkg/stats/meter32.go diff --git a/stats/out_devnull.go b/pkg/stats/out_devnull.go similarity index 100% rename from stats/out_devnull.go rename to pkg/stats/out_devnull.go diff --git a/stats/out_graphite.go b/pkg/stats/out_graphite.go similarity index 100% rename from stats/out_graphite.go rename to pkg/stats/out_graphite.go diff --git a/stats/process_reporter.go b/pkg/stats/process_reporter.go similarity index 100% rename from stats/process_reporter.go rename to pkg/stats/process_reporter.go diff --git a/stats/range32.go b/pkg/stats/range32.go similarity index 100% rename from stats/range32.go rename to pkg/stats/range32.go diff --git a/stats/registry.go b/pkg/stats/registry.go similarity index 100% rename from stats/registry.go rename to pkg/stats/registry.go diff --git a/stats/timediff_reporter.go b/pkg/stats/timediff_reporter.go similarity index 100% rename from stats/timediff_reporter.go rename to pkg/stats/timediff_reporter.go diff --git a/stats/write.go b/pkg/stats/write.go similarity index 100% rename from stats/write.go rename to pkg/stats/write.go diff --git a/store/bigtable/bigtable.go b/pkg/store/bigtable/bigtable.go similarity index 100% rename from store/bigtable/bigtable.go rename to pkg/store/bigtable/bigtable.go diff --git a/store/bigtable/config.go b/pkg/store/bigtable/config.go similarity index 100% rename from store/bigtable/config.go rename to pkg/store/bigtable/config.go diff --git a/store/cassandra/cassandra.go b/pkg/store/cassandra/cassandra.go similarity index 100% rename from store/cassandra/cassandra.go rename to pkg/store/cassandra/cassandra.go diff --git a/store/cassandra/cassandra_test.go b/pkg/store/cassandra/cassandra_test.go similarity index 100% rename from store/cassandra/cassandra_test.go rename to pkg/store/cassandra/cassandra_test.go diff --git a/store/cassandra/config.go b/pkg/store/cassandra/config.go similarity index 100% rename from store/cassandra/config.go rename to pkg/store/cassandra/config.go diff --git a/store/cassandra/table.go b/pkg/store/cassandra/table.go similarity index 100% rename from store/cassandra/table.go rename to pkg/store/cassandra/table.go diff --git a/store/store_devnull.go b/pkg/store/store_devnull.go similarity index 100% rename from store/store_devnull.go rename to pkg/store/store_devnull.go diff --git a/test/key.go b/pkg/test/key.go similarity index 100% rename from test/key.go rename to pkg/test/key.go diff --git a/test/path.go b/pkg/test/path.go similarity index 100% rename from test/path.go rename to pkg/test/path.go diff --git a/test/points.go b/pkg/test/points.go similarity index 100% rename from test/points.go rename to pkg/test/points.go diff --git a/test/tracer.go b/pkg/test/tracer.go similarity index 100% rename from test/tracer.go rename to pkg/test/tracer.go diff --git a/tracing/tracing.go b/pkg/tracing/tracing.go similarity index 100% rename from tracing/tracing.go rename to pkg/tracing/tracing.go diff --git a/util/align/align.go b/pkg/util/align/align.go similarity index 100% rename from util/align/align.go rename to pkg/util/align/align.go diff --git a/util/align/align_test.go b/pkg/util/align/align_test.go similarity index 100% rename from util/align/align_test.go rename to pkg/util/align/align_test.go diff --git a/util/atomic.go b/pkg/util/atomic.go similarity index 100% rename from util/atomic.go rename to pkg/util/atomic.go diff --git a/util/buffer_pool.go b/pkg/util/buffer_pool.go similarity index 100% rename from util/buffer_pool.go rename to pkg/util/buffer_pool.go diff --git a/util/combinations.go b/pkg/util/combinations.go similarity index 100% rename from util/combinations.go rename to pkg/util/combinations.go diff --git a/util/combinations_test.go b/pkg/util/combinations_test.go similarity index 100% rename from util/combinations_test.go rename to pkg/util/combinations_test.go diff --git a/util/compression.go b/pkg/util/compression.go similarity index 100% rename from util/compression.go rename to pkg/util/compression.go diff --git a/util/flag_parsers.go b/pkg/util/flag_parsers.go similarity index 100% rename from util/flag_parsers.go rename to pkg/util/flag_parsers.go diff --git a/util/flag_parsers_test.go b/pkg/util/flag_parsers_test.go similarity index 100% rename from util/flag_parsers_test.go rename to pkg/util/flag_parsers_test.go diff --git a/util/flags.go b/pkg/util/flags.go similarity index 100% rename from util/flags.go rename to pkg/util/flags.go diff --git a/util/flags_test.go b/pkg/util/flags_test.go similarity index 100% rename from util/flags_test.go rename to pkg/util/flags_test.go diff --git a/util/fnv32a.go b/pkg/util/fnv32a.go similarity index 100% rename from util/fnv32a.go rename to pkg/util/fnv32a.go diff --git a/util/fnv64a.go b/pkg/util/fnv64a.go similarity index 100% rename from util/fnv64a.go rename to pkg/util/fnv64a.go diff --git a/util/helper.go b/pkg/util/helper.go similarity index 100% rename from util/helper.go rename to pkg/util/helper.go diff --git a/util/limiter.go b/pkg/util/limiter.go similarity index 100% rename from util/limiter.go rename to pkg/util/limiter.go diff --git a/util/limiter_test.go b/pkg/util/limiter_test.go similarity index 100% rename from util/limiter_test.go rename to pkg/util/limiter_test.go diff --git a/util/naturalsort.go b/pkg/util/naturalsort.go similarity index 100% rename from util/naturalsort.go rename to pkg/util/naturalsort.go diff --git a/util/naturalsort_test.go b/pkg/util/naturalsort_test.go similarity index 100% rename from util/naturalsort_test.go rename to pkg/util/naturalsort_test.go diff --git a/util/template.go b/pkg/util/template.go similarity index 100% rename from util/template.go rename to pkg/util/template.go diff --git a/util/timeout.go b/pkg/util/timeout.go similarity index 100% rename from util/timeout.go rename to pkg/util/timeout.go diff --git a/util/timeout_test.go b/pkg/util/timeout_test.go similarity index 100% rename from util/timeout_test.go rename to pkg/util/timeout_test.go diff --git a/util/util.go b/pkg/util/util.go similarity index 100% rename from util/util.go rename to pkg/util/util.go diff --git a/util/util_test.go b/pkg/util/util_test.go similarity index 100% rename from util/util_test.go rename to pkg/util/util_test.go