text
stringlengths
55
456k
metadata
dict
# Languages supported by Perforator Perforator supports different kinds of programming languages and language runtimes. This page describes the current status of language support. There are different tiers of support for different languages and runtimes: - Tier 0: C++. This is our primary focus. Perforator has some advanced features for C++ that are not yet available for other languages. - Tier 1: Native languages like Rust, C, Go. These should work fine without any configuration in most cases (the only requirement is debug symbols availability). - Tier 2: Python and Java. We have experimental support for these, which have known limitations and runtime requirements. ## Native languages Support for native (compiled to machine code) languages is the most important target for the Perforator. We strive to implement this as good as possible without complex requirements on profiled binaries like `-fno-omit-frame-pointer` switch. The only requirements are: - The presence of debugging symbols either in production builds or separate debug info providers like debuginfod. It is simply not possible to map raw instructions to source code without debug symbols. - The presence of `.eh_frame` section which is generated by default by modern compilers. This section is used by exception runtimes in some popular native languages, but executables without exceptions also have this section unless switch `-fno-asynchronous-unwind-tables` is specified. Incomplete list of the native languages we tested Perforator on successfully: ### C & C++ Initially Perforator was developed to profile C++, our main language for high-performance services inside Yandex. We profile thousands of C & C++ binaries in different configurations. ### Golang Golang is a very easy language for profiling due to the always-available frame pointers [since 2016](https://github.com/golang/go/issues/15840). The only requirement for profiling is debug symbols availability. ### Rust We have not tested Rust profiling as extensively as C++, but a few tests show that Rust is profiled correctly. The only difference from C / C++ is Rust-specific function name mangling which is not correctly parsed in some cases. We are going to address this issue soon. ## Interpreted languages ### Python Perforator supports Python with some additional requirements on the runtime. See [this page](./python/profiling.md) for more info. As for now, other interpreted languages are not supported. Please file an issue on GitHub if you have a language you think is worth supporting. ## JIT-compiled languages ### Java We have an experimental implementation of the [Java](./java/) profiler which requires users to set some flags for the JVM runtime. We are working on zero-configuration Java support. ## Other languages Probably a lot of less popular native languages can be profiled out of the box using either frame pointers or `.eh_frame`. We have seen valid profiles from Zig applications, for example. The best way to check whether your language/application is supported is to profile it. Many interpreted & JIT-compiled languages can be profiled using [perf-pid.map](https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/Documentation/jit-interface.txt?h=perf-tools-next) JIT interface initially developed for perf. Perforator natively supports perfmaps, so when you enable them on the application side it should just work. Search for words like "perf", "frame pointers" and "perf-pid.map" in your language's documentations. For example, [NodeJS](https://nodejs.org/en/learn/diagnostics/poor-performance/using-linux-perf), [PHP](https://wiki.php.net/rfc/jit), and [Python](https://docs.python.org/3/c-api/perfmaps.html) can be profiled like this. See [perfmap reference](../perfmap.md) for more details. ## Language support policy While we obviously cannot support every language, we are open to contributions and suggestions. Please file an issue on GitHub to describe your use case.
{ "source": "yandex/perforator", "title": "docs/en/reference/language-support/overview.md", "url": "https://github.com/yandex/perforator/blob/main/docs/en/reference/language-support/overview.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 3991 }
JSON writer with no external dependencies, producing output where HTML special characters are always escaped. Use it like this: #include <library/cpp/json/writer/json.h> ... NJsonWriter::TBuf json; json.BeginList() .WriteString("<script>") .EndList(); Cout << json.Str(); // output: ["\u003Cscript\u003E"] For compatibility with legacy formats where object keys are not quoted, use CompatWriteKeyWithoutQuotes: NJsonWriter::TBuf json; json.BeginObject() .CompatWriteKeyWithoutQuotes("r").WriteInt(1) .CompatWriteKeyWithoutQuotes("n").WriteInt(0) .EndObject(); Cout << json.Str(); // output: {r:1,n:0}
{ "source": "yandex/perforator", "title": "library/cpp/json/writer/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/json/writer/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 677 }
Эта библиотека содержит две раплизации InitContext для TLogBackendCreator. TLogBackendCreatorInitContextYConf работает с YandexConfig (library/cpp/yconf). TLogBackendCreatorInitContextConfig работает с NConfig::TConfig (library/cpp/config).
{ "source": "yandex/perforator", "title": "library/cpp/logger/init_context/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/logger/init_context/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 242 }
----------- YourBenchmarkName --------------- samples: 403 iterations: 100576 iterations hr: 101K run time: 5.016924443 per iteration: 119265.0829 (119K) cycles samples – сколько раз была вызвана функция с бенчмарком iterations – сколько всего итераций было сделано. при каждом вызове функции бенчмарка может быть разное кол-во итераций run time – скольку времени исполнялся бенчмарк per iteration – сколько времени (процессорных тактов) ушло на одну итерацию, в идеале это то сколько работает функция для которой ты написал бенчмарк
{ "source": "yandex/perforator", "title": "library/cpp/testing/benchmark/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/testing/benchmark/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 556 }
# Gtest support in Arcadia Gtest wrapper that reports results exactly how Arcadia CI wants it. How to use: - use `GTEST` in your `ya.make`; - include `gtest.h` from this library. Don't include `<gtest/gtest.h>` and `<gmock/gmock.h>` directly because then you'll not get our extensions, including pretty printers for util types; - write tests and enjoy.
{ "source": "yandex/perforator", "title": "library/cpp/testing/gtest/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/testing/gtest/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 355 }
# Extensions for Gtest and Gmock Extensions that enable better support of util types in gtest and gmock: pretty printers, matchers, some convenience macros. If you're using `GTEST`, include `library/cpp/testing/gtest/gtest.h` and it will automatically enable these extensions. This is the preferred way to include gtest and gmock as opposed to including gtest, gmock and extensions directly. It eliminates chances of forgetting to include extensions.
{ "source": "yandex/perforator", "title": "library/cpp/testing/gtest_extensions/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/testing/gtest_extensions/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 452 }
# Glue for `GTEST` macro Provides `main` function. This library is automatically linked into any test binary that uses `GTEST`. This way, you don't have to implement `main` yourself every time you write a test target.
{ "source": "yandex/perforator", "title": "library/cpp/testing/gtest_main/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/testing/gtest_main/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 218 }
# Hook for google benchmark and gtest Y_TEST_HOOK_BEFORE_INIT - вызывается перед инициализацией соответствующего фреймворка Y_TEST_HOOK_BEFORE_RUN - вызывается перед запуском тестов Y_TEST_HOOK_AFTER_RUN - вызывается всегда после завершения выполнения тестов, если этап инициализации был успешным ## Примеры: ``` Y_TEST_HOOK_BEFORE_INIT(SetupMyApp) { // ваш код для выполнения перед инициализацией фреймворка } Y_TEST_HOOK_BEFORE_RUN(InitMyApp) { // ваш код для выполнения перед запуском тестов } Y_TEST_HOOK_AFTER_RUN(CleanMyApp) { // ваш код для выполнения после завершения тестов } ``` ## Тесты: тесты лаунчерах соотвествующих фреймворков (gtest, gbenchmark и unittest)
{ "source": "yandex/perforator", "title": "library/cpp/testing/hook/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/testing/hook/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 757 }
See: https://docs.yandex-team.ru/arcadia-cpp/cookbook/concurrency
{ "source": "yandex/perforator", "title": "library/cpp/threading/future/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/threading/future/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 65 }
# [library/cpp/yt/string] ## Structure This library provides ways of printing data structures as well as some helpers methods to work with strings. ### `TStringBuilder` [library/cpp/yt/string/string_builder.h] String formatter with dynamic buffer which supports strings, chars and arbitrary Format expressions (see below). ```cpp TString HelloWorld() { TStringBuilder builder; builder.AppendString("Hello,"); // <- Dynamic allocation of max(minSize, str.len()) bytes. builder.AppendChar(' '); builder.AppendFormat("World %v!", 42); // See Format section below return builder.Flush(); // Hello, World 42! } ``` ### `TRawFormatter` [library/cpp/yt/string/raw_formatter.h] String formatter with static buffer which is stored on stack frame. Supports strings, chars, numbers and guids. ```cpp TString HelloWorld(TGuid guid) // guid = "1-2-3-4" { TRawFormatter<42> builder; // <- Buffer size is set right away. Never allocates. builder.AppendString("Hello"); builder.AppendChar(' '); builder.AppendString("World "); builder.AppendGuid(guid); builder.AppendChar(' '); builder.AppendNumber(42); builder.AppendChar('!'); return TString(builder.GetBuffer()); // Hello World 1-2-3-4 42! } ``` Attempt to append string which results in buffer overflow truncates the string ```cpp TString LongMessage() { TRawFormatter<7> builder; builder.AppendString("Hello World!"); return TString(builder.GetBuffer()); // Hello W } ``` ### `Format` [library/cpp/yt/string/format.h] Universal way of generating strings in a fashion similar to `printf` with flags support. ```cpp Format("Hello, World %d!", 42); // Hello, World 42! ``` Currently all std flags are supported via fallback to `printf` (Note: this is subject to change. We might remove support of the majority of flags in the future to reduce complexity on the user side). We additionally support "Universal" conversion specifier -- "v" which prints value in a certain default way. ```cpp Format("Hello, World %v!", 42); // Hello, World 42! Format("Value is %v", "MyValue"); // Value is MyValue Format("Vector is %v", std::vector{1, 2, 3}); // Vector is [1, 2, 3] ``` "l" specifier can be applied to enums and bools to emit them as their lowercase versions: ```cpp DEFINE_ENUM(EMyEnum, ((MyValue1) (42)) ((AnotherValue) (41)) ); Format("%v", true); // True Format("%v", EMyEnum::MyValue1); // MyValue1 Format("%lv", true); // true Format("%lv", EMyEnum::MyValue); // my_value1 ``` "q" and "Q" specifiers wrap output into quotations marks ' and " respectively. If the same quotation marks are detected inside the formattable value, they are replaced by their "\\"-version: ```cpp Format("%Qv", true); // "True" Format("%qv", true); // 'true' Format("%Qv", "\"Hello World\""); // "\"Hello World\"" // std::array{"MyValue1", "AnotherValue"} auto names = TEnumTraits<EMyEnum>::GetDomainNames(); Format("%Qv", names); // "[\"MyValue1\", \"AnotherValue\"]" ``` `FormatterWrapper` allows conditional writes into the string: ```cpp NYT::Format( "Value is %v%v", 42, MakeFormatterWrapper([&] (auto* builder) { If (PossiblyMissingInfo_) { builder->AppendString(", PossiblyMissingInfo: "); FormatValue(builder, PossiblyMissingInfo_, "v"); } })); ``` `FormatVector` allows treating range of values as a generator coroutine returning values for each placeholder: ```cpp FormatVector("One: %v, Two: %v, Three: %v", {1, 2, 3}) // One: 1, Two: 2, Three: 3 ``` ### Customising Format By default type is not Formattable: ```cpp struct TMyStruct { }; static_assert(!CFormattable<TMyStruct>); Format("%v", TMyStruct{}); // <- Results in CE ``` Compiler error looks like this: ```cpp ROOT/library/cpp/yt/string/unittests/format_ut.cpp:46:36: error: call to consteval function 'NYT::TBasicStaticFormat<NYT::(anonymous namespace)::TMyStruct>::TBasicStaticFormat<char[3]>' is not a constant expression [[maybe_unused]] auto val = Format("%v", TMyStruct{}); ^ ROOT/library/cpp/yt/string/format_string-inl.h:38:17: note: non-constexpr function 'CrashCompilerClassIsNotFormattable<NYT::(anonymous namespace)::TMyStruct>' cannot be used in a constant expression CrashCompilerClassIsNotFormattable<std::tuple_element_t<Idx, TTuple>>(); ^ ROOT/library/cpp/yt/string/format_string-inl.h:36:10: note: in call to '&[] { if (!CFormattable<std::tuple_element_t<0UL, TTuple>>) { CrashCompilerClassIsNotFormattable<std::tuple_element_t<0UL, TTuple>>(); } }->operator()()' ... ``` First line contains the source location where the error occured. Second line contains the function name `CrashCompilerClassIsNotFormattable<NYT::(anonymous namespace)::TMyStruct>` which name is the error and template argument is the errorneos type. There are some more lines which would contain incomprehensible garbage --- don't bother reading it. Other compiler errors generated by static analyser (see below) follow the same structure. In order to support printing custom type, one must create an overload of `FormatValue` function. If everything is done correctly, concept `CFormattable<T>` should be satisfied and the value printed accordingly. ```cpp struct TMyStruct { }; void FormatValue(TStringBuilderBase* builder, const TMyStruct& /*val*/, TStringBuf /*spec*/) { builder->AppendString(TStringBuf("TMyStruct")); } static_assert(CFormattable<TMyStruct>); Format("%v", TMyStruct{}); // "TMyStruct" ``` First argument is already known builder (technically, the part of builder which can be written into, but not flushed). Second argument is the value to be formatted and the `spec` is the set of flags to be applied during the formatting. Spec must not be empty or contain the introductory symbol '%'! ```cpp struct TMyPair { int Key; TString Value; }; void FormatValue(TStringBuilderBase* builder, const TMyPair& pair, TStringBuf spec) { // We shall support an extra flag -- 'k' which forces pair to be printed differently bool concat = false; for (auto c : spec) { concat |= (c == 'k'); } if (concat) { builder->AppendFormat("%v_%v", Key, Value); } else { builder->AppendFormat("{%v: %v}", Key, Value); } }; // Required for static analysis (see section below) // If you don't add extra specifiers you can ignore this part. template <> struct NYT::TFormatArg<TMyPair> : public NYT::TFormatArgBase { static constexpr auto ConversionSpecifiers = TFormatArgBase::ConversionSpecifiers; static constexpr auto FlagSpecifiers = TFormatArgBase::ExtendConversion</*Hot*/ true, 1, std::array{'k'}>(); }; Format("%v", TMyPair{42, "Hello"}); // spec is "v" // output is {42: Hello} Format("%kv", TMyPair{42, "Hello"}); // spec is "kv" // output is 42_Hello ``` `TRuntimeFormat` is required if you want to use a non-constexpr value as a format string: ```cpp cosntexpr TStringBuf fmtGood1 = "Hello, %v"; const char* fmtBad = "Hello, %v"; TRuntimeFormat fmtGood2{fmtBad}; Format(fmtGood1, "World!"); // Hello, World Format(fmdBad, "World!"); // CE --- call to consteval function is not constexpr Format(fmtGood2, "World!"); // Hello, World ``` ### Static analysis (since clang-16) If format string can bind to `TFormatString` (that is, it is a constexpr string_view or a literal) then static analysis on supplied args is performed. #### How to disable Per-file: `#define YT_DISABLE_FORMAT_STATIC_ANALYSIS` (see [library/cpp/yt/string/format_string.h] for up to date macro name). #### What is checked Static analyser checks if the number of specifier sequences matches the number of arguments supplied. Validity of specifier sequences if checked per argument (that specifier sequence is either "%%" or starts with "%", ends with one of the conversion specifiers and contains only the flag specifiers in the middle). Lists of conversion specifiers and flags specifiers are customisation points (see [library/cpp/yt/string/format_arg.h]). #### Customising static analysis We have already seen that `TMyPair` additionally required specialization of `TFormatArg` struct in order to work. Unless you want to change the list of allowed specifiers, default definition of `TFormatArg<T>` will be sufficient. We want to add an extra flag specifier for `TMyPair` and thus we must specialize `NYT::TFormatArg<TMyPair>`: ```cpp template <> struct NYT::TFormatArg<TMyPair> : public NYT::TFormatArgBase // Contains default sets of specifiers and some convenience tools for customization. { // Technically not required as it is present in base. Here written for exposition. static constexpr auto ConversionSpecifiers = TFormatArgBase::ConversionSpecifiers; // Adds 'k' flag to the list of default specifiers // 'Hot' means that we prepend specifier since we expect // it to be used frequently. This speeds up the compilation a little. static constexpr auto FlagSpecifiers = TFormatArgBase::ExtendConversion</*Hot*/ true, 1, std::array{'k'}>(); }; ``` Now we are able to print the value as format analyser is aware of the new flag 'k'. If we wanted to, we could remove the rest of the default specifiers provided by `TFormatArgBase`, since most of them might not make any sence for your type. You can use `TFormatArg` + `FormatValue` to fully support format decorators: ```cpp template <class T> struct TDecorator { T Value; }; template <class T> struct NYT::TFormatArg<TDecorator<T>> : public NYT::TFormatArgBase { static constexpr auto ConversionSpecifiers = TFormatArg<T>::ConversionSpecifiers; static constexpr auto FlagSpecifiers = TFormatArgBase::ExtendConversion</*Hot*/ true, 1, std::array{'D'}, /*TFrom*/ T>::ExtendConversion(); }; template <class T> void FormatValue(NYT::TStringBuilderBase* builder, const TDecorator<T>& value, TStringBuf spec) { bool append = (spec[0] == 'D'); if (append) { builder->AppendString("TDecorator value: "); FormatValue(builder, value.Value, TStringBuf(&spec[1], spec.size() - 1)); return; } FormatValue(builder, value.Value, spec); } Format("Testing: %v", TDecorator{TMyPair{42, "Hello"}}); // Testing: {42, Hello} Format("Testing: %Dv", TDecorator{TMyPair{42, "Hello"}}); // Testing: TDecorator value: {42, Hello} Format("Testing: %Dkv", TDecorator{TMyPair{42, "Hello"}}); // Testing: TDecorator value: 42_Hello ``` ### ToString auto generation For names inside namespaces enclosing `NYT` and `std` we automatically generate overload of `ToString` which uses `FormatValue` function if there is such a function. In examples below we assume that `CFormattable` holds true for each type: ```cpp auto val = ToString(NYT::TMyPair{42, "Hello"}}); // Works since TMyPair comes from namespace NYT; auto val = ToString(std::optional{NYT::TMyPair{42, "Hello"}}}); // Works since optional comes from namespace std auto val = ToString(NYT::NOrm::::NClient::NObjects::TObjectKey{}); // Works since NOrm::::NClient::NObjects enclose namespace NYT auto val = ToString(NMyNs::TMyType{}); // Falls back to util ToString because NMyNs encloses neither std nor NYT. Fate is unknown. auto val = ToString(NMyNS::TMyContainer<NYT::TMyPair>{}); // Falls back to util ToString because NMyNs encloses neither std nor NYT (we don't care about template parameters). Fate is unknown. auto val = NYT::ToString(NMyNs::TMyType{}); // Works. auto val = NYT::ToString(NMyNS::TMyContainer<NYT::TMyPair>{}); // Also works. { using ::ToString; // Irrelevant since NYT::ToString is more constrained. using NYT::ToString; auto val = ToString(NMyNS::TMyContainer<NYT::TMyPair>{}); // Also works. } ``` ### Implementing `FormatValue` via `ToString` One thing you may attempt to do is to use already defined `ToString` method to implement `FormatValue`. There are two cases for this: 1. You have an overload of `ToString` visible from the inside of `FormatValue` which is not the util default overload. In this case you are fine. 2. You rely on util `ToString` overload. In this case you hit an infinite recursion loop if name of your type comes from `std` or `NYT` namespaces. We strongly recommend that you stop relying on util `ToString` and simply write `FormatValue` from scratch. Should this be impossible, use `NYT::ToStringIgnoringFormatValue(const T&)` which implements default `ToString` mechanism (via `operator <<`) from util. This method has a different name hence it will break the recursion loop. ### Format extensions. There are some types from util and other cpp libraries which one might want to print, but we don't need them in the yt project (allegedly). Some of these dependencies are located in [library/cpp/yt/string/format_extensions]. If you don't care about granularity, simply include "library/cpp/yt/string/format_extensions/all.h" to enable support for every currently known dependency.
{ "source": "yandex/perforator", "title": "library/cpp/yt/string/readme.md", "url": "https://github.com/yandex/perforator/blob/main/library/cpp/yt/string/readme.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 12981 }
# xerrors Drop-in replacement для `errors` и `golang.org/x/xerrors`, а так же функционально для `github.com/pkg/errors`. ### Локальный запуск тестов со стандартным тулчейном Так как тесты используют фреймы стэка, необходимо тримить абсолютные пути записываемые в бинарник теста. Для этого необходимо использовать аргумент `trimpath` - `go test -v -race -gcflags=-trimpath=<absolute_path_to_arcadia_mount>`. В противном случае ваши абсолютные пути будут пролезать во фреймы и тесты будут фейлиться.
{ "source": "yandex/perforator", "title": "library/go/core/xerrors/README.md", "url": "https://github.com/yandex/perforator/blob/main/library/go/core/xerrors/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 499 }
Official Helm chart. See https://perforator.tech/docs/en/guides/helm-chart for details.
{ "source": "yandex/perforator", "title": "perforator/deploy/kubernetes/helm/README.md", "url": "https://github.com/yandex/perforator/blob/main/perforator/deploy/kubernetes/helm/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 87 }
<!-- IMPORTANT: read this when updating release notes. Here is the format used: ``` # Version/Unreleased Fixes: + Description (PR or commit[1]) Enhancements: + Description (PR or commit) Internal changes: + Description (PR or commit) ``` 1: If you are sending patch to GitHub, specify PR. Otherwise (if you are sending patch to internal monorepo), leave unset and then specify Git commit. --> # 0.2.7 Fixes: + Fix perforator chart not properly importing perforator-dev dependency. # 0.2.6 Enhancements: + Add perforator-dev subchart, that allows to deploy postgresql, clickhouse, minio databases (78ff60b) + Allow enabling/disabling certain perforator microservices (#36) + Allow to deploy extra objects (#36) + Upgrade perforator to [v0.0.4](https://github.com/yandex/perforator/releases/tag/v0.0.4) Fixes: + Fix storage service declaration (#36) + Fix priority class setting placement (#36) + Fix password secretes were deployed after the migration jobs, which in some cases caused chart installation failure (972f4a1) # 0.2.5 Enhancements: + Allow customizing environment variables for all components (a9e002e) + Upgrade perforator to [v0.0.3](https://github.com/yandex/perforator/releases/tag/v0.0.3) (21e0f8a) # 0.2.4 Fixes: + Fix mount extra volumes (#30) (#30) Enhancements: + Add default images for all components (677ca2b) + (experimental) Add support for automated migrations (see `.databases.{postgresql,clickhouse}.migrations` for details) (1d38dff) Internal changes: + Change auto-generated CA subject (75f12f2) # 0.2.3 Fixes: + Fix CA certificate recreating on helm upgrade (6b9207e) Enhancements: + Support custom CA for agent-storage communication (6b9207e) # 0.2.2 Enhancements: + Support custom CA for ClickHouse, PostgresSQL and object storage (#25) # 0.2.1 Fixes: + Fix dnsPolicy overrides (#16) + Fix duplicated spec.tls in ingresses (#17) # 0.2.0 Fixes: + Use prefix match for ingresses (e492fd8) Enhancements: + Always recreate pods on helm upgrade (4ccce88) # 0.1.0 Initial release
{ "source": "yandex/perforator", "title": "perforator/deploy/kubernetes/helm/releases.md", "url": "https://github.com/yandex/perforator/blob/main/perforator/deploy/kubernetes/helm/releases.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2037 }
# Changelog ## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.2...auth/v0.3.0) (2024-04-23) ### Features * **auth/httptransport:** Add ability to customize transport ([#10023](https://github.com/googleapis/google-cloud-go/issues/10023)) ([72c7f6b](https://github.com/googleapis/google-cloud-go/commit/72c7f6bbec3136cc7a62788fc7186bc33ef6c3b3)), refs [#9812](https://github.com/googleapis/google-cloud-go/issues/9812) [#9814](https://github.com/googleapis/google-cloud-go/issues/9814) ### Bug Fixes * **auth/credentials:** Error on bad file name if explicitly set ([#10018](https://github.com/googleapis/google-cloud-go/issues/10018)) ([55beaa9](https://github.com/googleapis/google-cloud-go/commit/55beaa993aaf052d8be39766afc6777c3c2a0bdd)), refs [#9809](https://github.com/googleapis/google-cloud-go/issues/9809) ## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.1...auth/v0.2.2) (2024-04-19) ### Bug Fixes * **auth:** Add internal opt to skip validation on transports ([#9999](https://github.com/googleapis/google-cloud-go/issues/9999)) ([9e20ef8](https://github.com/googleapis/google-cloud-go/commit/9e20ef89f6287d6bd03b8697d5898dc43b4a77cf)), refs [#9823](https://github.com/googleapis/google-cloud-go/issues/9823) * **auth:** Set secure flag for gRPC conn pools ([#10002](https://github.com/googleapis/google-cloud-go/issues/10002)) ([14e3956](https://github.com/googleapis/google-cloud-go/commit/14e3956dfd736399731b5ee8d9b178ae085cf7ba)), refs [#9833](https://github.com/googleapis/google-cloud-go/issues/9833) ## [0.2.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.0...auth/v0.2.1) (2024-04-18) ### Bug Fixes * **auth:** Default gRPC token type to Bearer if not set ([#9800](https://github.com/googleapis/google-cloud-go/issues/9800)) ([5284066](https://github.com/googleapis/google-cloud-go/commit/5284066670b6fe65d79089cfe0199c9660f87fc7)) ## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.1...auth/v0.2.0) (2024-04-15) ### Breaking Changes In the below mentioned commits there were a few large breaking changes since the last release of the module. 1. The `Credentials` type has been moved to the root of the module as it is becoming the core abstraction for the whole module. 2. Because of the above mentioned change many functions that previously returned a `TokenProvider` now return `Credentials`. Similarly, these functions have been renamed to be more specific. 3. Most places that used to take an optional `TokenProvider` now accept `Credentials`. You can make a `Credentials` from a `TokenProvider` using the constructor found in the `auth` package. 4. The `detect` package has been renamed to `credentials`. With this change some function signatures were also updated for better readability. 5. Derivative auth flows like `impersonate` and `downscope` have been moved to be under the new `credentials` package. Although these changes are disruptive we think that they are for the best of the long-term health of the module. We do not expect any more large breaking changes like these in future revisions, even before 1.0.0. This version will be the first version of the auth library that our client libraries start to use and depend on. ### Features * **auth/credentials/externalaccount:** Add default TokenURL ([#9700](https://github.com/googleapis/google-cloud-go/issues/9700)) ([81830e6](https://github.com/googleapis/google-cloud-go/commit/81830e6848ceefd055aa4d08f933d1154455a0f6)) * **auth:** Add downscope.Options.UniverseDomain ([#9634](https://github.com/googleapis/google-cloud-go/issues/9634)) ([52cf7d7](https://github.com/googleapis/google-cloud-go/commit/52cf7d780853594291c4e34302d618299d1f5a1d)) * **auth:** Add universe domain to grpctransport and httptransport ([#9663](https://github.com/googleapis/google-cloud-go/issues/9663)) ([67d353b](https://github.com/googleapis/google-cloud-go/commit/67d353beefe3b607c08c891876fbd95ab89e5fe3)), refs [#9670](https://github.com/googleapis/google-cloud-go/issues/9670) * **auth:** Add UniverseDomain to DetectOptions ([#9536](https://github.com/googleapis/google-cloud-go/issues/9536)) ([3618d3f](https://github.com/googleapis/google-cloud-go/commit/3618d3f7061615c0e189f376c75abc201203b501)) * **auth:** Make package externalaccount public ([#9633](https://github.com/googleapis/google-cloud-go/issues/9633)) ([a0978d8](https://github.com/googleapis/google-cloud-go/commit/a0978d8e96968399940ebd7d092539772bf9caac)) * **auth:** Move credentials to base auth package ([#9590](https://github.com/googleapis/google-cloud-go/issues/9590)) ([1a04baf](https://github.com/googleapis/google-cloud-go/commit/1a04bafa83c27342b9308d785645e1e5423ea10d)) * **auth:** Refactor public sigs to use Credentials ([#9603](https://github.com/googleapis/google-cloud-go/issues/9603)) ([69cb240](https://github.com/googleapis/google-cloud-go/commit/69cb240c530b1f7173a9af2555c19e9a1beb56c5)) ### Bug Fixes * **auth/oauth2adapt:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) * **auth:** Fix uint32 conversion ([9221c7f](https://github.com/googleapis/google-cloud-go/commit/9221c7fa12cef9d5fb7ddc92f41f1d6204971c7b)) * **auth:** Port sts expires fix ([#9618](https://github.com/googleapis/google-cloud-go/issues/9618)) ([7bec97b](https://github.com/googleapis/google-cloud-go/commit/7bec97b2f51ed3ac4f9b88bf100d301da3f5d1bd)) * **auth:** Read universe_domain from all credentials files ([#9632](https://github.com/googleapis/google-cloud-go/issues/9632)) ([16efbb5](https://github.com/googleapis/google-cloud-go/commit/16efbb52e39ea4a319e5ee1e95c0e0305b6d9824)) * **auth:** Remove content-type header from idms get requests ([#9508](https://github.com/googleapis/google-cloud-go/issues/9508)) ([8589f41](https://github.com/googleapis/google-cloud-go/commit/8589f41599d265d7c3d46a3d86c9fab2329cbdd9)) * **auth:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) ## [0.1.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.0...auth/v0.1.1) (2024-03-10) ### Bug Fixes * **auth/impersonate:** Properly send default detect params ([#9529](https://github.com/googleapis/google-cloud-go/issues/9529)) ([5b6b8be](https://github.com/googleapis/google-cloud-go/commit/5b6b8bef577f82707e51f5cc5d258d5bdf90218f)), refs [#9136](https://github.com/googleapis/google-cloud-go/issues/9136) * **auth:** Update grpc-go to v1.56.3 ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c)) * **auth:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) ## 0.1.0 (2023-10-18) ### Features * **auth:** Add base auth package ([#8465](https://github.com/googleapis/google-cloud-go/issues/8465)) ([6a45f26](https://github.com/googleapis/google-cloud-go/commit/6a45f26b809b64edae21f312c18d4205f96b180e)) * **auth:** Add cert support to httptransport ([#8569](https://github.com/googleapis/google-cloud-go/issues/8569)) ([37e3435](https://github.com/googleapis/google-cloud-go/commit/37e3435f8e98595eafab481bdfcb31a4c56fa993)) * **auth:** Add Credentials.UniverseDomain() ([#8654](https://github.com/googleapis/google-cloud-go/issues/8654)) ([af0aa1e](https://github.com/googleapis/google-cloud-go/commit/af0aa1ed8015bc8fe0dd87a7549ae029107cbdb8)) * **auth:** Add detect package ([#8491](https://github.com/googleapis/google-cloud-go/issues/8491)) ([d977419](https://github.com/googleapis/google-cloud-go/commit/d977419a3269f6acc193df77a2136a6eb4b4add7)) * **auth:** Add downscope package ([#8532](https://github.com/googleapis/google-cloud-go/issues/8532)) ([dda9bff](https://github.com/googleapis/google-cloud-go/commit/dda9bff8ec70e6d104901b4105d13dcaa4e2404c)) * **auth:** Add grpctransport package ([#8625](https://github.com/googleapis/google-cloud-go/issues/8625)) ([69a8347](https://github.com/googleapis/google-cloud-go/commit/69a83470bdcc7ed10c6c36d1abc3b7cfdb8a0ee5)) * **auth:** Add httptransport package ([#8567](https://github.com/googleapis/google-cloud-go/issues/8567)) ([6898597](https://github.com/googleapis/google-cloud-go/commit/6898597d2ea95d630fcd00fd15c58c75ea843bff)) * **auth:** Add idtoken package ([#8580](https://github.com/googleapis/google-cloud-go/issues/8580)) ([a79e693](https://github.com/googleapis/google-cloud-go/commit/a79e693e97e4e3e1c6742099af3dbc58866d88fe)) * **auth:** Add impersonate package ([#8578](https://github.com/googleapis/google-cloud-go/issues/8578)) ([e29ba0c](https://github.com/googleapis/google-cloud-go/commit/e29ba0cb7bd3888ab9e808087027dc5a32474c04)) * **auth:** Add support for external accounts in detect ([#8508](https://github.com/googleapis/google-cloud-go/issues/8508)) ([62210d5](https://github.com/googleapis/google-cloud-go/commit/62210d5d3e56e8e9f35db8e6ac0defec19582507)) * **auth:** Port external account changes ([#8697](https://github.com/googleapis/google-cloud-go/issues/8697)) ([5823db5](https://github.com/googleapis/google-cloud-go/commit/5823db5d633069999b58b9131a7f9cd77e82c899)) ### Bug Fixes * **auth/oauth2adapt:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) * **auth:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d))
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/auth/CHANGES.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/auth/CHANGES.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 9606 }
# auth This module is currently EXPERIMENTAL and under active development. It is not yet intended to be used.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/auth/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/auth/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 110 }
# Changes ## [1.1.7](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.6...iam/v1.1.7) (2024-03-14) ### Bug Fixes * **iam:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) ## [1.1.6](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.5...iam/v1.1.6) (2024-01-30) ### Bug Fixes * **iam:** Enable universe domain resolution options ([fd1d569](https://github.com/googleapis/google-cloud-go/commit/fd1d56930fa8a747be35a224611f4797b8aeb698)) ## [1.1.5](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.4...iam/v1.1.5) (2023-11-01) ### Bug Fixes * **iam:** Bump google.golang.org/api to v0.149.0 ([8d2ab9f](https://github.com/googleapis/google-cloud-go/commit/8d2ab9f320a86c1c0fab90513fc05861561d0880)) ## [1.1.4](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.3...iam/v1.1.4) (2023-10-26) ### Bug Fixes * **iam:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) ## [1.1.3](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.2...iam/v1.1.3) (2023-10-12) ### Bug Fixes * **iam:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) ## [1.1.2](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.1...iam/v1.1.2) (2023-08-08) ### Documentation * **iam:** Minor formatting ([b4349cc](https://github.com/googleapis/google-cloud-go/commit/b4349cc507870ff8629bbc07de578b63bb889626)) ## [1.1.1](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.0...iam/v1.1.1) (2023-06-20) ### Bug Fixes * **iam:** REST query UpdateMask bug ([df52820](https://github.com/googleapis/google-cloud-go/commit/df52820b0e7721954809a8aa8700b93c5662dc9b)) ## [1.1.0](https://github.com/googleapis/google-cloud-go/compare/iam/v1.0.1...iam/v1.1.0) (2023-05-30) ### Features * **iam:** Update all direct dependencies ([b340d03](https://github.com/googleapis/google-cloud-go/commit/b340d030f2b52a4ce48846ce63984b28583abde6)) ## [1.0.1](https://github.com/googleapis/google-cloud-go/compare/iam/v1.0.0...iam/v1.0.1) (2023-05-08) ### Bug Fixes * **iam:** Update grpc to v1.55.0 ([1147ce0](https://github.com/googleapis/google-cloud-go/commit/1147ce02a990276ca4f8ab7a1ab65c14da4450ef)) ## [1.0.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.13.0...iam/v1.0.0) (2023-04-04) ### Features * **iam:** Promote to GA ([#7627](https://github.com/googleapis/google-cloud-go/issues/7627)) ([b351906](https://github.com/googleapis/google-cloud-go/commit/b351906a10e17a02d7f7e2551bc1585fd9dc3742)) ## [0.13.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.12.0...iam/v0.13.0) (2023-03-15) ### Features * **iam:** Update iam and longrunning deps ([91a1f78](https://github.com/googleapis/google-cloud-go/commit/91a1f784a109da70f63b96414bba8a9b4254cddd)) ## [0.12.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.11.0...iam/v0.12.0) (2023-02-17) ### Features * **iam:** Migrate to new stubs ([a61ddcd](https://github.com/googleapis/google-cloud-go/commit/a61ddcd3041c7af4a15109dc4431f9b327c497fb)) ## [0.11.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.10.0...iam/v0.11.0) (2023-02-16) ### Features * **iam:** Start generating proto stubs ([970d763](https://github.com/googleapis/google-cloud-go/commit/970d763531b54b2bc75d7ff26a20b6e05150cab8)) ## [0.10.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.9.0...iam/v0.10.0) (2023-01-04) ### Features * **iam:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0)) ## [0.9.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.8.0...iam/v0.9.0) (2022-12-15) ### Features * **iam:** Rewrite iam sigs and update proto import ([#7137](https://github.com/googleapis/google-cloud-go/issues/7137)) ([ad67fa3](https://github.com/googleapis/google-cloud-go/commit/ad67fa36c263c161226f7fecbab5221592374dca)) ## [0.8.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.7.0...iam/v0.8.0) (2022-12-05) ### Features * **iam:** Start generating and refresh some libraries ([#7089](https://github.com/googleapis/google-cloud-go/issues/7089)) ([a9045ff](https://github.com/googleapis/google-cloud-go/commit/a9045ff191a711089c37f1d94a63522d9939ce38)) ## [0.7.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.6.0...iam/v0.7.0) (2022-11-03) ### Features * **iam:** rewrite signatures in terms of new location ([3c4b2b3](https://github.com/googleapis/google-cloud-go/commit/3c4b2b34565795537aac1661e6af2442437e34ad)) ## [0.6.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.5.0...iam/v0.6.0) (2022-10-25) ### Features * **iam:** start generating stubs dir ([de2d180](https://github.com/googleapis/google-cloud-go/commit/de2d18066dc613b72f6f8db93ca60146dabcfdcc)) ## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.4.0...iam/v0.5.0) (2022-09-28) ### Features * **iam:** remove ListApplicablePolicies ([52dddd1](https://github.com/googleapis/google-cloud-go/commit/52dddd1ed89fbe77e1859311c3b993a77a82bfc7)) ## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.3.0...iam/v0.4.0) (2022-09-06) ### Features * **iam:** start generating apiv2 ([#6605](https://github.com/googleapis/google-cloud-go/issues/6605)) ([a6004e7](https://github.com/googleapis/google-cloud-go/commit/a6004e762f782869cd85688937475744f7b17e50)) ## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.2.0...iam/v0.3.0) (2022-02-23) ### Features * **iam:** set versionClient to module version ([55f0d92](https://github.com/googleapis/google-cloud-go/commit/55f0d92bf112f14b024b4ab0076c9875a17423c9)) ## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.1.1...iam/v0.2.0) (2022-02-14) ### Features * **iam:** add file for tracking version ([17b36ea](https://github.com/googleapis/google-cloud-go/commit/17b36ead42a96b1a01105122074e65164357519e)) ### [0.1.1](https://www.github.com/googleapis/google-cloud-go/compare/iam/v0.1.0...iam/v0.1.1) (2022-01-14) ### Bug Fixes * **iam:** run formatter ([#5277](https://www.github.com/googleapis/google-cloud-go/issues/5277)) ([8682e4e](https://www.github.com/googleapis/google-cloud-go/commit/8682e4ed57a4428a659fbc225f56c91767e2a4a9)) ## v0.1.0 This is the first tag to carve out iam as its own module. See [Add a module to a multi-module repository](https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository).
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/iam/CHANGES.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/iam/CHANGES.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 6760 }
# IAM API [![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/iam.svg)](https://pkg.go.dev/cloud.google.com/go/iam) Go Client Library for IAM API. ## Install ```bash go get cloud.google.com/go/iam ``` ## Stability The stability of this module is indicated by SemVer. However, a `v1+` module may have breaking changes in two scenarios: * Packages with `alpha` or `beta` in the import path * The GoDoc has an explicit stability disclaimer (for example, for an experimental feature). ## Go Version Support See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported) section in the root directory's README. ## Authorization See the [Authorization](https://github.com/googleapis/google-cloud-go#authorization) section in the root directory's README. ## Contributing Contributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md) document for details. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct) for more information.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/iam/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/iam/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1298 }
# Internal This directory contains internal code for cloud.google.com/go packages. ## .repo-metadata-full.json `.repo-metadata-full.json` contains metadata about the packages in this repo. It is generated by `internal/gapicgen/generator`. It's processed by external tools to build lists of all of the packages. Don't make breaking changes to the format without consulting with the external tools. One day, we may want to create individual `.repo-metadata.json` files next to each package, which is the pattern followed by some other languages. External tools would then talk to pkg.go.dev or some other service to get the overall list of packages and use the `.repo-metadata.json` files to get the additional metadata required. For now, `.repo-metadata-full.json` includes everything. ### Updating OwlBot SHA You may want to manually update the which version of the post-processor will be used -- to do this you need to update the SHA in the OwlBot lock file. See the [postprocessor/README](postprocessor/README.md) for detailed instructions. *Note*: OwlBot will eventually open a pull request to update this value if it discovers a new version of the container.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/internal/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/internal/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1171 }
# Changes ## [0.5.6](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.5...longrunning/v0.5.6) (2024-03-14) ### Bug Fixes * **longrunning:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) ## [0.5.5](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.4...longrunning/v0.5.5) (2024-01-30) ### Bug Fixes * **longrunning:** Enable universe domain resolution options ([fd1d569](https://github.com/googleapis/google-cloud-go/commit/fd1d56930fa8a747be35a224611f4797b8aeb698)) ## [0.5.4](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.3...longrunning/v0.5.4) (2023-11-01) ### Bug Fixes * **longrunning:** Bump google.golang.org/api to v0.149.0 ([8d2ab9f](https://github.com/googleapis/google-cloud-go/commit/8d2ab9f320a86c1c0fab90513fc05861561d0880)) ## [0.5.3](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.2...longrunning/v0.5.3) (2023-10-26) ### Bug Fixes * **longrunning:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) ## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.1...longrunning/v0.5.2) (2023-10-12) ### Bug Fixes * **longrunning:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) ## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.5.0...longrunning/v0.5.1) (2023-06-20) ### Bug Fixes * **longrunning:** REST query UpdateMask bug ([df52820](https://github.com/googleapis/google-cloud-go/commit/df52820b0e7721954809a8aa8700b93c5662dc9b)) ## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.4.2...longrunning/v0.5.0) (2023-05-30) ### Features * **longrunning:** Update all direct dependencies ([b340d03](https://github.com/googleapis/google-cloud-go/commit/b340d030f2b52a4ce48846ce63984b28583abde6)) ## [0.4.2](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.4.1...longrunning/v0.4.2) (2023-05-08) ### Bug Fixes * **longrunning:** Update grpc to v1.55.0 ([1147ce0](https://github.com/googleapis/google-cloud-go/commit/1147ce02a990276ca4f8ab7a1ab65c14da4450ef)) ## [0.4.1](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.4.0...longrunning/v0.4.1) (2023-02-14) ### Bug Fixes * **longrunning:** Properly parse errors with apierror ([#7392](https://github.com/googleapis/google-cloud-go/issues/7392)) ([e768e48](https://github.com/googleapis/google-cloud-go/commit/e768e487e10b197ba42a2339014136d066190610)) ## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.3.0...longrunning/v0.4.0) (2023-01-04) ### Features * **longrunning:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0)) ## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/longrunning/v0.2.1...longrunning/v0.3.0) (2022-11-03) ### Features * **longrunning:** rewrite signatures in terms of new location ([3c4b2b3](https://github.com/googleapis/google-cloud-go/commit/3c4b2b34565795537aac1661e6af2442437e34ad)) ## v0.1.0 Initial release.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/longrunning/CHANGES.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/longrunning/CHANGES.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 3346 }
# longrunning [![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/longrunning.svg)](https://pkg.go.dev/cloud.google.com/go/longrunning) A helper library for working with long running operations. ## Install ```bash go get cloud.google.com/go/longrunning ``` ## Go Version Support See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported) section in the root directory's README. ## Contributing Contributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md) document for details. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct) for more information.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/longrunning/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/longrunning/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 926 }
# Changes ## [1.60.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.59.0...spanner/v1.60.0) (2024-03-19) ### Features * **spanner:** Allow attempt direct path xds via env var ([e4b663c](https://github.com/googleapis/google-cloud-go/commit/e4b663cdcb6e010c5a8ac791e5624407aaa191b3)) ## [1.59.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.58.0...spanner/v1.59.0) (2024-03-13) ### Features * **spanner/spansql:** Support Table rename & Table synonym ([#9275](https://github.com/googleapis/google-cloud-go/issues/9275)) ([9b97ce7](https://github.com/googleapis/google-cloud-go/commit/9b97ce75d36980fdaa06f15b0398b7b65e0d6082)) * **spanner:** Add support of float32 type ([#9525](https://github.com/googleapis/google-cloud-go/issues/9525)) ([87d7ea9](https://github.com/googleapis/google-cloud-go/commit/87d7ea97787a56b18506b53e9b26d037f92759ca)) ### Bug Fixes * **spanner:** Add JSON_PARSE_ARRAY to funcNames slice ([#9557](https://github.com/googleapis/google-cloud-go/issues/9557)) ([f799597](https://github.com/googleapis/google-cloud-go/commit/f79959722352ead48bfb3efb3001fddd3a56db65)) ## [1.58.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.57.0...spanner/v1.58.0) (2024-03-06) ### Features * **spanner/admin/instance:** Add instance partition support to spanner instance proto ([ae1f547](https://github.com/googleapis/google-cloud-go/commit/ae1f5472bff1b476c3fd58e590ec135185446daf)) * **spanner:** Add field for multiplexed session in spanner.proto ([a86aa8e](https://github.com/googleapis/google-cloud-go/commit/a86aa8e962b77d152ee6cdd433ad94967150ef21)) * **spanner:** SelectAll struct spanner tag annotation match should be case-insensitive ([#9460](https://github.com/googleapis/google-cloud-go/issues/9460)) ([6cd6a73](https://github.com/googleapis/google-cloud-go/commit/6cd6a73be87a261729d3b6b45f3d28be93c3fdb3)) * **spanner:** Update TransactionOptions to include new option exclude_txn_from_change_streams ([0195fe9](https://github.com/googleapis/google-cloud-go/commit/0195fe9292274ff9d86c71079a8e96ed2e5f9331)) ## [1.57.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.56.0...spanner/v1.57.0) (2024-02-13) ### Features * **spanner:** Add OpenTelemetry implementation ([#9254](https://github.com/googleapis/google-cloud-go/issues/9254)) ([fc51cc2](https://github.com/googleapis/google-cloud-go/commit/fc51cc2ac71e8fb0b3e381379dc343630ed441e7)) * **spanner:** Support max_commit_delay in Spanner transactions ([#9299](https://github.com/googleapis/google-cloud-go/issues/9299)) ([a8078f0](https://github.com/googleapis/google-cloud-go/commit/a8078f0b841281bd439c548db9d303f6b5ce54e6)) ### Bug Fixes * **spanner:** Enable universe domain resolution options ([fd1d569](https://github.com/googleapis/google-cloud-go/commit/fd1d56930fa8a747be35a224611f4797b8aeb698)) * **spanner:** Internal test package should import local version ([#9416](https://github.com/googleapis/google-cloud-go/issues/9416)) ([f377281](https://github.com/googleapis/google-cloud-go/commit/f377281a73553af9a9a2bee2181efe2e354e1c68)) * **spanner:** SelectAll struct fields match should be case-insensitive ([#9417](https://github.com/googleapis/google-cloud-go/issues/9417)) ([7ff5356](https://github.com/googleapis/google-cloud-go/commit/7ff535672b868e6cba54abdf5dd92b9199e4d1d4)) * **spanner:** Support time.Time and other custom types using SelectAll ([#9382](https://github.com/googleapis/google-cloud-go/issues/9382)) ([dc21234](https://github.com/googleapis/google-cloud-go/commit/dc21234268b08a4a21b2b3a1ed9ed74d65a289f0)) ### Documentation * **spanner:** Update the comment regarding eligible SQL shapes for PartitionQuery ([e60a6ba](https://github.com/googleapis/google-cloud-go/commit/e60a6ba01acf2ef2e8d12e23ed5c6e876edeb1b7)) ## [1.56.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.55.0...spanner/v1.56.0) (2024-01-30) ### Features * **spanner/admin/database:** Add proto descriptors for proto and enum types in create/update/get database ddl requests ([97d62c7](https://github.com/googleapis/google-cloud-go/commit/97d62c7a6a305c47670ea9c147edc444f4bf8620)) * **spanner/spansql:** Add support for CREATE VIEW with SQL SECURITY DEFINER ([#8754](https://github.com/googleapis/google-cloud-go/issues/8754)) ([5f156e8](https://github.com/googleapis/google-cloud-go/commit/5f156e8c88f4729f569ee5b4ac9378dda3907997)) * **spanner:** Add FLOAT32 enum to TypeCode ([97d62c7](https://github.com/googleapis/google-cloud-go/commit/97d62c7a6a305c47670ea9c147edc444f4bf8620)) * **spanner:** Add max_commit_delay API ([af2f8b4](https://github.com/googleapis/google-cloud-go/commit/af2f8b4f3401c0b12dadb2c504aa0f902aee76de)) * **spanner:** Add proto and enum types ([00b9900](https://github.com/googleapis/google-cloud-go/commit/00b990061592a20a181e61faa6964b45205b76a7)) * **spanner:** Add SelectAll method to decode from Spanner iterator.Rows to golang struct ([#9206](https://github.com/googleapis/google-cloud-go/issues/9206)) ([802088f](https://github.com/googleapis/google-cloud-go/commit/802088f1322752bb9ce9bab1315c3fed6b3a99aa)) ## [1.55.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.54.0...spanner/v1.55.0) (2024-01-08) ### Features * **spanner:** Add directed reads feature ([#7668](https://github.com/googleapis/google-cloud-go/issues/7668)) ([a42604a](https://github.com/googleapis/google-cloud-go/commit/a42604a3a6ea90c38a2ff90d036a79fd070174fd)) ## [1.54.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.53.1...spanner/v1.54.0) (2023-12-14) ### Features * **spanner/executor:** Add autoscaling config in the instance to support autoscaling in systests ([29effe6](https://github.com/googleapis/google-cloud-go/commit/29effe600e16f24a127a1422ec04263c4f7a600a)) * **spanner:** New clients ([#9127](https://github.com/googleapis/google-cloud-go/issues/9127)) ([2c97389](https://github.com/googleapis/google-cloud-go/commit/2c97389ddacdfc140a06f74498cc2753bb040a4d)) ### Bug Fixes * **spanner:** Use json.Number for decoding unknown values from spanner ([#9054](https://github.com/googleapis/google-cloud-go/issues/9054)) ([40d1392](https://github.com/googleapis/google-cloud-go/commit/40d139297bd484408c63c9d6ad1d7035d9673c1c)) ## [1.53.1](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.53.0...spanner/v1.53.1) (2023-12-01) ### Bug Fixes * **spanner:** Handle nil error when cleaning up long running session ([#9052](https://github.com/googleapis/google-cloud-go/issues/9052)) ([a93bc26](https://github.com/googleapis/google-cloud-go/commit/a93bc2696bf9ae60aae93af0e8c4911b58514d31)) * **spanner:** MarshalJSON function caused errors for certain values ([#9063](https://github.com/googleapis/google-cloud-go/issues/9063)) ([afe7c98](https://github.com/googleapis/google-cloud-go/commit/afe7c98036c198995075530d4228f1f4ae3f1222)) ## [1.53.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.52.0...spanner/v1.53.0) (2023-11-15) ### Features * **spanner:** Enable long running transaction clean up ([#8969](https://github.com/googleapis/google-cloud-go/issues/8969)) ([5d181bb](https://github.com/googleapis/google-cloud-go/commit/5d181bb3a6fea55b8d9d596213516129006bdae2)) ## [1.52.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.51.0...spanner/v1.52.0) (2023-11-14) ### Features * **spanner:** Add directed_read_option in spanner.proto ([#8950](https://github.com/googleapis/google-cloud-go/issues/8950)) ([24e410e](https://github.com/googleapis/google-cloud-go/commit/24e410efbb6add2d33ecfb6ad98b67dc8894e578)) * **spanner:** Add DML, DQL, Mutation, Txn Actions and Utility methods for executor framework ([#8976](https://github.com/googleapis/google-cloud-go/issues/8976)) ([ca76671](https://github.com/googleapis/google-cloud-go/commit/ca7667194007394bdcade8058fa84c1fe19c06b1)) * **spanner:** Add lastUseTime property to session ([#8942](https://github.com/googleapis/google-cloud-go/issues/8942)) ([b560cfc](https://github.com/googleapis/google-cloud-go/commit/b560cfcf967ff6dec0cd6ac4b13045470945f30b)) * **spanner:** Add method ([#8945](https://github.com/googleapis/google-cloud-go/issues/8945)) ([411a51e](https://github.com/googleapis/google-cloud-go/commit/411a51e320fe21ffe830cdaa6bb4e4d77f7a996b)) * **spanner:** Add methods to return Row fields ([#8953](https://github.com/googleapis/google-cloud-go/issues/8953)) ([e22e70f](https://github.com/googleapis/google-cloud-go/commit/e22e70f44f83aab4f8b89af28fcd24216d2e740e)) * **spanner:** Add PG.OID type cod annotation ([#8749](https://github.com/googleapis/google-cloud-go/issues/8749)) ([ffb0dda](https://github.com/googleapis/google-cloud-go/commit/ffb0ddabf3d9822ba8120cabaf25515fd32e9615)) * **spanner:** Admin, Batch, Partition actions for executor framework ([#8932](https://github.com/googleapis/google-cloud-go/issues/8932)) ([b2db89e](https://github.com/googleapis/google-cloud-go/commit/b2db89e03a125cde31a7ea86eecc3fbb08ebd281)) * **spanner:** Auto-generated executor framework proto changes ([#8713](https://github.com/googleapis/google-cloud-go/issues/8713)) ([2ca939c](https://github.com/googleapis/google-cloud-go/commit/2ca939cba4bc240f2bfca7d5683708fd3a94fd74)) * **spanner:** BatchWrite ([#8652](https://github.com/googleapis/google-cloud-go/issues/8652)) ([507d232](https://github.com/googleapis/google-cloud-go/commit/507d232cdb09bd941ebfe800bdd4bfc020346f5d)) * **spanner:** Executor framework server and worker proxy ([#8714](https://github.com/googleapis/google-cloud-go/issues/8714)) ([6b931ee](https://github.com/googleapis/google-cloud-go/commit/6b931eefb9aa4a18758788167bdcf9e2fad1d7b9)) * **spanner:** Fix falkiness ([#8977](https://github.com/googleapis/google-cloud-go/issues/8977)) ([ca8d3cb](https://github.com/googleapis/google-cloud-go/commit/ca8d3cbf80f7fc2f47beb53b95138040c83097db)) * **spanner:** Long running transaction clean up - disabled ([#8177](https://github.com/googleapis/google-cloud-go/issues/8177)) ([461d11e](https://github.com/googleapis/google-cloud-go/commit/461d11e913414e9de822e5f1acdf19c8f3f953d5)) * **spanner:** Update code for session leaks cleanup ([#8978](https://github.com/googleapis/google-cloud-go/issues/8978)) ([cc83515](https://github.com/googleapis/google-cloud-go/commit/cc83515d0c837c8b1596a97b6f09d519a0f75f72)) ### Bug Fixes * **spanner:** Bump google.golang.org/api to v0.149.0 ([8d2ab9f](https://github.com/googleapis/google-cloud-go/commit/8d2ab9f320a86c1c0fab90513fc05861561d0880)) * **spanner:** Expose Mutations field in MutationGroup ([#8923](https://github.com/googleapis/google-cloud-go/issues/8923)) ([42180cf](https://github.com/googleapis/google-cloud-go/commit/42180cf1134885188270f75126a65fa71b03c033)) * **spanner:** Update grpc-go to v1.56.3 ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c)) * **spanner:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) ### Documentation * **spanner:** Updated comment formatting ([24e410e](https://github.com/googleapis/google-cloud-go/commit/24e410efbb6add2d33ecfb6ad98b67dc8894e578)) ## [1.51.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.50.0...spanner/v1.51.0) (2023-10-17) ### Features * **spanner/admin/instance:** Add autoscaling config to the instance proto ([#8701](https://github.com/googleapis/google-cloud-go/issues/8701)) ([56ce871](https://github.com/googleapis/google-cloud-go/commit/56ce87195320634b07ae0b012efcc5f2b3813fb0)) ### Bug Fixes * **spanner:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) ## [1.50.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.49.0...spanner/v1.50.0) (2023-10-03) ### Features * **spanner/spansql:** Add support for aggregate functions ([#8498](https://github.com/googleapis/google-cloud-go/issues/8498)) ([d440d75](https://github.com/googleapis/google-cloud-go/commit/d440d75f19286653afe4bc81a5f2efcfc4fa152c)) * **spanner/spansql:** Add support for bit functions, sequence functions and GENERATE_UUID ([#8482](https://github.com/googleapis/google-cloud-go/issues/8482)) ([3789882](https://github.com/googleapis/google-cloud-go/commit/3789882c8b30a6d3100a56c1dcc8844952605637)) * **spanner/spansql:** Add support for SEQUENCE statements ([#8481](https://github.com/googleapis/google-cloud-go/issues/8481)) ([ccd0205](https://github.com/googleapis/google-cloud-go/commit/ccd020598921f1b5550587c95b4ceddf580705bb)) * **spanner:** Add BatchWrite API ([02a899c](https://github.com/googleapis/google-cloud-go/commit/02a899c95eb9660128506cf94525c5a75bedb308)) * **spanner:** Allow non-default service accounts ([#8488](https://github.com/googleapis/google-cloud-go/issues/8488)) ([c90dd00](https://github.com/googleapis/google-cloud-go/commit/c90dd00350fa018dbc5f0af5aabce80e80be0b90)) ## [1.49.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.48.0...spanner/v1.49.0) (2023-08-24) ### Features * **spanner/spannertest:** Support INSERT DML ([#7820](https://github.com/googleapis/google-cloud-go/issues/7820)) ([3dda7b2](https://github.com/googleapis/google-cloud-go/commit/3dda7b27ec536637d8ebaa20937fc8019c930481)) ### Bug Fixes * **spanner:** Transaction was started in a different session ([#8467](https://github.com/googleapis/google-cloud-go/issues/8467)) ([6c21558](https://github.com/googleapis/google-cloud-go/commit/6c21558f75628908a70de79c62aff2851e756e7b)) ## [1.48.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.47.0...spanner/v1.48.0) (2023-08-18) ### Features * **spanner/spansql:** Add complete set of math functions ([#8246](https://github.com/googleapis/google-cloud-go/issues/8246)) ([d7a238e](https://github.com/googleapis/google-cloud-go/commit/d7a238eca2a9b08e968cea57edc3708694673e22)) * **spanner/spansql:** Add support for foreign key actions ([#8296](https://github.com/googleapis/google-cloud-go/issues/8296)) ([d78b851](https://github.com/googleapis/google-cloud-go/commit/d78b8513b13a9a2c04b8097f0d89f85dcfd73797)) * **spanner/spansql:** Add support for IF NOT EXISTS and IF EXISTS clause ([#8245](https://github.com/googleapis/google-cloud-go/issues/8245)) ([96840ab](https://github.com/googleapis/google-cloud-go/commit/96840ab1232bbdb788e37f81cf113ee0f1b4e8e7)) * **spanner:** Add integration tests for Bit Reversed Sequences ([#7924](https://github.com/googleapis/google-cloud-go/issues/7924)) ([9b6e7c6](https://github.com/googleapis/google-cloud-go/commit/9b6e7c6061dc69683d7f558faed7f4249da5b7cb)) ### Bug Fixes * **spanner:** Reset buffer after abort on first SQL statement ([#8440](https://github.com/googleapis/google-cloud-go/issues/8440)) ([d980b42](https://github.com/googleapis/google-cloud-go/commit/d980b42f33968ef25061be50e18038d73b0503b6)) * **spanner:** REST query UpdateMask bug ([df52820](https://github.com/googleapis/google-cloud-go/commit/df52820b0e7721954809a8aa8700b93c5662dc9b)) ## [1.47.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.46.0...spanner/v1.47.0) (2023-06-20) ### Features * **spanner/admin/database:** Add DdlStatementActionInfo and add actions to UpdateDatabaseDdlMetadata ([01eff11](https://github.com/googleapis/google-cloud-go/commit/01eff11eedb3edde69cc33db23e26be6a7e42f10)) * **spanner:** Add databoost property for batch transactions ([#8152](https://github.com/googleapis/google-cloud-go/issues/8152)) ([fc49c78](https://github.com/googleapis/google-cloud-go/commit/fc49c78c9503c6dd4cbcba8c15e887415a744136)) * **spanner:** Add tests for database roles in PG dialect ([#7898](https://github.com/googleapis/google-cloud-go/issues/7898)) ([dc84649](https://github.com/googleapis/google-cloud-go/commit/dc84649c546fe09b0bab09991086c156bd78cb3f)) * **spanner:** Enable client to server compression ([#7899](https://github.com/googleapis/google-cloud-go/issues/7899)) ([3a047d2](https://github.com/googleapis/google-cloud-go/commit/3a047d2a449b0316a9000539ec9797e47cdd5c91)) * **spanner:** Update all direct dependencies ([b340d03](https://github.com/googleapis/google-cloud-go/commit/b340d030f2b52a4ce48846ce63984b28583abde6)) ### Bug Fixes * **spanner:** Fix TestRetryInfoTransactionOutcomeUnknownError flaky behaviour ([#7959](https://github.com/googleapis/google-cloud-go/issues/7959)) ([f037795](https://github.com/googleapis/google-cloud-go/commit/f03779538f949fb4ad93d5247d3c6b3e5b21091a)) ## [1.46.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.45.1...spanner/v1.46.0) (2023-05-12) ### Features * **spanner/admin/database:** Add support for UpdateDatabase in Cloud Spanner ([#7917](https://github.com/googleapis/google-cloud-go/issues/7917)) ([83870f5](https://github.com/googleapis/google-cloud-go/commit/83870f55035d6692e22264b209e39e07fe2823b9)) * **spanner:** Make leader aware routing default enabled for supported RPC requests. ([#7912](https://github.com/googleapis/google-cloud-go/issues/7912)) ([d0d3755](https://github.com/googleapis/google-cloud-go/commit/d0d37550911f37e09ea9204d0648fb64ff3204ff)) ### Bug Fixes * **spanner:** Update grpc to v1.55.0 ([1147ce0](https://github.com/googleapis/google-cloud-go/commit/1147ce02a990276ca4f8ab7a1ab65c14da4450ef)) ## [1.45.1](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.45.0...spanner/v1.45.1) (2023-04-21) ### Bug Fixes * **spanner/spannertest:** Send transaction id in result metadata ([#7809](https://github.com/googleapis/google-cloud-go/issues/7809)) ([e3bbd5f](https://github.com/googleapis/google-cloud-go/commit/e3bbd5f10b3922ab2eb50cb39daccd7bc1891892)) * **spanner:** Context timeout should be wrapped correctly ([#7744](https://github.com/googleapis/google-cloud-go/issues/7744)) ([f8e22f6](https://github.com/googleapis/google-cloud-go/commit/f8e22f6cbba10fc262e87b4d06d5c1289d877503)) ## [1.45.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.44.0...spanner/v1.45.0) (2023-04-10) ### Features * **spanner/spansql:** Add support for missing DDL syntax for ALTER CHANGE STREAM ([#7429](https://github.com/googleapis/google-cloud-go/issues/7429)) ([d34fe02](https://github.com/googleapis/google-cloud-go/commit/d34fe02cfa31520f88dedbd41bbc887e8faa857f)) * **spanner/spansql:** Support fine-grained access control DDL syntax ([#6691](https://github.com/googleapis/google-cloud-go/issues/6691)) ([a7edf6b](https://github.com/googleapis/google-cloud-go/commit/a7edf6b5c62d02b7d5199fc83d435f6a37a8eac5)) * **spanner/spansql:** Support grant/revoke view, change stream, table function ([#7533](https://github.com/googleapis/google-cloud-go/issues/7533)) ([9c61215](https://github.com/googleapis/google-cloud-go/commit/9c612159647d540e694ec9e84cab5cdd1c94d2b8)) * **spanner:** Add x-goog-spanner-route-to-leader header to Spanner RPC contexts for RW/PDML transactions. ([#7500](https://github.com/googleapis/google-cloud-go/issues/7500)) ([fcab05f](https://github.com/googleapis/google-cloud-go/commit/fcab05faa5026896af76b762eed5b7b6b2e7ee07)) * **spanner:** Adding new fields for Serverless analytics ([69067f8](https://github.com/googleapis/google-cloud-go/commit/69067f8c0075099a84dd9d40e438711881710784)) * **spanner:** Enable custom decoding for list value ([#7463](https://github.com/googleapis/google-cloud-go/issues/7463)) ([3aeadcd](https://github.com/googleapis/google-cloud-go/commit/3aeadcd97eaf2707c2f6e288c8b72ef29f49a185)) * **spanner:** Update iam and longrunning deps ([91a1f78](https://github.com/googleapis/google-cloud-go/commit/91a1f784a109da70f63b96414bba8a9b4254cddd)) ### Bug Fixes * **spanner/spansql:** Fix SQL for CREATE CHANGE STREAM TableName; case ([#7514](https://github.com/googleapis/google-cloud-go/issues/7514)) ([fc5fd86](https://github.com/googleapis/google-cloud-go/commit/fc5fd8652771aeca73e7a28ee68134155a5a9499)) * **spanner:** Correcting the proto field Id for field data_boost_enabled ([00fff3a](https://github.com/googleapis/google-cloud-go/commit/00fff3a58bed31274ab39af575876dab91d708c9)) ## [1.44.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.43.0...spanner/v1.44.0) (2023-02-01) ### Features * **spanner/spansql:** Add support for ALTER INDEX statement ([#7287](https://github.com/googleapis/google-cloud-go/issues/7287)) ([fbe1bd4](https://github.com/googleapis/google-cloud-go/commit/fbe1bd4d0806302a48ff4a5822867757893a5f2d)) * **spanner/spansql:** Add support for managing the optimizer statistics package ([#7283](https://github.com/googleapis/google-cloud-go/issues/7283)) ([e528221](https://github.com/googleapis/google-cloud-go/commit/e52822139e2821a11873c2d6af85a5fea07700e8)) * **spanner:** Add support for Optimistic Concurrency Control ([#7332](https://github.com/googleapis/google-cloud-go/issues/7332)) ([48ba16f](https://github.com/googleapis/google-cloud-go/commit/48ba16f3a09893a3527a22838ad1e9ff829da15b)) ## [1.43.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.42.0...spanner/v1.43.0) (2023-01-19) ### Features * **spanner/spansql:** Add support for change stream value_capture_type option ([#7201](https://github.com/googleapis/google-cloud-go/issues/7201)) ([27b3398](https://github.com/googleapis/google-cloud-go/commit/27b33988f078779c2d641f776a11b2095a5ccc51)) * **spanner/spansql:** Support `default_leader` database option ([#7187](https://github.com/googleapis/google-cloud-go/issues/7187)) ([88adaa2](https://github.com/googleapis/google-cloud-go/commit/88adaa216832467560c19e61528b5ce5f1e5ff76)) * **spanner:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0)) * **spanner:** Inline begin transaction for ReadWriteTransactions ([#7149](https://github.com/googleapis/google-cloud-go/issues/7149)) ([2ce3606](https://github.com/googleapis/google-cloud-go/commit/2ce360644439a386aeaad7df5f47541667bd621b)) ### Bug Fixes * **spanner:** Fix integration tests data race ([#7229](https://github.com/googleapis/google-cloud-go/issues/7229)) ([a741024](https://github.com/googleapis/google-cloud-go/commit/a741024abd6fb1f073831503c2717b2a44226a59)) ## [1.42.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.41.0...spanner/v1.42.0) (2022-12-14) ### Features * **spanner:** Add database roles ([#5701](https://github.com/googleapis/google-cloud-go/issues/5701)) ([6bb95ef](https://github.com/googleapis/google-cloud-go/commit/6bb95efb7997692a52c321e787e633a5045b21f8)) * **spanner:** Rewrite signatures and type in terms of new location ([620e6d8](https://github.com/googleapis/google-cloud-go/commit/620e6d828ad8641663ae351bfccfe46281e817ad)) ### Bug Fixes * **spanner:** Fallback to check grpc error message if ResourceType is nil for checking sessionNotFound errors ([#7163](https://github.com/googleapis/google-cloud-go/issues/7163)) ([2552e09](https://github.com/googleapis/google-cloud-go/commit/2552e092cff01e0d6b80fefaa7877f77e36db6be)) ## [1.41.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.40.0...spanner/v1.41.0) (2022-12-01) ### Features * **spanner:** Start generating proto stubs ([#7030](https://github.com/googleapis/google-cloud-go/issues/7030)) ([41f446f](https://github.com/googleapis/google-cloud-go/commit/41f446f891a17c97278879f2207fd58996fd038c)) ## [1.40.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.39.0...spanner/v1.40.0) (2022-11-03) ### Features * **spanner/spansql:** Add support for interval arg of some date/timestamp functions ([#6950](https://github.com/googleapis/google-cloud-go/issues/6950)) ([1ce0f7d](https://github.com/googleapis/google-cloud-go/commit/1ce0f7d38778068fd1d9a171377067739f4ea8d6)) * **spanner:** Configurable logger ([#6958](https://github.com/googleapis/google-cloud-go/issues/6958)) ([bd85442](https://github.com/googleapis/google-cloud-go/commit/bd85442bc6fb8c18d1a7c6d73850d220c3973c46)), refs [#6957](https://github.com/googleapis/google-cloud-go/issues/6957) * **spanner:** PG JSONB support ([#6874](https://github.com/googleapis/google-cloud-go/issues/6874)) ([5b14658](https://github.com/googleapis/google-cloud-go/commit/5b146587939ccc3403945c756cbf68e6f2d41fda)) * **spanner:** Update result_set.proto to return undeclared parameters in ExecuteSql API ([de4e16a](https://github.com/googleapis/google-cloud-go/commit/de4e16a498354ea7271f5b396f7cb2bb430052aa)) * **spanner:** Update transaction.proto to include different lock modes ([caf4afa](https://github.com/googleapis/google-cloud-go/commit/caf4afa139ad7b38b6df3e3b17b8357c81e1fd6c)) ## [1.39.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.38.0...spanner/v1.39.0) (2022-09-21) ### Features * **spanner/admin/database:** Add custom instance config operations ([ec1a190](https://github.com/googleapis/google-cloud-go/commit/ec1a190abbc4436fcaeaa1421c7d9df624042752)) * **spanner/admin/instance:** Add custom instance config operations ([ef2b0b1](https://github.com/googleapis/google-cloud-go/commit/ef2b0b1d4de9beb9005537ae48d7d8e1c0f23b98)) * **spanner/spannersql:** Add backticks when name contains a hypen ([#6621](https://github.com/googleapis/google-cloud-go/issues/6621)) ([e88ca66](https://github.com/googleapis/google-cloud-go/commit/e88ca66ca950e15d9011322dbfca3c88ccceb0ec)) * **spanner/spansql:** Add support for create, alter and drop change … ([#6669](https://github.com/googleapis/google-cloud-go/issues/6669)) ([cc4620a](https://github.com/googleapis/google-cloud-go/commit/cc4620a5ee3a9129a4cdd48d90d4060ba0bbcd58)) * **spanner:** Retry spanner transactions and mutations when RST_STREAM error ([#6699](https://github.com/googleapis/google-cloud-go/issues/6699)) ([1b56cd0](https://github.com/googleapis/google-cloud-go/commit/1b56cd0ec31bc32362259fc722907e092bae081a)) ### Bug Fixes * **spanner/admin/database:** Revert add custom instance config operations (change broke client libraries; reverting before any are released) ([ec1a190](https://github.com/googleapis/google-cloud-go/commit/ec1a190abbc4436fcaeaa1421c7d9df624042752)) * **spanner:** Destroy session when client is closing ([#6700](https://github.com/googleapis/google-cloud-go/issues/6700)) ([a1ce541](https://github.com/googleapis/google-cloud-go/commit/a1ce5410f1e0f4d68dae0ddc790518e9978faf0c)) * **spanner:** Spanner sessions will be cleaned up from the backend ([#6679](https://github.com/googleapis/google-cloud-go/issues/6679)) ([c27097e](https://github.com/googleapis/google-cloud-go/commit/c27097e236abeb8439a67ad9b716d05c001aea2e)) ## [1.38.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.37.0...spanner/v1.38.0) (2022-09-03) ### Features * **spanner/spannertest:** add support for adding and dropping Foreign Keys ([#6608](https://github.com/googleapis/google-cloud-go/issues/6608)) ([ccd3614](https://github.com/googleapis/google-cloud-go/commit/ccd3614f6edbaf3d7d202feb4df220f244550a78)) * **spanner/spansql:** add support for coalesce expressions ([#6461](https://github.com/googleapis/google-cloud-go/issues/6461)) ([bff16a7](https://github.com/googleapis/google-cloud-go/commit/bff16a783c1fd4d7e888d4ee3b5420c1bbf10da1)) * **spanner:** Adds auto-generated CL for googleapis for jsonb ([3bc37e2](https://github.com/googleapis/google-cloud-go/commit/3bc37e28626df5f7ec37b00c0c2f0bfb91c30495)) ### Bug Fixes * **spanner:** pass userAgent to cloud spanner requests ([#6598](https://github.com/googleapis/google-cloud-go/issues/6598)) ([59d162b](https://github.com/googleapis/google-cloud-go/commit/59d162bdfcbe00a060a52930be7185f00e8df2c1)) ## [1.37.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.36.0...spanner/v1.37.0) (2022-08-28) ### Features * **spanner/admin/database:** Add ListDatabaseRoles API to support role based access control ([1ffeb95](https://github.com/googleapis/google-cloud-go/commit/1ffeb9557bf1f18cc131aff40ec7e0e15a9f4ead)) * **spanner/spansql:** add support for nullif expressions ([#6423](https://github.com/googleapis/google-cloud-go/issues/6423)) ([5b7bfeb](https://github.com/googleapis/google-cloud-go/commit/5b7bfebcd4a0fd3cbe355d9d290e6b5101810b7e)) * **spanner:** install grpc rls and xds by default ([#6007](https://github.com/googleapis/google-cloud-go/issues/6007)) ([70d562f](https://github.com/googleapis/google-cloud-go/commit/70d562f25738052e833a46daf6ff7fa1f4a0a746)) * **spanner:** set client wide ReadOptions, ApplyOptions, and TransactionOptions ([#6486](https://github.com/googleapis/google-cloud-go/issues/6486)) ([757f1ca](https://github.com/googleapis/google-cloud-go/commit/757f1cac7a765fe2e7ead872d07eb24baad61c28)) ### Bug Fixes * **spanner/admin/database:** target new spanner db admin service config ([1d6fbcc](https://github.com/googleapis/google-cloud-go/commit/1d6fbcc6406e2063201ef5a98de560bf32f7fb73)) ## [1.36.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.35.0...spanner/v1.36.0) (2022-07-23) ### Features * **spanner/spansql:** add support for IFNULL expressions ([#6389](https://github.com/googleapis/google-cloud-go/issues/6389)) ([09e96ce](https://github.com/googleapis/google-cloud-go/commit/09e96ce1076df4b41d45c3676b7506b318da6b9c)) * **spanner/spansql:** support for parsing a DML file ([#6349](https://github.com/googleapis/google-cloud-go/issues/6349)) ([267a9bb](https://github.com/googleapis/google-cloud-go/commit/267a9bbec55ee8fe885354efc8db8a61a17a8374)) ## [1.35.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.34.1...spanner/v1.35.0) (2022-07-19) ### Features * **spanner/admin/instance:** Adding two new fields for Instance create_time and update_time ([8a1ad06](https://github.com/googleapis/google-cloud-go/commit/8a1ad06572a65afa91a0a77a85b849e766876671)) * **spanner/spansql:** add support for if expressions ([#6341](https://github.com/googleapis/google-cloud-go/issues/6341)) ([56c858c](https://github.com/googleapis/google-cloud-go/commit/56c858cebd683e45d1dd5ab8ae98ef9bfd767edc)) ### Bug Fixes * **spanner:** fix pool.numInUse exceeding MaxOpened ([#6344](https://github.com/googleapis/google-cloud-go/issues/6344)) ([882b325](https://github.com/googleapis/google-cloud-go/commit/882b32593e8c7bff8369b1ff9259c7b408fad661)) ## [1.34.1](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.34.0...spanner/v1.34.1) (2022-07-06) ### Bug Fixes * **spanner/spansql:** Add tests for INSERT parsing ([#6303](https://github.com/googleapis/google-cloud-go/issues/6303)) ([0d19fb5](https://github.com/googleapis/google-cloud-go/commit/0d19fb5d60554b9a90fac52918f784e6c3e13918)) ## [1.34.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.33.0...spanner/v1.34.0) (2022-06-17) ### Features * **spanner/spansql:** add a support for parsing INSERT statement ([#6148](https://github.com/googleapis/google-cloud-go/issues/6148)) ([c6185cf](https://github.com/googleapis/google-cloud-go/commit/c6185cffc7f23741ac4a230aadee74b3def85ced)) * **spanner:** add Session creator role docs: clarify transaction semantics ([4134941](https://github.com/googleapis/google-cloud-go/commit/41349411e601f57dc6d9e246f1748fd86d17bb15)) ## [1.33.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.32.0...spanner/v1.33.0) (2022-05-28) ### Bug Fixes * **spanner/spansql:** fix invalid timestamp literal formats ([#6077](https://github.com/googleapis/google-cloud-go/issues/6077)) ([6ab8bed](https://github.com/googleapis/google-cloud-go/commit/6ab8bed93a978e00a6c195d8cb4d574ca6db27c3)) ### Miscellaneous Chores * **spanner:** release 1.33.0 ([#6104](https://github.com/googleapis/google-cloud-go/issues/6104)) ([54bc54e](https://github.com/googleapis/google-cloud-go/commit/54bc54e9bbdc22e2bbfd9f315885f95987e2c3f2)) ## [1.32.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.31.0...spanner/v1.32.0) (2022-05-09) ### Features * **spanner/spansql:** support DEFAULT keyword ([#5932](https://github.com/googleapis/google-cloud-go/issues/5932)) ([49c19a9](https://github.com/googleapis/google-cloud-go/commit/49c19a956031fa889d024bd57fa34681bc79e743)) * **spanner/spansql:** support JSON literals ([#5968](https://github.com/googleapis/google-cloud-go/issues/5968)) ([b500120](https://github.com/googleapis/google-cloud-go/commit/b500120f3cc5c7b5717f6525a24de72fd317ba66)) * **spanner:** enable row.ToStructLenient to work with STRUCT data type ([#5944](https://github.com/googleapis/google-cloud-go/issues/5944)) ([bca8d50](https://github.com/googleapis/google-cloud-go/commit/bca8d50533115b9995f7b4a63d5d1f9abaf6a753)) ## [1.31.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.30.1...spanner/v1.31.0) (2022-04-08) ### Features * **spanner/spansql:** support case expression ([#5836](https://github.com/googleapis/google-cloud-go/issues/5836)) ([3ffdd62](https://github.com/googleapis/google-cloud-go/commit/3ffdd626e72c6472f337a423b9702baf0c298185)) ### Bug Fixes * **spanner/spannertest:** Improve DDL application delay cancellation. ([#5874](https://github.com/googleapis/google-cloud-go/issues/5874)) ([08f1e72](https://github.com/googleapis/google-cloud-go/commit/08f1e72dbf2ef5a06425f71500d061af246bd490)) ### [1.30.1](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.30.0...spanner/v1.30.1) (2022-03-28) ### Bug Fixes * **spanner:** early unlock of session pool lock during dumping the tracked session handles to avoid deadlock ([#5777](https://github.com/googleapis/google-cloud-go/issues/5777)) ([b007836](https://github.com/googleapis/google-cloud-go/commit/b0078362865159b87bc34c1a7f990a361f1cafcf)) ## [1.30.0](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.29.0...spanner/v1.30.0) (2022-03-04) ### Features * **spanner:** add better version metadata to calls ([#5515](https://github.com/googleapis/google-cloud-go/issues/5515)) ([dcab7c4](https://github.com/googleapis/google-cloud-go/commit/dcab7c4a98ebecfef1f75ec5bddfd7782b28a7c5)), refs [#2749](https://github.com/googleapis/google-cloud-go/issues/2749) * **spanner:** add file for tracking version ([17b36ea](https://github.com/googleapis/google-cloud-go/commit/17b36ead42a96b1a01105122074e65164357519e)) * **spanner:** add support of PGNumeric with integration tests for PG dialect ([#5700](https://github.com/googleapis/google-cloud-go/issues/5700)) ([f7e02e1](https://github.com/googleapis/google-cloud-go/commit/f7e02e11064d14c04eca18ab808e8fe5194ac355)) * **spanner:** set versionClient to module version ([55f0d92](https://github.com/googleapis/google-cloud-go/commit/55f0d92bf112f14b024b4ab0076c9875a17423c9)) ### Bug Fixes * **spanner/spansql:** support GROUP BY without an aggregation function ([#5717](https://github.com/googleapis/google-cloud-go/issues/5717)) ([c819ee9](https://github.com/googleapis/google-cloud-go/commit/c819ee9ad4695afa31eddcb4bf87764762555cd5)) ### Miscellaneous Chores * **spanner:** release 1.30.0 ([#5715](https://github.com/googleapis/google-cloud-go/issues/5715)) ([a19d182](https://github.com/googleapis/google-cloud-go/commit/a19d182dab5476cf01e719c751e94a73a98c6c4a)) ## [1.29.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.28.0...spanner/v1.29.0) (2022-01-06) ### ⚠ BREAKING CHANGES * **spanner:** fix data race in spanner integration tests (#5276) ### Features * **spanner/spansql:** support EXTRACT ([#5218](https://www.github.com/googleapis/google-cloud-go/issues/5218)) ([81b7c85](https://www.github.com/googleapis/google-cloud-go/commit/81b7c85a8993a36557ea4eb4ec0c47d1f93c4960)) * **spanner/spansql:** support MOD function ([#5231](https://www.github.com/googleapis/google-cloud-go/issues/5231)) ([0a81fbc](https://www.github.com/googleapis/google-cloud-go/commit/0a81fbc0171af7e828f3e606cbe7b3905ac32213)) * **spanner:** add google-c2p dependence ([5343756](https://www.github.com/googleapis/google-cloud-go/commit/534375668b5b81bae5ef750c96856bef027f9d1e)) * **spanner:** Add ReadRowWithOptions method ([#5240](https://www.github.com/googleapis/google-cloud-go/issues/5240)) ([c276428](https://www.github.com/googleapis/google-cloud-go/commit/c276428bca79702245d422849af6472bb2e74171)) * **spanner:** Adding GFE Latency and Header Missing Count Metrics ([#5199](https://www.github.com/googleapis/google-cloud-go/issues/5199)) ([3d8a9ea](https://www.github.com/googleapis/google-cloud-go/commit/3d8a9ead8d73a4f38524a424a98362c32f56954b)) ### Bug Fixes * **spanner:** result from unmarshal of string and spanner.NullString type from json should be consistent. ([#5263](https://www.github.com/googleapis/google-cloud-go/issues/5263)) ([7eaaa47](https://www.github.com/googleapis/google-cloud-go/commit/7eaaa470fda5dc7cd1ff041d6a898e35fb54920e)) ### Tests * **spanner:** fix data race in spanner integration tests ([#5276](https://www.github.com/googleapis/google-cloud-go/issues/5276)) ([22df34b](https://www.github.com/googleapis/google-cloud-go/commit/22df34b8e7d0d003b3eeaf1c069aee58f30a8dfe)) ### Miscellaneous Chores * **spanner:** release 1.29.0 ([#5292](https://www.github.com/googleapis/google-cloud-go/issues/5292)) ([9f0b900](https://www.github.com/googleapis/google-cloud-go/commit/9f0b9003686d26c66a10c3b54e67b59c2a6327ff)) ## [1.28.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.27.0...spanner/v1.28.0) (2021-12-03) ### Features * **spanner/spannertest:** support JSON_VALUE function ([#5173](https://www.github.com/googleapis/google-cloud-go/issues/5173)) ([ac98735](https://www.github.com/googleapis/google-cloud-go/commit/ac98735cb1adc9384c5b2caeb9aac938db275bf7)) * **spanner/spansql:** support CAST and SAFE_CAST ([#5057](https://www.github.com/googleapis/google-cloud-go/issues/5057)) ([54cbf4c](https://www.github.com/googleapis/google-cloud-go/commit/54cbf4c0a0305e680b213f84487110dfeaf8e7e1)) * **spanner:** add ToStructLenient method to decode to struct fields with no error return with un-matched row's column with struct's exported fields. ([#5153](https://www.github.com/googleapis/google-cloud-go/issues/5153)) ([899ffbf](https://www.github.com/googleapis/google-cloud-go/commit/899ffbf8ce42b1597ca3cd59bfd9f042054b8ae2)) ## [1.27.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.26.0...spanner/v1.27.0) (2021-10-19) ### Features * **spanner:** implement valuer and scanner interfaces ([#4936](https://www.github.com/googleapis/google-cloud-go/issues/4936)) ([4537b45](https://www.github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c)) ## [1.26.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.25.0...spanner/v1.26.0) (2021-10-11) ### Features * **spanner/spannertest:** implement RowDeletionPolicy in spannertest ([#4961](https://www.github.com/googleapis/google-cloud-go/issues/4961)) ([7800a33](https://www.github.com/googleapis/google-cloud-go/commit/7800a3303b97204a0573780786388437bbbf2673)), refs [#4782](https://www.github.com/googleapis/google-cloud-go/issues/4782) * **spanner/spannertest:** Support generated columns ([#4742](https://www.github.com/googleapis/google-cloud-go/issues/4742)) ([324d11d](https://www.github.com/googleapis/google-cloud-go/commit/324d11d3c19ffbd77848c8e19c972b70ff5e9268)) * **spanner/spansql:** fill in missing hash functions ([#4808](https://www.github.com/googleapis/google-cloud-go/issues/4808)) ([37ee2d9](https://www.github.com/googleapis/google-cloud-go/commit/37ee2d95220efc1aaf0280d0aa2c01ae4b9d4c1b)) * **spanner/spansql:** support JSON data type ([#4959](https://www.github.com/googleapis/google-cloud-go/issues/4959)) ([e84e408](https://www.github.com/googleapis/google-cloud-go/commit/e84e40830752fc8bc0ccdd869fa7b8fd0c80f306)) * **spanner/spansql:** Support multiple joins in query ([#4743](https://www.github.com/googleapis/google-cloud-go/issues/4743)) ([81a308e](https://www.github.com/googleapis/google-cloud-go/commit/81a308e909a3ae97504a49fbc9982f7eeb6be80c)) ## [1.25.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.24.1...spanner/v1.25.0) (2021-08-25) ### Features * **spanner/spansql:** add support for STARTS_WITH function ([#4670](https://www.github.com/googleapis/google-cloud-go/issues/4670)) ([7a56af0](https://www.github.com/googleapis/google-cloud-go/commit/7a56af03d1505d9a29d1185a50e261c0e90fdb1a)), refs [#4661](https://www.github.com/googleapis/google-cloud-go/issues/4661) * **spanner:** add support for JSON data type ([#4104](https://www.github.com/googleapis/google-cloud-go/issues/4104)) ([ade8ab1](https://www.github.com/googleapis/google-cloud-go/commit/ade8ab111315d84fa140ddde020387a78668dfa4)) ### Bug Fixes * **spanner/spannertest:** Fix the "LIKE" clause handling for prefix and suffix matches ([#4655](https://www.github.com/googleapis/google-cloud-go/issues/4655)) ([a2118f0](https://www.github.com/googleapis/google-cloud-go/commit/a2118f02fb03bfc50952699318f35c23dc234c41)) * **spanner:** invalid numeric should throw an error ([#3926](https://www.github.com/googleapis/google-cloud-go/issues/3926)) ([cde8697](https://www.github.com/googleapis/google-cloud-go/commit/cde8697be01f1ef57806275c0ddf54f87bb9a571)) ### [1.24.1](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.24.0...spanner/v1.24.1) (2021-08-11) ### Bug Fixes * **spanner/spansql:** only add comma after other option ([#4551](https://www.github.com/googleapis/google-cloud-go/issues/4551)) ([3ac1e00](https://www.github.com/googleapis/google-cloud-go/commit/3ac1e007163803d315dcf5db612fe003f6eab978)) * **spanner:** allow decoding null values to spanner.Decoder ([#4558](https://www.github.com/googleapis/google-cloud-go/issues/4558)) ([45ddaca](https://www.github.com/googleapis/google-cloud-go/commit/45ddaca606a372d9293bf2e2b3dc6d4398166c43)), refs [#4552](https://www.github.com/googleapis/google-cloud-go/issues/4552) ## [1.24.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.23.0...spanner/v1.24.0) (2021-07-29) ### Features * **spanner/spansql:** add ROW DELETION POLICY parsing ([#4496](https://www.github.com/googleapis/google-cloud-go/issues/4496)) ([3d6c6c7](https://www.github.com/googleapis/google-cloud-go/commit/3d6c6c7873e1b75e8b492ede2e561411dc40536a)) * **spanner/spansql:** fix unstable SelectFromTable SQL ([#4473](https://www.github.com/googleapis/google-cloud-go/issues/4473)) ([39bc4ec](https://www.github.com/googleapis/google-cloud-go/commit/39bc4eca655d0180b18378c175d4a9a77fe1602f)) * **spanner/spansql:** support ALTER DATABASE ([#4403](https://www.github.com/googleapis/google-cloud-go/issues/4403)) ([1458dc9](https://www.github.com/googleapis/google-cloud-go/commit/1458dc9c21d98ffffb871943f178678cc3c21306)) * **spanner/spansql:** support table_hint_expr at from_clause on query_statement ([#4457](https://www.github.com/googleapis/google-cloud-go/issues/4457)) ([7047808](https://www.github.com/googleapis/google-cloud-go/commit/7047808794cf463c6a96d7b59ef5af3ed94fd7cf)) * **spanner:** add row.String() and refine error message for decoding a struct array ([#4431](https://www.github.com/googleapis/google-cloud-go/issues/4431)) ([f6258a4](https://www.github.com/googleapis/google-cloud-go/commit/f6258a47a4dfadc02dcdd75b53fd5f88c5dcca30)) * **spanner:** allow untyped nil values in parameterized queries ([#4482](https://www.github.com/googleapis/google-cloud-go/issues/4482)) ([c1ba18b](https://www.github.com/googleapis/google-cloud-go/commit/c1ba18b1b1fc45de6e959cc22a5c222cc80433ee)) ### Bug Fixes * **spanner/spansql:** fix DATE and TIMESTAMP parsing. ([#4480](https://www.github.com/googleapis/google-cloud-go/issues/4480)) ([dec7a67](https://www.github.com/googleapis/google-cloud-go/commit/dec7a67a3e980f6f5e0d170919da87e1bffe923f)) ## [1.23.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.22.0...spanner/v1.23.0) (2021-07-08) ### Features * **spanner/admin/database:** add leader_options to InstanceConfig and default_leader to Database ([7aa0e19](https://www.github.com/googleapis/google-cloud-go/commit/7aa0e195a5536dd060a1fca871bd3c6f946d935e)) ## [1.22.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.21.0...spanner/v1.22.0) (2021-06-30) ### Features * **spanner:** support request and transaction tags ([#4336](https://www.github.com/googleapis/google-cloud-go/issues/4336)) ([f08c73a](https://www.github.com/googleapis/google-cloud-go/commit/f08c73a75e2d2a8b9a0b184179346cb97c82e9e5)) * **spanner:** enable request options for batch read ([#4337](https://www.github.com/googleapis/google-cloud-go/issues/4337)) ([b9081c3](https://www.github.com/googleapis/google-cloud-go/commit/b9081c36ed6495a67f8e458ad884bdb8da5b7fbc)) ## [1.21.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.20.0...spanner/v1.21.0) (2021-06-23) ### Miscellaneous Chores * **spanner:** trigger a release for low cost instance ([#4264](https://www.github.com/googleapis/google-cloud-go/issues/4264)) ([24c4451](https://www.github.com/googleapis/google-cloud-go/commit/24c4451404cdf4a83cc7a35ee1911d654d2ba132)) ## [1.20.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.19.0...spanner/v1.20.0) (2021-06-08) ### Features * **spanner:** add the support of optimizer statistics package ([#2717](https://www.github.com/googleapis/google-cloud-go/issues/2717)) ([29c7247](https://www.github.com/googleapis/google-cloud-go/commit/29c724771f0b19849c76e62d4bc8e9342922bf75)) ## [1.19.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.18.0...spanner/v1.19.0) (2021-06-03) ### Features * **spanner/spannertest:** support multiple aggregations ([#3965](https://www.github.com/googleapis/google-cloud-go/issues/3965)) ([1265dc3](https://www.github.com/googleapis/google-cloud-go/commit/1265dc3289693f79fcb9c5785a424eb510a50007)) * **spanner/spansql:** case insensitive parsing of keywords and functions ([#4034](https://www.github.com/googleapis/google-cloud-go/issues/4034)) ([ddb09d2](https://www.github.com/googleapis/google-cloud-go/commit/ddb09d22a737deea0d0a9ab58cd5d337164bbbfe)) * **spanner:** add a database name getter to client ([#4190](https://www.github.com/googleapis/google-cloud-go/issues/4190)) ([7fce29a](https://www.github.com/googleapis/google-cloud-go/commit/7fce29af404f0623b483ca6d6f2af4c726105fa6)) * **spanner:** add custom instance config to tests ([#4194](https://www.github.com/googleapis/google-cloud-go/issues/4194)) ([e935345](https://www.github.com/googleapis/google-cloud-go/commit/e9353451237e658bde2e41b30e8270fbc5987b39)) ### Bug Fixes * **spanner:** add missing NUMERIC type to the doc for Row ([#4116](https://www.github.com/googleapis/google-cloud-go/issues/4116)) ([9a3b416](https://www.github.com/googleapis/google-cloud-go/commit/9a3b416221f3c8b3793837e2a459b1d7cd9c479f)) * **spanner:** indent code example for Encoder and Decoder ([#4128](https://www.github.com/googleapis/google-cloud-go/issues/4128)) ([7c1f48f](https://www.github.com/googleapis/google-cloud-go/commit/7c1f48f307284c26c10cd5787dbc94136a2a36a6)) * **spanner:** mark SessionPoolConfig.MaxBurst deprecated ([#4115](https://www.github.com/googleapis/google-cloud-go/issues/4115)) ([d60a686](https://www.github.com/googleapis/google-cloud-go/commit/d60a68649f85f1edfbd8f11673bb280813c2b771)) ## [1.18.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.17.0...spanner/v1.18.0) (2021-04-29) ### Features * **spanner/admin/database:** add `progress` field to `UpdateDatabaseDdlMetadata` ([9029071](https://www.github.com/googleapis/google-cloud-go/commit/90290710158cf63de918c2d790df48f55a23adc5)) ## [1.17.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.16.0...spanner/v1.17.0) (2021-03-31) ### Features * **spanner/admin/database:** add tagging request options ([2b02a03](https://www.github.com/googleapis/google-cloud-go/commit/2b02a03ff9f78884da5a8e7b64a336014c61bde7)) * **spanner:** add RPC Priority request options ([b5b4da6](https://www.github.com/googleapis/google-cloud-go/commit/b5b4da6952922440d03051f629f3166f731dfaa3)) * **spanner:** Add support for RPC priority ([#3341](https://www.github.com/googleapis/google-cloud-go/issues/3341)) ([88cf097](https://www.github.com/googleapis/google-cloud-go/commit/88cf097649f1cdf01cab531eabdff7fbf2be3f8f)) ## [1.16.0](https://www.github.com/googleapis/google-cloud-go/compare/v1.15.0...v1.16.0) (2021-03-17) ### Features * **spanner:** add `optimizer_statistics_package` field in `QueryOptions` ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) * **spanner/admin/database:** add CMEK fields to backup and database ([16597fa](https://github.com/googleapis/google-cloud-go/commit/16597fa1ce549053c7183e8456e23f554a5501de)) ### Bug Fixes * **spanner/spansql:** fix parsing of NOT IN operator ([#3724](https://www.github.com/googleapis/google-cloud-go/issues/3724)) ([7636478](https://www.github.com/googleapis/google-cloud-go/commit/76364784d82073b80929ae60fd42da34c8050820)) ## [1.15.0](https://www.github.com/googleapis/google-cloud-go/compare/v1.14.1...v1.15.0) (2021-02-24) ### Features * **spanner/admin/database:** add CMEK fields to backup and database ([47037ed](https://www.github.com/googleapis/google-cloud-go/commit/47037ed33cd36edfff4ba7c4a4ea332140d5e67b)) * **spanner/admin/database:** add CMEK fields to backup and database ([16597fa](https://www.github.com/googleapis/google-cloud-go/commit/16597fa1ce549053c7183e8456e23f554a5501de)) ### Bug Fixes * **spanner:** parallelize session deletion when closing pool ([#3701](https://www.github.com/googleapis/google-cloud-go/issues/3701)) ([75ac7d2](https://www.github.com/googleapis/google-cloud-go/commit/75ac7d2506e706869ae41cf186b0c873b146e926)), refs [#3685](https://www.github.com/googleapis/google-cloud-go/issues/3685) ### [1.14.1](https://www.github.com/googleapis/google-cloud-go/compare/v1.14.0...v1.14.1) (2021-02-09) ### Bug Fixes * **spanner:** restore removed scopes ([#3684](https://www.github.com/googleapis/google-cloud-go/issues/3684)) ([232d3a1](https://www.github.com/googleapis/google-cloud-go/commit/232d3a17bdadb92864592351a335ec920a68f9bf)) ## [1.14.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.13.0...v1.14.0) (2021-02-09) ### Features * **spanner/admin/database:** adds PITR fields to backup and database ([0959f27](https://www.github.com/googleapis/google-cloud-go/commit/0959f27e85efe94d39437ceef0ff62ddceb8e7a7)) * **spanner/spannertest:** restructure column alteration implementation ([#3616](https://www.github.com/googleapis/google-cloud-go/issues/3616)) ([176400b](https://www.github.com/googleapis/google-cloud-go/commit/176400be9ab485fb343b8994bc49ac2291d8eea9)) * **spanner/spansql:** add complete set of array functions ([#3633](https://www.github.com/googleapis/google-cloud-go/issues/3633)) ([13d50b9](https://www.github.com/googleapis/google-cloud-go/commit/13d50b93cc8348c54641b594371a96ecdb1bcabc)) * **spanner/spansql:** add complete set of string functions ([#3625](https://www.github.com/googleapis/google-cloud-go/issues/3625)) ([34027ad](https://www.github.com/googleapis/google-cloud-go/commit/34027ada6a718603be2987b4084ce5e0ead6413c)) * **spanner:** add option for returning Spanner commit stats ([c7ecf0f](https://www.github.com/googleapis/google-cloud-go/commit/c7ecf0f3f454606b124e52d20af2545b2c68646f)) * **spanner:** add option for returning Spanner commit stats ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) * **spanner:** support CommitStats ([#3444](https://www.github.com/googleapis/google-cloud-go/issues/3444)) ([b7c3ca6](https://www.github.com/googleapis/google-cloud-go/commit/b7c3ca6c83cbdca95d734df8aa07c5ddb8ab3db0)) ### Bug Fixes * **spanner/spannertest:** support queries in ExecuteSql ([#3640](https://www.github.com/googleapis/google-cloud-go/issues/3640)) ([8eede84](https://www.github.com/googleapis/google-cloud-go/commit/8eede8411a5521f45a5c3f8091c42b3c5407ea90)), refs [#3639](https://www.github.com/googleapis/google-cloud-go/issues/3639) * **spanner/spansql:** fix SelectFromJoin behavior ([#3571](https://www.github.com/googleapis/google-cloud-go/issues/3571)) ([e0887c7](https://www.github.com/googleapis/google-cloud-go/commit/e0887c762a4c58f29b3e5b49ee163a36a065463c)) ## [1.13.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.12.0...v1.13.0) (2021-01-15) ### Features * **spanner/spannertest:** implement ANY_VALUE aggregation function ([#3428](https://www.github.com/googleapis/google-cloud-go/issues/3428)) ([e16c3e9](https://www.github.com/googleapis/google-cloud-go/commit/e16c3e9b412762b85483f3831ee586a5e6631313)) * **spanner/spannertest:** implement FULL JOIN ([#3218](https://www.github.com/googleapis/google-cloud-go/issues/3218)) ([99f7212](https://www.github.com/googleapis/google-cloud-go/commit/99f7212bd70bb333c1aa1c7a57348b4dfd80d31b)) * **spanner/spannertest:** implement SELECT ... FROM UNNEST(...) ([#3431](https://www.github.com/googleapis/google-cloud-go/issues/3431)) ([deb466f](https://www.github.com/googleapis/google-cloud-go/commit/deb466f497a1e6df78fcad57c3b90b1a4ccd93b4)) * **spanner/spannertest:** support array literals ([#3438](https://www.github.com/googleapis/google-cloud-go/issues/3438)) ([69e0110](https://www.github.com/googleapis/google-cloud-go/commit/69e0110f4977035cd1a705c3034c3ba96cadf36f)) * **spanner/spannertest:** support AVG aggregation function ([#3286](https://www.github.com/googleapis/google-cloud-go/issues/3286)) ([4788415](https://www.github.com/googleapis/google-cloud-go/commit/4788415c908f58c1cc08c951f1a7f17cdaf35aa2)) * **spanner/spannertest:** support Not Null constraint ([#3491](https://www.github.com/googleapis/google-cloud-go/issues/3491)) ([c36aa07](https://www.github.com/googleapis/google-cloud-go/commit/c36aa0785e798b9339d540e691850ca3c474a288)) * **spanner/spannertest:** support UPDATE DML ([#3201](https://www.github.com/googleapis/google-cloud-go/issues/3201)) ([1dec6f6](https://www.github.com/googleapis/google-cloud-go/commit/1dec6f6a31768a3f70bfec7274828301c22ea10b)) * **spanner/spansql:** define structures and parse UPDATE DML statements ([#3192](https://www.github.com/googleapis/google-cloud-go/issues/3192)) ([23b6904](https://www.github.com/googleapis/google-cloud-go/commit/23b69042c58489df512703259f54d075ba0c0722)) * **spanner/spansql:** support DATE and TIMESTAMP literals ([#3557](https://www.github.com/googleapis/google-cloud-go/issues/3557)) ([1961930](https://www.github.com/googleapis/google-cloud-go/commit/196193034a15f84dc3d3c27901990e8be77fca85)) * **spanner/spansql:** support for parsing generated columns ([#3373](https://www.github.com/googleapis/google-cloud-go/issues/3373)) ([9b1d06f](https://www.github.com/googleapis/google-cloud-go/commit/9b1d06fc90a4c07899c641a893dba0b47a1cead9)) * **spanner/spansql:** support NUMERIC data type ([#3411](https://www.github.com/googleapis/google-cloud-go/issues/3411)) ([1bc65d9](https://www.github.com/googleapis/google-cloud-go/commit/1bc65d9124ba22db5bec4c71b6378c27dfc04724)) * **spanner:** Add a DirectPath fallback integration test ([#3487](https://www.github.com/googleapis/google-cloud-go/issues/3487)) ([de821c5](https://www.github.com/googleapis/google-cloud-go/commit/de821c59fb81e9946216d205162b59de8b5ce71c)) * **spanner:** attempt DirectPath by default ([#3516](https://www.github.com/googleapis/google-cloud-go/issues/3516)) ([bbc61ed](https://www.github.com/googleapis/google-cloud-go/commit/bbc61ed368453b28aaf5bed627ca2499a3591f63)) * **spanner:** include User agent ([#3465](https://www.github.com/googleapis/google-cloud-go/issues/3465)) ([4e1ef1b](https://www.github.com/googleapis/google-cloud-go/commit/4e1ef1b3fb536ef950249cdee02cc0b6c2b56e86)) * **spanner:** run E2E test over DirectPath ([#3466](https://www.github.com/googleapis/google-cloud-go/issues/3466)) ([18e3a4f](https://www.github.com/googleapis/google-cloud-go/commit/18e3a4fe2a0c59c6295db2d85c7893ac51688083)) * **spanner:** support NUMERIC in mutations ([#3328](https://www.github.com/googleapis/google-cloud-go/issues/3328)) ([fa90737](https://www.github.com/googleapis/google-cloud-go/commit/fa90737a2adbe0cefbaba4aa1046a6efbba2a0e9)) ### Bug Fixes * **spanner:** fix session leak ([#3461](https://www.github.com/googleapis/google-cloud-go/issues/3461)) ([11fb917](https://www.github.com/googleapis/google-cloud-go/commit/11fb91711db5b941995737980cef7b48b611fefd)), refs [#3460](https://www.github.com/googleapis/google-cloud-go/issues/3460) ## [1.12.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.11.0...v1.12.0) (2020-11-10) ### Features * **spanner:** add metadata to RowIterator ([#3050](https://www.github.com/googleapis/google-cloud-go/issues/3050)) ([9a2289c](https://www.github.com/googleapis/google-cloud-go/commit/9a2289c3a38492bc2e84e0f4000c68a8718f5c11)), closes [#1805](https://www.github.com/googleapis/google-cloud-go/issues/1805) * **spanner:** export ToSpannerError ([#3133](https://www.github.com/googleapis/google-cloud-go/issues/3133)) ([b951d8b](https://www.github.com/googleapis/google-cloud-go/commit/b951d8bd194b76da0a8bf2ce7cf85b546d2e051c)), closes [#3122](https://www.github.com/googleapis/google-cloud-go/issues/3122) * **spanner:** support rw-transaction with options ([#3058](https://www.github.com/googleapis/google-cloud-go/issues/3058)) ([5130694](https://www.github.com/googleapis/google-cloud-go/commit/51306948eef9d26cff70453efc3eb500ddef9117)) * **spanner/spannertest:** make SELECT list aliases visible to ORDER BY ([#3054](https://www.github.com/googleapis/google-cloud-go/issues/3054)) ([7d2d83e](https://www.github.com/googleapis/google-cloud-go/commit/7d2d83ee1cce58d4014d5570bc599bcef1ed9c22)), closes [#3043](https://www.github.com/googleapis/google-cloud-go/issues/3043) ## v1.11.0 * Features: - feat(spanner): add KeySetFromKeys function (#2837) * Misc: - test(spanner): check for Aborted error (#3039) - test(spanner): fix potential race condition in TestRsdBlockingStates (#3017) - test(spanner): compare data instead of struct (#3013) - test(spanner): fix flaky oc_test.go (#2838) - docs(spanner): document NULL value (#2885) * spansql/spannertest: - Support JOINs (all but FULL JOIN) (#2936, #2924, #2896, #3042, #3037, #2995, #2945, #2931) - feat(spanner/spansql): parse CHECK constraints (#3046) - fix(spanner/spansql): fix parsing of unary minus and plus (#2997) - fix(spanner/spansql): fix parsing of adjacent inline and leading comments (#2851) - fix(spanner/spannertest): fix ORDER BY combined with SELECT aliases (#3043) - fix(spanner/spannertest): generate query output columns in construction order (#2990) - fix(spanner/spannertest): correct handling of NULL AND FALSE (#2991) - fix(spanner/spannertest): correct handling of tri-state boolean expression evaluation (#2983) - fix(spanner/spannertest): fix handling of NULL with LIKE operator (#2982) - test(spanner/spannertest): migrate most test code to integration_test.go (#2977) - test(spanner/spansql): add fuzz target for ParseQuery (#2909) - doc(spanner/spannertest): document the implementation (#2996) - perf(spanner/spannertest): speed up no-wait DDL changes (#2994) - perf(spanner/spansql): make fewer allocations during SQL (#2969) * Backward Incompatible Changes - chore(spanner/spansql): use ID type for identifiers throughout (#2889) - chore(spanner/spansql): restructure FROM, TABLESAMPLE (#2888) ## v1.10.0 * feat(spanner): add support for NUMERIC data type (#2415) * feat(spanner): add custom type support to spanner.Key (#2748) * feat(spanner/spannertest): add support for bool parameter types (#2674) * fix(spanner): update PDML to take sessions from pool (#2736) * spanner/spansql: update docs on TableAlteration, ColumnAlteration (#2825) * spanner/spannertest: support dropping columns (#2823) * spanner/spannertest: implement GetDatabase (#2802) * spanner/spannertest: fix aggregation in query evaluation for empty inputs (#2803) ## v1.9.0 * Features: - feat(spanner): support custom field type (#2614) * Bugfixes: - fix(spanner): call ctx.cancel after stats have been recorded (#2728) - fix(spanner): retry session not found for read (#2724) - fix(spanner): specify credentials with SPANNER_EMULATOR_HOST (#2701) - fix(spanner): update pdml to retry EOS internal error (#2678) * Misc: - test(spanner): unskip tests for emulator (#2675) * spansql/spannertest: - spanner/spansql: restructure types and parsing for column options (#2656) - spanner/spannertest: return error for Read with no keys (#2655) ## v1.8.0 * Features: - feat(spanner): support of client-level custom retry settings (#2599) - feat(spanner): add a statement-based way to run read-write transaction. (#2545) * Bugfixes: - fix(spanner): set 'gccl' to the request header. (#2609) - fix(spanner): add the missing resource prefix (#2605) - fix(spanner): fix the upgrade of protobuf. (#2583) - fix(spanner): do not copy protobuf messages by value. (#2581) - fix(spanner): fix the required resource prefix. (#2580) - fix(spanner): add extra field to ignore with cmp (#2577) - fix(spanner): remove appengine-specific numChannels. (#2513) * Misc: - test(spanner): log warning instead of fail for stress test (#2559) - test(spanner): fix failed TestRsdBlockingStates test (#2597) - chore(spanner): cleanup mockserver and mockclient (#2414) ## v1.7.0 * Retry: - Only retry certain types of internal errors. (#2460) * Tracing/metrics: - Never sample `ping()` trace spans (#2520) - Add oc tests for session pool metrics. (#2416) * Encoding: - Allow encoding struct with custom types to mutation (#2529) * spannertest: - Fix evaluation on IN (#2479) - Support MIN/MAX aggregation functions (#2411) * Misc: - Fix TestClient_WithGRPCConnectionPoolAndNumChannels_Misconfigured test (#2539) - Cleanup backoff files and rename a variable (#2526) - Fix TestIntegration_DML test to return err from tx (#2509) - Unskip tests for emulator 0.8.0. (#2494) - Fix TestIntegration_StartBackupOperation test. (#2418) - Fix flakiness in TestIntegration_BatchDML_Error - Unskip TestIntegration_BatchDML and TestIntegration_BatchDML_TwoStatements for emulator by checking the existence of status. - Fix TestStressSessionPool test by taking lock while getting sessions from hc. ## v1.6.0 * Sessions: - Increase the number of sessions in batches instead of one by one when additional sessions are needed. The step size is set to 25, which means that whenever the session pool needs at least one more session, it will create a batch of 25 sessions. * Emulator: - Run integration tests against the emulator in Kokoro Presubmit. * RPC retrying: - Retry CreateDatabase on retryable codes. * spannertest: - Change internal representation of DATE/TIMESTAMP values. * spansql: - Cleanly parse adjacent comment marker/terminator. - Support FROM aliases in SELECT statements. * Misc: - Fix comparing errors in tests. - Fix flaky session pool test. - Increase timeout in TestIntegration_ReadOnlyTransaction. - Fix incorrect instance IDs when deleting instances in tests. - Clean up test instances. - Clearify docs on Aborted transaction. - Fix timeout+staleness bound for test - Remove the support for resource-based routing. - Fix TestTransaction_SessionNotFound test. ## v1.5.1 * Fix incorrect decreasing metrics, numReads and numWrites. * Fix an issue that XXX fields/methods are internal to proto and may change at any time. XXX_Merge panics in proto v1.4.0. Use proto.Merge instead of XXX_Merge. * spannertest: handle list parameters in RPC interfacea. ## v1.5.0 * Metrics - Instrument client library with adding OpenCensus metrics. This allows for better monitoring of the session pool. * Session management - Switch the session keepalive method from GetSession to SELECT 1. * Emulator - Use client hooks for admin clients running against an emulator. With this change, users can use SPANNER_EMULATOR_HOST for initializing admin clients when running against an emulator. * spansql - Add space between constraint name and foreign key def. * Misc - Fix segfault when a non-existent credentials file had been specified. - Fix cleaning up instances in integration tests. - Fix race condition in batch read-only transaction. - Fix the flaky TestLIFOTakeWriteSessionOrder test. - Fix ITs to order results in SELECT queries. - Fix the documentation of timestamp bounds. - Fix the regex issue in managing backups. ## v1.4.0 - Support managed backups. This includes the API methods for CreateBackup, GetBackup, UpdateBackup, DeleteBackup and others. Also includes a simple wrapper in DatabaseAdminClient to create a backup. - Update the healthcheck interval. The default interval is updated to 50 mins. By default, the first healthcheck is scheduled between 10 and 55 mins and the subsequent healthchecks are between 45 and 55 mins. This update avoids overloading the backend service with frequent healthchecking. ## v1.3.0 * Query options: - Adds the support of providing query options (optimizer version) via three ways (precedence follows the order): `client-level < environment variables < query-level`. The environment variable is set by "SPANNER_OPTIMIZER_VERSION". * Connection pooling: - Use the new connection pooling in gRPC. This change deprecates `ClientConfig.numChannels` and users should move to `WithGRPCConnectionPool(numChannels)` at their earliest convenience. Example: ```go // numChannels (deprecated): err, client := NewClientWithConfig(ctx, database, ClientConfig{NumChannels: 8}) // gRPC connection pool: err, client := NewClientWithConfig(ctx, database, ClientConfig{}, option.WithGRPCConnectionPool(8)) ``` * Error handling: - Do not rollback after failed commit. - Return TransactionOutcomeUnknownError if a DEADLINE_EXCEEDED or CANCELED error occurs while a COMMIT request is in flight. * spansql: - Added support for IN expressions and OFFSET clauses. - Fixed parsing of table constraints. - Added support for foreign key constraints in ALTER TABLE and CREATE TABLE. - Added support for GROUP BY clauses. * spannertest: - Added support for IN expressions and OFFSET clauses. - Added support for GROUP BY clauses. - Fixed data race in query execution. - No longer rejects reads specifying an index to use. - Return last commit timestamp as read timestamp when requested. - Evaluate add, subtract, multiply, divide, unary negation, unary not, bitwise and/xor/or operations, as well as reporting column types for expressions involving any possible arithmetic operator.arithmetic expressions. - Fixed handling of descending primary keys. * Misc: - Change default healthcheck interval to 30 mins to reduce the GetSession calls made to the backend. - Add marshal/unmarshal json for nullable types to support NullString, NullInt64, NullFloat64, NullBool, NullTime, NullDate. - Use ResourceInfo to extract error. - Extract retry info from status. ## v1.2.1 - Fix session leakage for ApplyAtLeastOnce. Previously session handles where leaked whenever Commit() returned a non-abort, non-session-not-found error, due to a missing recycle() call. - Fix error for WriteStruct with pointers. This fixes a specific check for encoding and decoding to pointer types. - Fix a GRPCStatus issue that returns a Status that has Unknown code if the base error is nil. Now, it always returns a Status based on Code field of current error. ## v1.2.0 - Support tracking stacktrace of sessionPool.take() that allows the user to instruct the session pool to keep track of the stacktrace of each goroutine that checks out a session from the pool. This is disabled by default, but it can be enabled by setting `SessionPoolConfig.TrackSessionHandles: true`. - Add resource-based routing that includes a step to retrieve the instance-specific endpoint before creating the session client when creating a new spanner client. This is disabled by default, but it can be enabled by setting `GOOGLE_CLOUD_SPANNER_ENABLE_RESOURCE_BASED_ROUTING`. - Make logger configurable so that the Spanner client can now be configured to use a specific logger instead of the standard logger. - Support encoding custom types that point back to supported basic types. - Allow decoding Spanner values to custom types that point back to supported types. ## v1.1.0 - The String() method of NullString, NullTime and NullDate will now return an unquoted string instead of a quoted string. This is a BREAKING CHANGE. If you relied on the old behavior, please use fmt.Sprintf("%q", T). - The Spanner client will now use the new BatchCreateSessions RPC to initialize the session pool. This will improve the startup time of clients that are initialized with a minimum number of sessions greater than zero (i.e. SessionPoolConfig.MinOpened>0). - Spanner clients that are created with the NewClient method will now default to a minimum of 100 opened sessions in the pool (i.e. SessionPoolConfig.MinOpened=100). This will improve the performance of the first transaction/query that is executed by an application, as a session will normally not have to be created as part of the transaction. Spanner clients that are created with the NewClientWithConfig method are not affected by this change. - Spanner clients that are created with the NewClient method will now default to a write sessions fraction of 0.2 in the pool (i.e. SessionPoolConfig.WriteSessions=0.2). Spanner clients that are created with the NewClientWithConfig method are not affected by this change. - The session pool maintenance worker has been improved so it keeps better track of the actual number of sessions needed. It will now less often delete and re-create sessions. This can improve the overall performance of applications with a low transaction rate. ## v1.0.0 This is the first tag to carve out spanner as its own module. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/spanner/CHANGES.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/spanner/CHANGES.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 70535 }
## Cloud Spanner [![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/spanner.svg)](https://pkg.go.dev/cloud.google.com/go/spanner) - [About Cloud Spanner](https://cloud.google.com/spanner/) - [API documentation](https://cloud.google.com/spanner/docs) - [Go client documentation](https://pkg.go.dev/cloud.google.com/go/spanner) ### Example Usage First create a `spanner.Client` to use throughout your application: [snip]:# (spanner-1) ```go client, err := spanner.NewClient(ctx, "projects/P/instances/I/databases/D") if err != nil { log.Fatal(err) } ``` [snip]:# (spanner-2) ```go // Simple Reads And Writes _, err = client.Apply(ctx, []*spanner.Mutation{ spanner.Insert("Users", []string{"name", "email"}, []interface{}{"alice", "[email protected]"})}) if err != nil { log.Fatal(err) } row, err := client.Single().ReadRow(ctx, "Users", spanner.Key{"alice"}, []string{"email"}) if err != nil { log.Fatal(err) } ``` ### Session Leak A `Client` object of the Client Library has a limit on the number of maximum sessions. For example the default value of `MaxOpened`, which is the maximum number of sessions allowed by the session pool in the Golang Client Library, is 400. You can configure these values at the time of creating a `Client` by passing custom `SessionPoolConfig` as part of `ClientConfig`. When all the sessions are checked out of the session pool, every new transaction has to wait until a session is returned to the pool. If a session is never returned to the pool (hence causing a session leak), the transactions will have to wait indefinitely and your application will be blocked. #### Common Root Causes The most common reason for session leaks in the Golang client library are: 1. Not stopping a `RowIterator` that is returned by `Query`, `Read` and other methods. Always use `RowIterator.Stop()` to ensure that the `RowIterator` is always closed. 2. Not closing a `ReadOnlyTransaction` when you no longer need it. Always call `ReadOnlyTransaction.Close()` after use, to ensure that the `ReadOnlyTransaction` is always closed. As shown in the example below, the `txn.Close()` statement releases the session after it is complete. If you fail to call `txn.Close()`, the session is not released back to the pool. The recommended way is to use `defer` as shown below. ```go client, err := spanner.NewClient(ctx, "projects/P/instances/I/databases/D") if err != nil { log.Fatal(err) } txn := client.ReadOnlyTransaction() defer txn.Close() ``` #### Debugging and Resolving Session Leaks ##### Logging inactive transactions This option logs warnings when you have exhausted >95% of your session pool. It is enabled by default. This could mean two things; either you need to increase the max sessions in your session pool (as the number of queries run using the client side database object is greater than your session pool can serve), or you may have a session leak. To help debug which transactions may be causing this session leak, the logs will also contain stack traces of transactions which have been running longer than expected if `TrackSessionHandles` under `SessionPoolConfig` is enabled. ```go sessionPoolConfig := spanner.SessionPoolConfig{ TrackSessionHandles: true, InactiveTransactionRemovalOptions: spanner.InactiveTransactionRemovalOptions{ ActionOnInactiveTransaction: spanner.Warn, }, } client, err := spanner.NewClientWithConfig( ctx, database, spanner.ClientConfig{SessionPoolConfig: sessionPoolConfig}, ) if err != nil { log.Fatal(err) } defer client.Close() // Example Log message to warn presence of long running transactions // session <session-info> checked out of pool at <session-checkout-time> is long running due to possible session leak for goroutine // <Stack Trace of transaction> ``` ##### Automatically clean inactive transactions When the option to automatically clean inactive transactions is enabled, the client library will automatically detect problematic transactions that are running for a very long time (thus causing session leaks) and close them. The session will be removed from the pool and be replaced by a new session. To dig deeper into which transactions are being closed, you can check the logs to see the stack trace of the transactions which might be causing these leaks and further debug them. ```go sessionPoolConfig := spanner.SessionPoolConfig{ TrackSessionHandles: true, InactiveTransactionRemovalOptions: spanner.InactiveTransactionRemovalOptions{ ActionOnInactiveTransaction: spanner.WarnAndClose, }, } client, err := spanner.NewClientWithConfig( ctx, database, spanner.ClientConfig{SessionPoolConfig: sessionPoolConfig}, ) if err != nil { log.Fatal(err) } defer client.Close() // Example Log message for when transaction is recycled // session <session-info> checked out of pool at <session-checkout-time> is long running and will be removed due to possible session leak for goroutine // <Stack Trace of transaction> ```
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/spanner/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/spanner/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 4963 }
# Changes ## [1.40.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.39.1...storage/v1.40.0) (2024-03-29) ### Features * **storage:** Implement io.WriterTo in Reader ([#9659](https://github.com/googleapis/google-cloud-go/issues/9659)) ([8264a96](https://github.com/googleapis/google-cloud-go/commit/8264a962d1c21d52e8fca50af064c5535c3708d3)) * **storage:** New storage control client ([#9631](https://github.com/googleapis/google-cloud-go/issues/9631)) ([1f4d279](https://github.com/googleapis/google-cloud-go/commit/1f4d27957743878976d6b4549cc02a5bb894d330)) ### Bug Fixes * **storage:** Retry errors from last recv on uploads ([#9616](https://github.com/googleapis/google-cloud-go/issues/9616)) ([b6574aa](https://github.com/googleapis/google-cloud-go/commit/b6574aa42ebad0532c2749b6ece879b932f95cb9)) * **storage:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a)) ### Performance Improvements * **storage:** Remove protobuf's copy of data on unmarshalling ([#9526](https://github.com/googleapis/google-cloud-go/issues/9526)) ([81281c0](https://github.com/googleapis/google-cloud-go/commit/81281c04e503fd83301baf88cc352c77f5d476ca)) ## [1.39.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.39.0...storage/v1.39.1) (2024-03-11) ### Bug Fixes * **storage:** Add object validation case and test ([#9521](https://github.com/googleapis/google-cloud-go/issues/9521)) ([386bef3](https://github.com/googleapis/google-cloud-go/commit/386bef319b4678beaa926ddfe4edef190f11b68d)) ## [1.39.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.38.0...storage/v1.39.0) (2024-02-29) ### Features * **storage:** Make it possible to disable Content-Type sniffing ([#9431](https://github.com/googleapis/google-cloud-go/issues/9431)) ([0676670](https://github.com/googleapis/google-cloud-go/commit/067667058c06689b64401be11858d84441584039)) ## [1.38.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.37.0...storage/v1.38.0) (2024-02-12) ### Features * **storage:** Support auto-detection of access ID for external_account creds ([#9208](https://github.com/googleapis/google-cloud-go/issues/9208)) ([b958d44](https://github.com/googleapis/google-cloud-go/commit/b958d44589f2b6b226ea3bef23829ac75a0aa6a6)) * **storage:** Support custom hostname for VirtualHostedStyle SignedURLs ([#9348](https://github.com/googleapis/google-cloud-go/issues/9348)) ([7eec40e](https://github.com/googleapis/google-cloud-go/commit/7eec40e4cf82c53e5bf02bd2c14e0b25043da6d0)) * **storage:** Support universe domains ([#9344](https://github.com/googleapis/google-cloud-go/issues/9344)) ([29a7498](https://github.com/googleapis/google-cloud-go/commit/29a7498b8eb0d00fdb5acd7ee8ce0e5a2a8c11ce)) ### Bug Fixes * **storage:** Fix v4 url signing for hosts that specify ports ([#9347](https://github.com/googleapis/google-cloud-go/issues/9347)) ([f127b46](https://github.com/googleapis/google-cloud-go/commit/f127b4648f861c1ba44f41a280a62652620c04c2)) ### Documentation * **storage:** Indicate that gRPC is incompatible with universe domains ([#9386](https://github.com/googleapis/google-cloud-go/issues/9386)) ([e8bd85b](https://github.com/googleapis/google-cloud-go/commit/e8bd85bbce12d5f7ab87fa49d166a6a0d84bd12d)) ## [1.37.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.36.0...storage/v1.37.0) (2024-01-24) ### Features * **storage:** Add maxAttempts RetryOption ([#9215](https://github.com/googleapis/google-cloud-go/issues/9215)) ([e348cc5](https://github.com/googleapis/google-cloud-go/commit/e348cc5340e127b530e8ee4664fd995e6f038b2c)) * **storage:** Support IncludeFoldersAsPrefixes ([#9211](https://github.com/googleapis/google-cloud-go/issues/9211)) ([98c9d71](https://github.com/googleapis/google-cloud-go/commit/98c9d7157306de5134547a67c084c248484c9a51)) ### Bug Fixes * **storage:** Migrate deprecated proto dep ([#9232](https://github.com/googleapis/google-cloud-go/issues/9232)) ([ebbb610](https://github.com/googleapis/google-cloud-go/commit/ebbb610e0f58035fd01ad7893971382d8bbd092f)), refs [#9189](https://github.com/googleapis/google-cloud-go/issues/9189) ## [1.36.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.35.1...storage/v1.36.0) (2023-12-14) ### Features * **storage:** Add object retention feature ([#9072](https://github.com/googleapis/google-cloud-go/issues/9072)) ([16ecfd1](https://github.com/googleapis/google-cloud-go/commit/16ecfd150ff1982f03d207a80a82e934d1013874)) ### Bug Fixes * **storage:** Do not inhibit the dead code elimination. ([#8543](https://github.com/googleapis/google-cloud-go/issues/8543)) ([ca2493f](https://github.com/googleapis/google-cloud-go/commit/ca2493f43c299bbaed5f7e5b70f66cc763ff9802)) * **storage:** Set flush and get_state to false on the last write in gRPC ([#9013](https://github.com/googleapis/google-cloud-go/issues/9013)) ([c1e9fe5](https://github.com/googleapis/google-cloud-go/commit/c1e9fe5f4166a71e55814ccf126926ec0e0e7945)) ## [1.35.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.35.0...storage/v1.35.1) (2023-11-09) ### Bug Fixes * **storage:** Rename aux.go to auxiliary.go fixing windows build ([ba23673](https://github.com/googleapis/google-cloud-go/commit/ba23673da7707c31292e4aa29d65b7ac1446d4a6)) ## [1.35.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.34.1...storage/v1.35.0) (2023-11-09) ### Features * **storage:** Change gRPC writes to use bi-directional streams ([#8930](https://github.com/googleapis/google-cloud-go/issues/8930)) ([3e23a36](https://github.com/googleapis/google-cloud-go/commit/3e23a364b1a20c4fda7aef257e4136586ec769a4)) ## [1.34.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.34.0...storage/v1.34.1) (2023-11-01) ### Bug Fixes * **storage:** Bump google.golang.org/api to v0.149.0 ([8d2ab9f](https://github.com/googleapis/google-cloud-go/commit/8d2ab9f320a86c1c0fab90513fc05861561d0880)) ## [1.34.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.33.0...storage/v1.34.0) (2023-10-31) ### Features * **storage/internal:** Add match_glob field to ListObjectsRequest ([#8618](https://github.com/googleapis/google-cloud-go/issues/8618)) ([e9ae601](https://github.com/googleapis/google-cloud-go/commit/e9ae6018983ae09781740e4ff939e6e365863dbb)) * **storage/internal:** Add terminal_storage_class fields to Autoclass message ([57fc1a6](https://github.com/googleapis/google-cloud-go/commit/57fc1a6de326456eb68ef25f7a305df6636ed386)) * **storage/internal:** Adds the RestoreObject operation ([56ce871](https://github.com/googleapis/google-cloud-go/commit/56ce87195320634b07ae0b012efcc5f2b3813fb0)) * **storage:** Support autoclass v2.1 ([#8721](https://github.com/googleapis/google-cloud-go/issues/8721)) ([fe1e195](https://github.com/googleapis/google-cloud-go/commit/fe1e19590a252c6adc6ca6c51a69b6e561e143b8)) * **storage:** Support MatchGlob for gRPC ([#8670](https://github.com/googleapis/google-cloud-go/issues/8670)) ([3df0287](https://github.com/googleapis/google-cloud-go/commit/3df0287f88d5e2c4526e9e6b8dc2a4ca54f88918)), refs [#7727](https://github.com/googleapis/google-cloud-go/issues/7727) ### Bug Fixes * **storage:** Drop stream reference after closing it for gRPC writes ([#8872](https://github.com/googleapis/google-cloud-go/issues/8872)) ([525abde](https://github.com/googleapis/google-cloud-go/commit/525abdee433864d4d456f1f1fff5599017b557ff)) * **storage:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d)) * **storage:** Update grpc-go to v1.56.3 ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c)) * **storage:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7)) ## [1.33.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.32.0...storage/v1.33.0) (2023-09-07) ### Features * **storage:** Export gRPC client constructor ([#8509](https://github.com/googleapis/google-cloud-go/issues/8509)) ([1a928ae](https://github.com/googleapis/google-cloud-go/commit/1a928ae205f2325cb5206304af4d609dc3c1447a)) ## [1.32.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.31.0...storage/v1.32.0) (2023-08-15) ### Features * **storage:** Add support for custom headers ([#8294](https://github.com/googleapis/google-cloud-go/issues/8294)) ([313fd4a](https://github.com/googleapis/google-cloud-go/commit/313fd4a60380d36c5ecaead3e968dbc84d044a0b)) * **storage:** Add trace span to Writer ([#8375](https://github.com/googleapis/google-cloud-go/issues/8375)) ([f7ac85b](https://github.com/googleapis/google-cloud-go/commit/f7ac85bec2806d351529714bd7744a91a9fdefdd)), refs [#6144](https://github.com/googleapis/google-cloud-go/issues/6144) * **storage:** Support single-shot uploads in gRPC ([#8348](https://github.com/googleapis/google-cloud-go/issues/8348)) ([7de4a7d](https://github.com/googleapis/google-cloud-go/commit/7de4a7da31ab279a343b1592b15a126cda03e5e7)), refs [#7798](https://github.com/googleapis/google-cloud-go/issues/7798) * **storage:** Trace span covers life of a Reader ([#8390](https://github.com/googleapis/google-cloud-go/issues/8390)) ([8de30d7](https://github.com/googleapis/google-cloud-go/commit/8de30d752eec2fed2ea4c127482d3e213f9050e2)) ### Bug Fixes * **storage:** Fix AllObjects condition in gRPC ([#8184](https://github.com/googleapis/google-cloud-go/issues/8184)) ([2b99e4f](https://github.com/googleapis/google-cloud-go/commit/2b99e4f39be20fe21e8bc5c1ec1c0e758222c46e)), refs [#6205](https://github.com/googleapis/google-cloud-go/issues/6205) * **storage:** Fix gRPC generation/condition issues ([#8396](https://github.com/googleapis/google-cloud-go/issues/8396)) ([ca68ff5](https://github.com/googleapis/google-cloud-go/commit/ca68ff54b680732b59b223655070d0f6abccefee)) * **storage:** Same method name and Trace Span name ([#8150](https://github.com/googleapis/google-cloud-go/issues/8150)) ([e277213](https://github.com/googleapis/google-cloud-go/commit/e2772133896bb94097b5d1f090f1bcafd136f2ed)) * **storage:** Update gRPC retry codes ([#8202](https://github.com/googleapis/google-cloud-go/issues/8202)) ([afdf772](https://github.com/googleapis/google-cloud-go/commit/afdf772fc6a90b3010eee9d70ab65e22e276f53f)) ## [1.31.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.30.1...storage/v1.31.0) (2023-06-27) ### Features * **storage/internal:** Add ctype=CORD for ChecksummedData.content ([ca94e27](https://github.com/googleapis/google-cloud-go/commit/ca94e2724f9e2610b46aefd0a3b5ddc06102e91b)) * **storage:** Add support for MatchGlob ([#8097](https://github.com/googleapis/google-cloud-go/issues/8097)) ([9426a5a](https://github.com/googleapis/google-cloud-go/commit/9426a5a45d4c2fd07f84261f6d602680e79cdc48)), refs [#7727](https://github.com/googleapis/google-cloud-go/issues/7727) [#7728](https://github.com/googleapis/google-cloud-go/issues/7728) * **storage:** Respect WithEndpoint for SignedURLs and PostPolicy ([#8113](https://github.com/googleapis/google-cloud-go/issues/8113)) ([f918f23](https://github.com/googleapis/google-cloud-go/commit/f918f23a3cda4fbc8d709e32b914ead8b735d664)) * **storage:** Update all direct dependencies ([b340d03](https://github.com/googleapis/google-cloud-go/commit/b340d030f2b52a4ce48846ce63984b28583abde6)) ### Bug Fixes * **storage:** Fix CreateBucket logic for gRPC ([#8165](https://github.com/googleapis/google-cloud-go/issues/8165)) ([8424e7e](https://github.com/googleapis/google-cloud-go/commit/8424e7e145a117c91006318fa924a8b2643c1c7e)), refs [#8162](https://github.com/googleapis/google-cloud-go/issues/8162) * **storage:** Fix reads with "./" in object names [XML] ([#8017](https://github.com/googleapis/google-cloud-go/issues/8017)) ([6b7b21f](https://github.com/googleapis/google-cloud-go/commit/6b7b21f8a334b6ad3a25e1f66ae1265b4d1f0995)) * **storage:** Fix routing header for writes ([#8159](https://github.com/googleapis/google-cloud-go/issues/8159)) ([42a59f5](https://github.com/googleapis/google-cloud-go/commit/42a59f5a23ab9b4743ab032ad92304922c801d93)), refs [#8142](https://github.com/googleapis/google-cloud-go/issues/8142) [#8143](https://github.com/googleapis/google-cloud-go/issues/8143) [#8144](https://github.com/googleapis/google-cloud-go/issues/8144) [#8145](https://github.com/googleapis/google-cloud-go/issues/8145) [#8149](https://github.com/googleapis/google-cloud-go/issues/8149) * **storage:** REST query UpdateMask bug ([df52820](https://github.com/googleapis/google-cloud-go/commit/df52820b0e7721954809a8aa8700b93c5662dc9b)) * **storage:** Update grpc to v1.55.0 ([1147ce0](https://github.com/googleapis/google-cloud-go/commit/1147ce02a990276ca4f8ab7a1ab65c14da4450ef)) ### Documentation * **storage/internal:** Clarifications about behavior of DeleteObject RPC ([3f1ed9c](https://github.com/googleapis/google-cloud-go/commit/3f1ed9c63fb115f47607a3ab478842fe5ba0df11)) * **storage/internal:** Clarified the behavior of supplying bucket.name field in CreateBucket to reflect actual implementation ([ebae64d](https://github.com/googleapis/google-cloud-go/commit/ebae64d53397ec5dfe851f098754eaa1f5df7cb1)) * **storage/internal:** Revert ChecksummedData message definition not to specify ctype=CORD, because it would be a breaking change. ([ef61e47](https://github.com/googleapis/google-cloud-go/commit/ef61e4799280a355b960da8ae240ceb2efbe71ac)) * **storage/internal:** Update routing annotations for CancelResumableWriteRequest and QueryWriteStatusRequest ([4900851](https://github.com/googleapis/google-cloud-go/commit/49008518e168fe6f7891b907d6fc14eecdef758c)) * **storage/internal:** Updated ChecksummedData message definition to specify ctype=CORD, and removed incorrect earlier attempt that set that annotation in the ReadObjectResponse message definition ([ef61e47](https://github.com/googleapis/google-cloud-go/commit/ef61e4799280a355b960da8ae240ceb2efbe71ac)) * **storage:** WithXMLReads should mention XML instead of JSON API ([#7881](https://github.com/googleapis/google-cloud-go/issues/7881)) ([36f56c8](https://github.com/googleapis/google-cloud-go/commit/36f56c80c456ca74ffc03df76844ce15980ced82)) ## [1.30.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.30.0...storage/v1.30.1) (2023-03-21) ### Bug Fixes * **storage:** Retract versions with Copier bug ([#7583](https://github.com/googleapis/google-cloud-go/issues/7583)) ([9c10b6f](https://github.com/googleapis/google-cloud-go/commit/9c10b6f8a54cb8447260148b5e4a9b5160281020)) * Versions v1.25.0-v1.27.0 are retracted due to [#6857](https://github.com/googleapis/google-cloud-go/issues/6857). * **storage:** SignedURL v4 allows headers with colons in value ([#7603](https://github.com/googleapis/google-cloud-go/issues/7603)) ([6b50f9b](https://github.com/googleapis/google-cloud-go/commit/6b50f9b368f5b271ade1706c342865cef46712e6)) ## [1.30.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.29.0...storage/v1.30.0) (2023-03-15) ### Features * **storage/internal:** Update routing annotation for CreateBucketRequest docs: Add support for end-to-end checksumming in the gRPC WriteObject flow feat!: BREAKING CHANGE - renaming Notification to NotificationConfig ([2fef56f](https://github.com/googleapis/google-cloud-go/commit/2fef56f75a63dc4ff6e0eea56c7b26d4831c8e27)) * **storage:** Json downloads ([#7158](https://github.com/googleapis/google-cloud-go/issues/7158)) ([574a86c](https://github.com/googleapis/google-cloud-go/commit/574a86c614445f8c3f5a54446820df774c31cd47)) * **storage:** Update iam and longrunning deps ([91a1f78](https://github.com/googleapis/google-cloud-go/commit/91a1f784a109da70f63b96414bba8a9b4254cddd)) ### Bug Fixes * **storage:** Specify credentials with STORAGE_EMULATOR_HOST ([#7271](https://github.com/googleapis/google-cloud-go/issues/7271)) ([940ae15](https://github.com/googleapis/google-cloud-go/commit/940ae15f725ff384e345e627feb03d22e1fd8db5)) ## [1.29.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.28.1...storage/v1.29.0) (2023-01-19) ### Features * **storage:** Add ComponentCount as part of ObjectAttrs ([#7230](https://github.com/googleapis/google-cloud-go/issues/7230)) ([a19bca6](https://github.com/googleapis/google-cloud-go/commit/a19bca60704b4fbb674cf51d828580aa653c8210)) * **storage:** Add REST client ([06a54a1](https://github.com/googleapis/google-cloud-go/commit/06a54a16a5866cce966547c51e203b9e09a25bc0)) ### Documentation * **storage/internal:** Corrected typos and spellings ([7357077](https://github.com/googleapis/google-cloud-go/commit/735707796d81d7f6f32fc3415800c512fe62297e)) ## [1.28.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.28.0...storage/v1.28.1) (2022-12-02) ### Bug Fixes * **storage:** downgrade some dependencies ([7540152](https://github.com/googleapis/google-cloud-go/commit/754015236d5af7c82a75da218b71a87b9ead6eb5)) ## [1.28.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.27.0...storage/v1.28.0) (2022-11-03) ### Features * **storage/internal:** Add routing annotations ([ce3f945](https://github.com/googleapis/google-cloud-go/commit/ce3f9458e511eca0910992763232abbcd64698f1)) * **storage:** Add Autoclass support ([#6828](https://github.com/googleapis/google-cloud-go/issues/6828)) ([f7c7f41](https://github.com/googleapis/google-cloud-go/commit/f7c7f41e4d7fcffe05860e1114cb20f40c869da8)) ### Bug Fixes * **storage:** Fix read-write race in Writer.Write ([#6817](https://github.com/googleapis/google-cloud-go/issues/6817)) ([4766d3e](https://github.com/googleapis/google-cloud-go/commit/4766d3e1004119b93c6bd352024b5bf3404252eb)) * **storage:** Fix request token passing for Copier.Run ([#6863](https://github.com/googleapis/google-cloud-go/issues/6863)) ([faaab06](https://github.com/googleapis/google-cloud-go/commit/faaab066d8e509dc440bcbc87391557ecee7dbf2)), refs [#6857](https://github.com/googleapis/google-cloud-go/issues/6857) ### Documentation * **storage:** Update broken links for SignURL and PostPolicy ([#6779](https://github.com/googleapis/google-cloud-go/issues/6779)) ([776138b](https://github.com/googleapis/google-cloud-go/commit/776138bc06a1e5fd45acbf8f9d36e9dc6ce31dd3)) ## [1.27.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.26.0...storage/v1.27.0) (2022-09-22) ### Features * **storage:** Find GoogleAccessID when using impersonated creds ([#6591](https://github.com/googleapis/google-cloud-go/issues/6591)) ([a2d16a7](https://github.com/googleapis/google-cloud-go/commit/a2d16a7a778c85d13217fc67955ec5dac1da34e8)) ## [1.26.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.25.0...storage/v1.26.0) (2022-08-29) ### Features * **storage:** export ShouldRetry ([#6370](https://github.com/googleapis/google-cloud-go/issues/6370)) ([0da9ab0](https://github.com/googleapis/google-cloud-go/commit/0da9ab0831540569dc04c0a23437b084b1564e15)), refs [#6362](https://github.com/googleapis/google-cloud-go/issues/6362) ### Bug Fixes * **storage:** allow to use age=0 in OLM conditions ([#6204](https://github.com/googleapis/google-cloud-go/issues/6204)) ([c85704f](https://github.com/googleapis/google-cloud-go/commit/c85704f4284626ce728cb48f3b130f2ce2a0165e)) ## [1.25.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.24.0...storage/v1.25.0) (2022-08-11) ### Features * **storage/internal:** Add routing annotations ([8a8ba85](https://github.com/googleapis/google-cloud-go/commit/8a8ba85311f85701c97fd7c10f1d88b738ce423f)) * **storage:** refactor to use transport-agnostic interface ([#6465](https://github.com/googleapis/google-cloud-go/issues/6465)) ([d03c3e1](https://github.com/googleapis/google-cloud-go/commit/d03c3e15a79fe9afa1232d9c8bd4c484a9bb927e)) ## [1.24.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.23.0...storage/v1.24.0) (2022-07-20) ### Features * **storage:** add Custom Placement Config Dual Region Support ([#6294](https://github.com/googleapis/google-cloud-go/issues/6294)) ([5a8c607](https://github.com/googleapis/google-cloud-go/commit/5a8c607e3a9a3265887e27cb13f8943f3e3fa23d)) ## [1.23.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.22.1...storage/v1.23.0) (2022-06-23) ### Features * **storage:** add support for OLM Prefix/Suffix ([#5929](https://github.com/googleapis/google-cloud-go/issues/5929)) ([ec21d10](https://github.com/googleapis/google-cloud-go/commit/ec21d10d6d1b01aa97a52560319775041707690d)) * **storage:** support AbortIncompleteMultipartUpload LifecycleAction ([#5812](https://github.com/googleapis/google-cloud-go/issues/5812)) ([fdec929](https://github.com/googleapis/google-cloud-go/commit/fdec929b9da6e01dda0ab3c72544d44d6bd82bd4)), refs [#5795](https://github.com/googleapis/google-cloud-go/issues/5795) ### Bug Fixes * **storage:** allow for Age *int64 type and int64 type ([#6230](https://github.com/googleapis/google-cloud-go/issues/6230)) ([cc7acb8](https://github.com/googleapis/google-cloud-go/commit/cc7acb8bffb31828e9e96d4834a65f9728494473)) ### [1.22.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.22.0...storage/v1.22.1) (2022-05-19) ### Bug Fixes * **storage:** bump genproto, remove deadcode ([#6059](https://github.com/googleapis/google-cloud-go/issues/6059)) ([bb10f9f](https://github.com/googleapis/google-cloud-go/commit/bb10f9faca57dc3b987e0fb601090887b3507f07)) * **storage:** remove field that no longer exists ([#6061](https://github.com/googleapis/google-cloud-go/issues/6061)) ([ee150cf](https://github.com/googleapis/google-cloud-go/commit/ee150cfd194463ddfcb59898cfb0237e47777973)) ## [1.22.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.21.0...storage/v1.22.0) (2022-03-31) ### Features * **storage:** allow specifying includeTrailingDelimiter ([#5617](https://github.com/googleapis/google-cloud-go/issues/5617)) ([a34503b](https://github.com/googleapis/google-cloud-go/commit/a34503bc0f0b95399285e8db66976b227e3b0072)) * **storage:** set versionClient to module version ([55f0d92](https://github.com/googleapis/google-cloud-go/commit/55f0d92bf112f14b024b4ab0076c9875a17423c9)) ### Bug Fixes * **storage:** respect STORAGE_EMULATOR_HOST in signedURL ([#5673](https://github.com/googleapis/google-cloud-go/issues/5673)) ([1c249ae](https://github.com/googleapis/google-cloud-go/commit/1c249ae5b4980cf53fa74635943ca8bf6a96a341)) ## [1.21.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.20.0...storage/v1.21.0) (2022-02-17) ### Features * **storage:** add better version metadata to calls ([#5507](https://github.com/googleapis/google-cloud-go/issues/5507)) ([13fe0bc](https://github.com/googleapis/google-cloud-go/commit/13fe0bc0d8acbffd46b59ab69b25449f1cbd6a88)), refs [#2749](https://github.com/googleapis/google-cloud-go/issues/2749) * **storage:** add Writer.ChunkRetryDeadline ([#5482](https://github.com/googleapis/google-cloud-go/issues/5482)) ([498a746](https://github.com/googleapis/google-cloud-go/commit/498a746769fa43958b92af8875b927879947128e)) ## [1.20.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.19.0...storage/v1.20.0) (2022-02-04) ### Features * **storage/internal:** Update definition of RewriteObjectRequest to bring to parity with JSON API support ([#5447](https://www.github.com/googleapis/google-cloud-go/issues/5447)) ([7d175ef](https://www.github.com/googleapis/google-cloud-go/commit/7d175ef12b7b3e75585427f5dd2aab4a175e92d6)) ## [1.19.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.18.2...storage/v1.19.0) (2022-01-25) ### Features * **storage:** add fully configurable and idempotency-aware retry strategy ([#5384](https://www.github.com/googleapis/google-cloud-go/issues/5384), [#5185](https://www.github.com/googleapis/google-cloud-go/issues/5185), [#5170](https://www.github.com/googleapis/google-cloud-go/issues/5170), [#5223](https://www.github.com/googleapis/google-cloud-go/issues/5223), [#5221](https://www.github.com/googleapis/google-cloud-go/issues/5221), [#5193](https://www.github.com/googleapis/google-cloud-go/issues/5193), [#5159](https://www.github.com/googleapis/google-cloud-go/issues/5159), [#5165](https://www.github.com/googleapis/google-cloud-go/issues/5165), [#5166](https://www.github.com/googleapis/google-cloud-go/issues/5166), [#5210](https://www.github.com/googleapis/google-cloud-go/issues/5210), [#5172](https://www.github.com/googleapis/google-cloud-go/issues/5172), [#5314](https://www.github.com/googleapis/google-cloud-go/issues/5314)) * This release contains changes to fully align this library's retry strategy with best practices as described in the Cloud Storage [docs](https://cloud.google.com/storage/docs/retry-strategy). * The library will now retry only idempotent operations by default. This means that for certain operations, including object upload, compose, rewrite, update, and delete, requests will not be retried by default unless [idempotency conditions](https://cloud.google.com/storage/docs/retry-strategy#idempotency) for the request have been met. * The library now has methods to configure aspects of retry policy for API calls, including which errors are retried, the timing of the exponential backoff, and how idempotency is taken into account. * If you wish to re-enable retries for a non-idempotent request, use the [RetryAlways](https://pkg.go.dev/cloud.google.com/go/storage@main#RetryAlways) policy. * For full details on how to configure retries, see the [package docs](https://pkg.go.dev/cloud.google.com/go/storage@main#hdr-Retrying_failed_requests) and the [Cloud Storage docs](https://cloud.google.com/storage/docs/retry-strategy) * **storage:** GenerateSignedPostPolicyV4 can use existing creds to authenticate ([#5105](https://www.github.com/googleapis/google-cloud-go/issues/5105)) ([46489f4](https://www.github.com/googleapis/google-cloud-go/commit/46489f4c8a634068a3e7cf2fd5e5ca11b555c0a8)) * **storage:** post policy can be signed with a fn that takes raw bytes ([#5079](https://www.github.com/googleapis/google-cloud-go/issues/5079)) ([25d1278](https://www.github.com/googleapis/google-cloud-go/commit/25d1278cab539fbfdd8563ed6b297e30d3fe555c)) * **storage:** add rpo (turbo replication) support ([#5003](https://www.github.com/googleapis/google-cloud-go/issues/5003)) ([3bd5995](https://www.github.com/googleapis/google-cloud-go/commit/3bd59958e0c06d2655b67fcb5410668db3c52af0)) ### Bug Fixes * **storage:** fix nil check in gRPC Reader ([#5376](https://www.github.com/googleapis/google-cloud-go/issues/5376)) ([5e7d722](https://www.github.com/googleapis/google-cloud-go/commit/5e7d722d18a62b28ba98169b3bdbb49401377264)) ### [1.18.2](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.18.1...storage/v1.18.2) (2021-10-18) ### Bug Fixes * **storage:** upgrade genproto ([#4993](https://www.github.com/googleapis/google-cloud-go/issues/4993)) ([5ca462d](https://www.github.com/googleapis/google-cloud-go/commit/5ca462d99fe851b7cddfd70108798e2fa959bdfd)), refs [#4991](https://www.github.com/googleapis/google-cloud-go/issues/4991) ### [1.18.1](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.18.0...storage/v1.18.1) (2021-10-14) ### Bug Fixes * **storage:** don't assume auth from a client option ([#4982](https://www.github.com/googleapis/google-cloud-go/issues/4982)) ([e17334d](https://www.github.com/googleapis/google-cloud-go/commit/e17334d1fe7645d89d14ae7148313498b984dfbb)) ## [1.18.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.17.0...storage/v1.18.0) (2021-10-11) ### Features * **storage:** returned wrapped error for timeouts ([#4802](https://www.github.com/googleapis/google-cloud-go/issues/4802)) ([0e102a3](https://www.github.com/googleapis/google-cloud-go/commit/0e102a385dc67a06f6b444b3a93e6998428529be)), refs [#4197](https://www.github.com/googleapis/google-cloud-go/issues/4197) * **storage:** SignedUrl can use existing creds to authenticate ([#4604](https://www.github.com/googleapis/google-cloud-go/issues/4604)) ([b824c89](https://www.github.com/googleapis/google-cloud-go/commit/b824c897e6941270747b612f6d36a8d6ae081315)) ### Bug Fixes * **storage:** update PAP to use inherited instead of unspecified ([#4909](https://www.github.com/googleapis/google-cloud-go/issues/4909)) ([dac26b1](https://www.github.com/googleapis/google-cloud-go/commit/dac26b1af2f2972f12775341173bcc5f982438b8)) ## [1.17.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.16.1...storage/v1.17.0) (2021-09-28) ### Features * **storage:** add projectNumber field to bucketAttrs. ([#4805](https://www.github.com/googleapis/google-cloud-go/issues/4805)) ([07343af](https://www.github.com/googleapis/google-cloud-go/commit/07343afc15085b164cc41d202d13f9d46f5c0d02)) ### Bug Fixes * **storage:** align retry idempotency (part 1) ([#4715](https://www.github.com/googleapis/google-cloud-go/issues/4715)) ([ffa903e](https://www.github.com/googleapis/google-cloud-go/commit/ffa903eeec61aa3869e5220e2f09371127b5c393)) ### [1.16.1](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.16.0...storage/v1.16.1) (2021-08-30) ### Bug Fixes * **storage/internal:** Update encryption_key fields to "bytes" type. fix: Improve date/times and field name clarity in lifecycle conditions. ([a52baa4](https://www.github.com/googleapis/google-cloud-go/commit/a52baa456ed8513ec492c4b573c191eb61468758)) * **storage:** accept emulator env var without scheme ([#4616](https://www.github.com/googleapis/google-cloud-go/issues/4616)) ([5f8cbb9](https://www.github.com/googleapis/google-cloud-go/commit/5f8cbb98070109e2a34409ac775ed63b94d37efd)) * **storage:** preserve supplied endpoint's scheme ([#4609](https://www.github.com/googleapis/google-cloud-go/issues/4609)) ([ee2756f](https://www.github.com/googleapis/google-cloud-go/commit/ee2756fb0a335d591464a770c9fa4f8fe0ba2e01)) * **storage:** remove unnecessary variable ([#4608](https://www.github.com/googleapis/google-cloud-go/issues/4608)) ([27fc784](https://www.github.com/googleapis/google-cloud-go/commit/27fc78456fb251652bdf5cdb493734a7e1e643e1)) * **storage:** retry LockRetentionPolicy ([#4439](https://www.github.com/googleapis/google-cloud-go/issues/4439)) ([09879ea](https://www.github.com/googleapis/google-cloud-go/commit/09879ea80cb67f9bfd8fc9384b0fda335567cba9)), refs [#4437](https://www.github.com/googleapis/google-cloud-go/issues/4437) * **storage:** revise Reader to send XML preconditions ([#4479](https://www.github.com/googleapis/google-cloud-go/issues/4479)) ([e36b29a](https://www.github.com/googleapis/google-cloud-go/commit/e36b29a3d43bce5c1c044f7daf6e1db00b0a49e0)), refs [#4470](https://www.github.com/googleapis/google-cloud-go/issues/4470) ## [1.16.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.15.0...storage/v1.16.0) (2021-06-28) ### Features * **storage:** support PublicAccessPrevention ([#3608](https://www.github.com/googleapis/google-cloud-go/issues/3608)) ([99bc782](https://www.github.com/googleapis/google-cloud-go/commit/99bc782fb50a47602b45278384ef5d5b5da9263b)), refs [#3203](https://www.github.com/googleapis/google-cloud-go/issues/3203) ### Bug Fixes * **storage:** fix Writer.ChunkSize validation ([#4255](https://www.github.com/googleapis/google-cloud-go/issues/4255)) ([69c2e9d](https://www.github.com/googleapis/google-cloud-go/commit/69c2e9dc6303e1a004d3104a8178532fa738e742)), refs [#4167](https://www.github.com/googleapis/google-cloud-go/issues/4167) * **storage:** try to reopen for failed Reads ([#4226](https://www.github.com/googleapis/google-cloud-go/issues/4226)) ([564102b](https://www.github.com/googleapis/google-cloud-go/commit/564102b335dbfb558bec8af883e5f898efb5dd10)), refs [#3040](https://www.github.com/googleapis/google-cloud-go/issues/3040) ## [1.15.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.13.0...storage/v1.15.0) (2021-04-21) ### Features * **transport** Bump dependency on google.golang.org/api to pick up HTTP/2 config updates (see [googleapis/google-api-go-client#882](https://github.com/googleapis/google-api-go-client/pull/882)). ### Bug Fixes * **storage:** retry io.ErrUnexpectedEOF ([#3957](https://www.github.com/googleapis/google-cloud-go/issues/3957)) ([f6590cd](https://www.github.com/googleapis/google-cloud-go/commit/f6590cdc26c8479be5df48949fa59f879e0c24fc)) ## v1.14.0 - Updates to various dependencies. ## [1.13.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.12.0...v1.13.0) (2021-02-03) ### Features * **storage:** add missing StorageClass in BucketAttrsToUpdate ([#3038](https://www.github.com/googleapis/google-cloud-go/issues/3038)) ([2fa1b72](https://www.github.com/googleapis/google-cloud-go/commit/2fa1b727f8a7b20aa62fe0990530744f6c109be0)) * **storage:** add projection parameter for BucketHandle.Objects() ([#3549](https://www.github.com/googleapis/google-cloud-go/issues/3549)) ([9b9c3dc](https://www.github.com/googleapis/google-cloud-go/commit/9b9c3dce3ee10af5b6c4d070821bf47a861efd5b)) ### Bug Fixes * **storage:** fix endpoint selection logic ([#3172](https://www.github.com/googleapis/google-cloud-go/issues/3172)) ([99edf0d](https://www.github.com/googleapis/google-cloud-go/commit/99edf0d211a9e617f2586fbc83b6f9630da3c537)) ## v1.12.0 - V4 signed URL fixes: - Fix encoding of spaces in query parameters. - Add fields that were missing from PostPolicyV4 policy conditions. - Fix Query to correctly list prefixes as well as objects when SetAttrSelection is used. ## v1.11.0 - Add support for CustomTime and NoncurrentTime object lifecycle management features. ## v1.10.0 - Bump dependency on google.golang.org/api to capture changes to retry logic which will make retries on writes more resilient. - Improve documentation for Writer.ChunkSize. - Fix a bug in lifecycle to allow callers to clear lifecycle rules on a bucket. ## v1.9.0 - Add retry for transient network errors on most operations (with the exception of writes). - Bump dependency for google.golang.org/api to capture a change in the default HTTP transport which will improve performance for reads under heavy load. - Add CRC32C checksum validation option to Composer. ## v1.8.0 - Add support for V4 signed post policies. ## v1.7.0 - V4 signed URL support: - Add support for bucket-bound domains and virtual hosted style URLs. - Add support for query parameters in the signature. - Fix text encoding to align with standards. - Add the object name to query parameters for write calls. - Fix retry behavior when reading files with Content-Encoding gzip. - Fix response header in reader. - New code examples: - Error handling for `ObjectHandle` preconditions. - Existence checks for buckets and objects. ## v1.6.0 - Updated option handling: - Don't drop custom scopes (#1756) - Don't drop port in provided endpoint (#1737) ## v1.5.0 - Honor WithEndpoint client option for reads as well as writes. - Add archive storage class to docs. - Make fixes to storage benchwrapper. ## v1.4.0 - When listing objects in a bucket, allow callers to specify which attributes are queried. This allows for performance optimization. ## v1.3.0 - Use `storage.googleapis.com/storage/v1` by default for GCS requests instead of `www.googleapis.com/storage/v1`. ## v1.2.1 - Fixed a bug where UniformBucketLevelAccess and BucketPolicyOnly were not being sent in all cases. ## v1.2.0 - Add support for UniformBucketLevelAccess. This configures access checks to use only bucket-level IAM policies. See: https://godoc.org/cloud.google.com/go/storage#UniformBucketLevelAccess. - Fix userAgent to use correct version. ## v1.1.2 - Fix memory leak in BucketIterator and ObjectIterator. ## v1.1.1 - Send BucketPolicyOnly even when it's disabled. ## v1.1.0 - Performance improvements for ObjectIterator and BucketIterator. - Fix Bucket.ObjectIterator size calculation checks. - Added HMACKeyOptions to all the methods which allows for options such as UserProject to be set per invocation and optionally be used. ## v1.0.0 This is the first tag to carve out storage as its own module. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository.
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/storage/CHANGES.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/storage/CHANGES.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 36645 }
## Cloud Storage [![Go Reference](https://pkg.go.dev/badge/cloud.google.com/go/storage.svg)](https://pkg.go.dev/cloud.google.com/go/storage) - [About Cloud Storage](https://cloud.google.com/storage/) - [API documentation](https://cloud.google.com/storage/docs) - [Go client documentation](https://cloud.google.com/go/docs/reference/cloud.google.com/go/storage/latest) - [Complete sample programs](https://github.com/GoogleCloudPlatform/golang-samples/tree/main/storage) ### Example Usage First create a `storage.Client` to use throughout your application: [snip]:# (storage-1) ```go client, err := storage.NewClient(ctx) if err != nil { log.Fatal(err) } ``` [snip]:# (storage-2) ```go // Read the object1 from bucket. rc, err := client.Bucket("bucket").Object("object1").NewReader(ctx) if err != nil { log.Fatal(err) } defer rc.Close() body, err := io.ReadAll(rc) if err != nil { log.Fatal(err) } ```
{ "source": "yandex/perforator", "title": "vendor/cloud.google.com/go/storage/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/cloud.google.com/go/storage/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 908 }
# Contributing notes ## Local setup The easiest way to run tests is to use Docker Compose: ``` docker-compose up make ```
{ "source": "yandex/perforator", "title": "vendor/github.com/ClickHouse/clickhouse-go/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/ClickHouse/clickhouse-go/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 124 }
# ClickHouse [![Build Status](https://travis-ci.org/ClickHouse/clickhouse-go.svg?branch=master)](https://travis-ci.org/ClickHouse/clickhouse-go) [![Go Report Card](https://goreportcard.com/badge/github.com/ClickHouse/clickhouse-go)](https://goreportcard.com/report/github.com/ClickHouse/clickhouse-go) [![codecov](https://codecov.io/gh/ClickHouse/clickhouse-go/branch/master/graph/badge.svg)](https://codecov.io/gh/ClickHouse/clickhouse-go) Golang SQL database driver for [Yandex ClickHouse](https://clickhouse.yandex/) ## Key features * Uses native ClickHouse TCP client-server protocol * Compatibility with `database/sql` * Round Robin load-balancing * Bulk write support : `begin->prepare->(in loop exec)->commit` * LZ4 compression support (default is pure go lz4 or switch to use cgo lz4 by turning clz4 build tags on) * External Tables support ## DSN * username/password - auth credentials * database - select the current default database * read_timeout/write_timeout - timeout in second * no_delay - disable/enable the Nagle Algorithm for tcp socket (default is 'true' - disable) * alt_hosts - comma-separated list of single address hosts for load-balancing * connection_open_strategy - random/in_order (default random). * random - choose a random server from the set * in_order - first live server is chosen in specified order * time_random - choose random (based on the current time) server from the set. This option differs from `random` because randomness is based on the current time rather than on the number of previous connections. * block_size - maximum rows in block (default is 1000000). If the rows are larger, the data will be split into several blocks to send to the server. If one block was sent to the server, the data would be persisted on the server disk, and we can't roll back the transaction. So always keep in mind that the batch size is no larger than the block_size if you want an atomic batch insert. * pool_size - the maximum amount of preallocated byte chunks used in queries (default is 100). Decrease this if you experience memory problems at the expense of more GC pressure and vice versa. * debug - enable debug output (boolean value) * compress - enable lz4 compression (integer value, default is '0') * check_connection_liveness - on supported platforms non-secure connections retrieved from the connection pool are checked in beginTx() for liveness before using them. If the check fails, the respective connection is marked as bad and the query retried with another connection. (boolean value, default is 'true') SSL/TLS parameters: * secure - establish secure connection (default is false) * skip_verify - skip certificate verification (default is false) * tls_config - name of a TLS config with client certificates, registered using `clickhouse.RegisterTLSConfig()`; implies secure to be true, unless explicitly specified Example: ```sh tcp://host1:9000?username=user&password=qwerty&database=clicks&read_timeout=10&write_timeout=20&alt_hosts=host2:9000,host3:9000 ``` ## Supported data types * UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64 * Float32, Float64 * String * FixedString(N) * Date * DateTime * IPv4 * IPv6 * Enum * UUID * Nullable(T) * [Array(T)](https://clickhouse.yandex/reference_en.html#Array(T)) [godoc](https://godoc.org/github.com/ClickHouse/clickhouse-go#Array) * Array(Nullable(T)) * Tuple(...T) ## TODO * Support other compression methods(zstd ...) ## Install ```sh go get -u github.com/ClickHouse/clickhouse-go ``` ## Examples ```go package main import ( "database/sql" "fmt" "log" "time" "github.com/ClickHouse/clickhouse-go" ) func main() { connect, err := sql.Open("clickhouse", "tcp://127.0.0.1:9000?debug=true") if err != nil { log.Fatal(err) } if err := connect.Ping(); err != nil { if exception, ok := err.(*clickhouse.Exception); ok { fmt.Printf("[%d] %s \n%s\n", exception.Code, exception.Message, exception.StackTrace) } else { fmt.Println(err) } return } _, err = connect.Exec(` CREATE TABLE IF NOT EXISTS example ( country_code FixedString(2), os_id UInt8, browser_id UInt8, categories Array(Int16), action_day Date, action_time DateTime ) engine=Memory `) if err != nil { log.Fatal(err) } var ( tx, _ = connect.Begin() stmt, _ = tx.Prepare("INSERT INTO example (country_code, os_id, browser_id, categories, action_day, action_time) VALUES (?, ?, ?, ?, ?, ?)") ) defer stmt.Close() for i := 0; i < 100; i++ { if _, err := stmt.Exec( "RU", 10+i, 100+i, clickhouse.Array([]int16{1, 2, 3}), time.Now(), time.Now(), ); err != nil { log.Fatal(err) } } if err := tx.Commit(); err != nil { log.Fatal(err) } rows, err := connect.Query("SELECT country_code, os_id, browser_id, categories, action_day, action_time FROM example") if err != nil { log.Fatal(err) } defer rows.Close() for rows.Next() { var ( country string os, browser uint8 categories []int16 actionDay, actionTime time.Time ) if err := rows.Scan(&country, &os, &browser, &categories, &actionDay, &actionTime); err != nil { log.Fatal(err) } log.Printf("country: %s, os: %d, browser: %d, categories: %v, action_day: %s, action_time: %s", country, os, browser, categories, actionDay, actionTime) } if err := rows.Err(); err != nil { log.Fatal(err) } if _, err := connect.Exec("DROP TABLE example"); err != nil { log.Fatal(err) } } ``` ### Use [sqlx](https://github.com/jmoiron/sqlx) ```go package main import ( "log" "time" "github.com/jmoiron/sqlx" _ "github.com/ClickHouse/clickhouse-go" ) func main() { connect, err := sqlx.Open("clickhouse", "tcp://127.0.0.1:9000?debug=true") if err != nil { log.Fatal(err) } var items []struct { CountryCode string `db:"country_code"` OsID uint8 `db:"os_id"` BrowserID uint8 `db:"browser_id"` Categories []int16 `db:"categories"` ActionTime time.Time `db:"action_time"` } if err := connect.Select(&items, "SELECT country_code, os_id, browser_id, categories, action_time FROM example"); err != nil { log.Fatal(err) } for _, item := range items { log.Printf("country: %s, os: %d, browser: %d, categories: %v, action_time: %s", item.CountryCode, item.OsID, item.BrowserID, item.Categories, item.ActionTime) } } ``` ### External tables support ```go package main import ( "database/sql" "database/sql/driver" "fmt" "github.com/ClickHouse/clickhouse-go/lib/column" "log" "time" "github.com/ClickHouse/clickhouse-go" ) func main() { connect, err := sql.Open("clickhouse", "tcp://127.0.0.1:9000?debug=true") if err != nil { log.Fatal(err) } if err := connect.Ping(); err != nil { if exception, ok := err.(*clickhouse.Exception); ok { fmt.Printf("[%d] %s \n%s\n", exception.Code, exception.Message, exception.StackTrace) } else { fmt.Println(err) } return } _, err = connect.Exec(` CREATE TABLE IF NOT EXISTS example ( country_code FixedString(2), os_id UInt8, browser_id UInt8, categories Array(Int16), action_day Date, action_time DateTime ) engine=Memory `) if err != nil { log.Fatal(err) } var ( tx, _ = connect.Begin() stmt, _ = tx.Prepare("INSERT INTO example (country_code, os_id, browser_id, categories, action_day, action_time) VALUES (?, ?, ?, ?, ?, ?)") ) defer stmt.Close() for i := 0; i < 100; i++ { if _, err := stmt.Exec( "RU", 10+i, 100+i, clickhouse.Array([]int16{1, 2, 3}), time.Now(), time.Now(), ); err != nil { log.Fatal(err) } } if err := tx.Commit(); err != nil { log.Fatal(err) } col, err := column.Factory("country_code", "String", nil) if err != nil { log.Fatal(err) } countriesExternalTable := clickhouse.ExternalTable{ Name: "countries", Values: [][]driver.Value{ {"RU"}, }, Columns: []column.Column{col}, } rows, err := connect.Query("SELECT country_code, os_id, browser_id, categories, action_day, action_time "+ "FROM example WHERE country_code IN ?", countriesExternalTable) if err != nil { log.Fatal(err) } defer rows.Close() for rows.Next() { var ( country string os, browser uint8 categories []int16 actionDay, actionTime time.Time ) if err := rows.Scan(&country, &os, &browser, &categories, &actionDay, &actionTime); err != nil { log.Fatal(err) } log.Printf("country: %s, os: %d, browser: %d, categories: %v, action_day: %s, action_time: %s", country, os, browser, categories, actionDay, actionTime) } if err := rows.Err(); err != nil { log.Fatal(err) } if _, err := connect.Exec("DROP TABLE example"); err != nil { log.Fatal(err) } } ```
{ "source": "yandex/perforator", "title": "vendor/github.com/ClickHouse/clickhouse-go/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/ClickHouse/clickhouse-go/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 8787 }
[![Build Status](https://travis-ci.org/DATA-DOG/go-sqlmock.svg)](https://travis-ci.org/DATA-DOG/go-sqlmock) [![GoDoc](https://godoc.org/github.com/DATA-DOG/go-sqlmock?status.svg)](https://godoc.org/github.com/DATA-DOG/go-sqlmock) [![Go Report Card](https://goreportcard.com/badge/github.com/DATA-DOG/go-sqlmock)](https://goreportcard.com/report/github.com/DATA-DOG/go-sqlmock) [![codecov.io](https://codecov.io/github/DATA-DOG/go-sqlmock/branch/master/graph/badge.svg)](https://codecov.io/github/DATA-DOG/go-sqlmock) # Sql driver mock for Golang **sqlmock** is a mock library implementing [sql/driver](https://godoc.org/database/sql/driver). Which has one and only purpose - to simulate any **sql** driver behavior in tests, without needing a real database connection. It helps to maintain correct **TDD** workflow. - this library is now complete and stable. (you may not find new changes for this reason) - supports concurrency and multiple connections. - supports **go1.8** Context related feature mocking and Named sql parameters. - does not require any modifications to your source code. - the driver allows to mock any sql driver method behavior. - has strict by default expectation order matching. - has no third party dependencies. **NOTE:** in **v1.2.0** **sqlmock.Rows** has changed to struct from interface, if you were using any type references to that interface, you will need to switch it to a pointer struct type. Also, **sqlmock.Rows** were used to implement **driver.Rows** interface, which was not required or useful for mocking and was removed. Hope it will not cause issues. ## Looking for maintainers I do not have much spare time for this library and willing to transfer the repository ownership to person or an organization motivated to maintain it. Open up a conversation if you are interested. See #230. ## Install go get github.com/DATA-DOG/go-sqlmock ## Documentation and Examples Visit [godoc](http://godoc.org/github.com/DATA-DOG/go-sqlmock) for general examples and public api reference. See **.travis.yml** for supported **go** versions. Different use case, is to functionally test with a real database - [go-txdb](https://github.com/DATA-DOG/go-txdb) all database related actions are isolated within a single transaction so the database can remain in the same state. See implementation examples: - [blog API server](https://github.com/DATA-DOG/go-sqlmock/tree/master/examples/blog) - [the same orders example](https://github.com/DATA-DOG/go-sqlmock/tree/master/examples/orders) ### Something you may want to test, assuming you use the [go-mysql-driver](https://github.com/go-sql-driver/mysql) ``` go package main import ( "database/sql" _ "github.com/go-sql-driver/mysql" ) func recordStats(db *sql.DB, userID, productID int64) (err error) { tx, err := db.Begin() if err != nil { return } defer func() { switch err { case nil: err = tx.Commit() default: tx.Rollback() } }() if _, err = tx.Exec("UPDATE products SET views = views + 1"); err != nil { return } if _, err = tx.Exec("INSERT INTO product_viewers (user_id, product_id) VALUES (?, ?)", userID, productID); err != nil { return } return } func main() { // @NOTE: the real connection is not required for tests db, err := sql.Open("mysql", "root@/blog") if err != nil { panic(err) } defer db.Close() if err = recordStats(db, 1 /*some user id*/, 5 /*some product id*/); err != nil { panic(err) } } ``` ### Tests with sqlmock ``` go package main import ( "fmt" "testing" "github.com/DATA-DOG/go-sqlmock" ) // a successful case func TestShouldUpdateStats(t *testing.T) { db, mock, err := sqlmock.New() if err != nil { t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) } defer db.Close() mock.ExpectBegin() mock.ExpectExec("UPDATE products").WillReturnResult(sqlmock.NewResult(1, 1)) mock.ExpectExec("INSERT INTO product_viewers").WithArgs(2, 3).WillReturnResult(sqlmock.NewResult(1, 1)) mock.ExpectCommit() // now we execute our method if err = recordStats(db, 2, 3); err != nil { t.Errorf("error was not expected while updating stats: %s", err) } // we make sure that all expectations were met if err := mock.ExpectationsWereMet(); err != nil { t.Errorf("there were unfulfilled expectations: %s", err) } } // a failing test case func TestShouldRollbackStatUpdatesOnFailure(t *testing.T) { db, mock, err := sqlmock.New() if err != nil { t.Fatalf("an error '%s' was not expected when opening a stub database connection", err) } defer db.Close() mock.ExpectBegin() mock.ExpectExec("UPDATE products").WillReturnResult(sqlmock.NewResult(1, 1)) mock.ExpectExec("INSERT INTO product_viewers"). WithArgs(2, 3). WillReturnError(fmt.Errorf("some error")) mock.ExpectRollback() // now we execute our method if err = recordStats(db, 2, 3); err == nil { t.Errorf("was expecting an error, but there was none") } // we make sure that all expectations were met if err := mock.ExpectationsWereMet(); err != nil { t.Errorf("there were unfulfilled expectations: %s", err) } } ``` ## Customize SQL query matching There were plenty of requests from users regarding SQL query string validation or different matching option. We have now implemented the `QueryMatcher` interface, which can be passed through an option when calling `sqlmock.New` or `sqlmock.NewWithDSN`. This now allows to include some library, which would allow for example to parse and validate `mysql` SQL AST. And create a custom QueryMatcher in order to validate SQL in sophisticated ways. By default, **sqlmock** is preserving backward compatibility and default query matcher is `sqlmock.QueryMatcherRegexp` which uses expected SQL string as a regular expression to match incoming query string. There is an equality matcher: `QueryMatcherEqual` which will do a full case sensitive match. In order to customize the QueryMatcher, use the following: ``` go db, mock, err := sqlmock.New(sqlmock.QueryMatcherOption(sqlmock.QueryMatcherEqual)) ``` The query matcher can be fully customized based on user needs. **sqlmock** will not provide a standard sql parsing matchers, since various drivers may not follow the same SQL standard. ## Matching arguments like time.Time There may be arguments which are of `struct` type and cannot be compared easily by value like `time.Time`. In this case **sqlmock** provides an [Argument](https://godoc.org/github.com/DATA-DOG/go-sqlmock#Argument) interface which can be used in more sophisticated matching. Here is a simple example of time argument matching: ``` go type AnyTime struct{} // Match satisfies sqlmock.Argument interface func (a AnyTime) Match(v driver.Value) bool { _, ok := v.(time.Time) return ok } func TestAnyTimeArgument(t *testing.T) { t.Parallel() db, mock, err := sqlmock.New() if err != nil { t.Errorf("an error '%s' was not expected when opening a stub database connection", err) } defer db.Close() mock.ExpectExec("INSERT INTO users"). WithArgs("john", AnyTime{}). WillReturnResult(sqlmock.NewResult(1, 1)) _, err = db.Exec("INSERT INTO users(name, created_at) VALUES (?, ?)", "john", time.Now()) if err != nil { t.Errorf("error '%s' was not expected, while inserting a row", err) } if err := mock.ExpectationsWereMet(); err != nil { t.Errorf("there were unfulfilled expectations: %s", err) } } ``` It only asserts that argument is of `time.Time` type. ## Run tests go test -race ## Change Log - **2019-04-06** - added functionality to mock a sql MetaData request - **2019-02-13** - added `go.mod` removed the references and suggestions using `gopkg.in`. - **2018-12-11** - added expectation of Rows to be closed, while mocking expected query. - **2018-12-11** - introduced an option to provide **QueryMatcher** in order to customize SQL query matching. - **2017-09-01** - it is now possible to expect that prepared statement will be closed, using **ExpectedPrepare.WillBeClosed**. - **2017-02-09** - implemented support for **go1.8** features. **Rows** interface was changed to struct but contains all methods as before and should maintain backwards compatibility. **ExpectedQuery.WillReturnRows** may now accept multiple row sets. - **2016-11-02** - `db.Prepare()` was not validating expected prepare SQL query. It should still be validated even if Exec or Query is not executed on that prepared statement. - **2016-02-23** - added **sqlmock.AnyArg()** function to provide any kind of argument matcher. - **2016-02-23** - convert expected arguments to driver.Value as natural driver does, the change may affect time.Time comparison and will be stricter. See [issue](https://github.com/DATA-DOG/go-sqlmock/issues/31). - **2015-08-27** - **v1** api change, concurrency support, all known issues fixed. - **2014-08-16** instead of **panic** during reflect type mismatch when comparing query arguments - now return error - **2014-08-14** added **sqlmock.NewErrorResult** which gives an option to return driver.Result with errors for interface methods, see [issue](https://github.com/DATA-DOG/go-sqlmock/issues/5) - **2014-05-29** allow to match arguments in more sophisticated ways, by providing an **sqlmock.Argument** interface - **2014-04-21** introduce **sqlmock.New()** to open a mock database connection for tests. This method calls sql.DB.Ping to ensure that connection is open, see [issue](https://github.com/DATA-DOG/go-sqlmock/issues/4). This way on Close it will surely assert if all expectations are met, even if database was not triggered at all. The old way is still available, but it is advisable to call db.Ping manually before asserting with db.Close. - **2014-02-14** RowsFromCSVString is now a part of Rows interface named as FromCSVString. It has changed to allow more ways to construct rows and to easily extend this API in future. See [issue 1](https://github.com/DATA-DOG/go-sqlmock/issues/1) **RowsFromCSVString** is deprecated and will be removed in future ## Contributions Feel free to open a pull request. Note, if you wish to contribute an extension to public (exported methods or types) - please open an issue before, to discuss whether these changes can be accepted. All backward incompatible changes are and will be treated cautiously ## License The [three clause BSD license](http://en.wikipedia.org/wiki/BSD_licenses)
{ "source": "yandex/perforator", "title": "vendor/github.com/DATA-DOG/go-sqlmock/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/DATA-DOG/go-sqlmock/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 10369 }
# xxhash [![GoDoc](https://godoc.org/github.com/OneOfOne/xxhash?status.svg)](https://godoc.org/github.com/OneOfOne/xxhash) [![Build Status](https://travis-ci.org/OneOfOne/xxhash.svg?branch=master)](https://travis-ci.org/OneOfOne/xxhash) [![Coverage](https://gocover.io/_badge/github.com/OneOfOne/xxhash)](https://gocover.io/github.com/OneOfOne/xxhash) This is a native Go implementation of the excellent [xxhash](https://github.com/Cyan4973/xxHash)* algorithm, an extremely fast non-cryptographic Hash algorithm, working at speeds close to RAM limits. * The C implementation is ([Copyright](https://github.com/Cyan4973/xxHash/blob/master/LICENSE) (c) 2012-2014, Yann Collet) ## Install go get github.com/OneOfOne/xxhash ## Features * On Go 1.7+ the pure go version is faster than CGO for all inputs. * Supports ChecksumString{32,64} xxhash{32,64}.WriteString, which uses no copies when it can, falls back to copy on appengine. * The native version falls back to a less optimized version on appengine due to the lack of unsafe. * Almost as fast as the mostly pure assembly version written by the brilliant [cespare](https://github.com/cespare/xxhash), while also supporting seeds. * To manually toggle the appengine version build with `-tags safe`. ## Benchmark ### Core i7-4790 @ 3.60GHz, Linux 4.12.6-1-ARCH (64bit), Go tip (+ff90f4af66 2017-08-19) ```bash ➤ go test -bench '64' -count 5 -tags cespare | benchstat /dev/stdin name time/op # https://github.com/cespare/xxhash XXSum64Cespare/Func-8 160ns ± 2% XXSum64Cespare/Struct-8 173ns ± 1% XXSum64ShortCespare/Func-8 6.78ns ± 1% XXSum64ShortCespare/Struct-8 19.6ns ± 2% # this package (default mode, using unsafe) XXSum64/Func-8 170ns ± 1% XXSum64/Struct-8 182ns ± 1% XXSum64Short/Func-8 13.5ns ± 3% XXSum64Short/Struct-8 20.4ns ± 0% # this package (appengine, *not* using unsafe) XXSum64/Func-8 241ns ± 5% XXSum64/Struct-8 243ns ± 6% XXSum64Short/Func-8 15.2ns ± 2% XXSum64Short/Struct-8 23.7ns ± 5% CRC64ISO-8 1.23µs ± 1% CRC64ISOString-8 2.71µs ± 4% CRC64ISOShort-8 22.2ns ± 3% Fnv64-8 2.34µs ± 1% Fnv64Short-8 74.7ns ± 8% ``` ## Usage ```go h := xxhash.New64() // r, err := os.Open("......") // defer f.Close() r := strings.NewReader(F) io.Copy(h, r) fmt.Println("xxhash.Backend:", xxhash.Backend) fmt.Println("File checksum:", h.Sum64()) ``` [<kbd>playground</kbd>](https://play.golang.org/p/wHKBwfu6CPV) ## TODO * Rewrite the 32bit version to be more optimized. * General cleanup as the Go inliner gets smarter. ## License This project is released under the Apache v2. license. See [LICENSE](LICENSE) for more details.
{ "source": "yandex/perforator", "title": "vendor/github.com/OneOfOne/xxhash/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/OneOfOne/xxhash/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2835 }
This package is a brotli compressor and decompressor implemented in Go. It was translated from the reference implementation (https://github.com/google/brotli) with the `c2go` tool at https://github.com/andybalholm/c2go. I have been working on new compression algorithms (not translated from C) in the matchfinder package. You can use them with the NewWriterV2 function. Currently they give better results than the old implementation (at least for compressing my test file, Newton’s *Opticks*) on levels 2 to 6. I am using it in production with https://github.com/andybalholm/redwood. API documentation is found at https://pkg.go.dev/github.com/andybalholm/brotli?tab=doc.
{ "source": "yandex/perforator", "title": "vendor/github.com/andybalholm/brotli/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/andybalholm/brotli/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 675 }
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at nathanjsweet at gmail dot com or i at lmb dot io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/
{ "source": "yandex/perforator", "title": "vendor/github.com/cilium/ebpf/CODE_OF_CONDUCT.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/cilium/ebpf/CODE_OF_CONDUCT.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 3244 }
# Contributing to ebpf-go Want to contribute to ebpf-go? There are a few things you need to know. We wrote a [contribution guide](https://ebpf-go.dev/contributing/) to help you get started.
{ "source": "yandex/perforator", "title": "vendor/github.com/cilium/ebpf/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/cilium/ebpf/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 191 }
# eBPF [![PkgGoDev](https://pkg.go.dev/badge/github.com/cilium/ebpf)](https://pkg.go.dev/github.com/cilium/ebpf) ![HoneyGopher](docs/ebpf/ebpf-go.png) ebpf-go is a pure Go library that provides utilities for loading, compiling, and debugging eBPF programs. It has minimal external dependencies and is intended to be used in long running processes. See [ebpf.io](https://ebpf.io) for complementary projects from the wider eBPF ecosystem. ## Getting Started Please take a look at our [Getting Started] guide. [Contributions](https://ebpf-go.dev/contributing) are highly encouraged, as they highlight certain use cases of eBPF and the library, and help shape the future of the project. ## Getting Help The community actively monitors our [GitHub Discussions](https://github.com/cilium/ebpf/discussions) page. Please search for existing threads before starting a new one. Refrain from opening issues on the bug tracker if you're just starting out or if you're not sure if something is a bug in the library code. Alternatively, [join](https://ebpf.io/slack) the [#ebpf-go](https://cilium.slack.com/messages/ebpf-go) channel on Slack if you have other questions regarding the project. Note that this channel is ephemeral and has its history erased past a certain point, which is less helpful for others running into the same problem later. ## Packages This library includes the following packages: * [asm](https://pkg.go.dev/github.com/cilium/ebpf/asm) contains a basic assembler, allowing you to write eBPF assembly instructions directly within your Go code. (You don't need to use this if you prefer to write your eBPF program in C.) * [cmd/bpf2go](https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go) allows compiling and embedding eBPF programs written in C within Go code. As well as compiling the C code, it auto-generates Go code for loading and manipulating the eBPF program and map objects. * [link](https://pkg.go.dev/github.com/cilium/ebpf/link) allows attaching eBPF to various hooks * [perf](https://pkg.go.dev/github.com/cilium/ebpf/perf) allows reading from a `PERF_EVENT_ARRAY` * [ringbuf](https://pkg.go.dev/github.com/cilium/ebpf/ringbuf) allows reading from a `BPF_MAP_TYPE_RINGBUF` map * [features](https://pkg.go.dev/github.com/cilium/ebpf/features) implements the equivalent of `bpftool feature probe` for discovering BPF-related kernel features using native Go. * [rlimit](https://pkg.go.dev/github.com/cilium/ebpf/rlimit) provides a convenient API to lift the `RLIMIT_MEMLOCK` constraint on kernels before 5.11. * [btf](https://pkg.go.dev/github.com/cilium/ebpf/btf) allows reading the BPF Type Format. * [pin](https://pkg.go.dev/github.com/cilium/ebpf/pin) provides APIs for working with pinned objects on bpffs. ## Requirements * A version of Go that is [supported by upstream](https://golang.org/doc/devel/release.html#policy) * CI is run against kernel.org LTS releases. >= 4.4 should work but EOL'ed versions are not supported. ## License MIT ### eBPF Gopher The eBPF honeygopher is based on the Go gopher designed by Renee French. [Getting Started]: https://ebpf-go.dev/guides/getting-started/
{ "source": "yandex/perforator", "title": "vendor/github.com/cilium/ebpf/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/cilium/ebpf/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 3162 }
# log A Go package providing a common logging interface across containerd repositories and a way for clients to use and configure logging in containerd packages. This package is not intended to be used as a standalone logging package outside of the containerd ecosystem and is intended as an interface wrapper around a logging implementation. In the future this package may be replaced with a common go logging interface. ## Project details **log** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). As a containerd sub-project, you will find the: * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) information in our [`containerd/project`](https://github.com/containerd/project) repository.
{ "source": "yandex/perforator", "title": "vendor/github.com/containerd/log/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/containerd/log/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 940 }
# platforms A Go package for formatting, normalizing and matching container platforms. This package is based on the Open Containers Image Spec definition of a [platform](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/descriptor.go#L52). ## Platform Specifier While the OCI platform specifications provide a tool for components to specify structured information, user input typically doesn't need the full context and much can be inferred. To solve this problem, this package introduces "specifiers". A specifier has the format `<os>|<arch>|<os>/<arch>[/<variant>]`. The user can provide either the operating system or the architecture or both. An example of a common specifier is `linux/amd64`. If the host has a default runtime that matches this, the user can simply provide the component that matters. For example, if an image provides `amd64` and `arm64` support, the operating system, `linux` can be inferred, so they only have to provide `arm64` or `amd64`. Similar behavior is implemented for operating systems, where the architecture may be known but a runtime may support images from different operating systems. ## Project details **platforms** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). As a containerd sub-project, you will find the: * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) information in our [`containerd/project`](https://github.com/containerd/project) repository.
{ "source": "yandex/perforator", "title": "vendor/github.com/containerd/platforms/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/containerd/platforms/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1669 }
### github.com/cpuguy83/dockercfg Go library to load docker CLI configs, auths, etc. with minimal deps. So far the only deps are on the stdlib. ### Usage See the [godoc](https://godoc.org/github.com/cpuguy83/dockercfg) for API details. I'm currently using this in [zapp](https://github.com/cpuguy83/zapp/blob/d25c43d4cd7ccf29fba184aafbc720a753e1a15d/main.go#L58-L83) to handle registry auth instead of always asking the user to enter it.
{ "source": "yandex/perforator", "title": "vendor/github.com/cpuguy83/dockercfg/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/cpuguy83/dockercfg/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 439 }
# Contributing to the reference library ## Community help If you need help, please ask in the [#distribution](https://cloud-native.slack.com/archives/C01GVR8SY4R) channel on CNCF community slack. [Click here for an invite to the CNCF community slack](https://slack.cncf.io/) ## Reporting security issues The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away! Please **DO NOT** file a public issue, instead send your report privately to [[email protected]](mailto:[email protected]). ## Reporting an issue properly By following these simple rules you will get better and faster feedback on your issue. - search the bugtracker for an already reported issue ### If you found an issue that describes your problem: - please read other user comments first, and confirm this is the same issue: a given error condition might be indicative of different problems - you may also find a workaround in the comments - please refrain from adding "same thing here" or "+1" comments - you don't need to comment on an issue to get notified of updates: just hit the "subscribe" button - comment if you have some new, technical and relevant information to add to the case - __DO NOT__ comment on closed issues or merged PRs. If you think you have a related problem, open up a new issue and reference the PR or issue. ### If you have not found an existing issue that describes your problem: 1. create a new issue, with a succinct title that describes your issue: - bad title: "It doesn't work with my docker" - good title: "Private registry push fail: 400 error with E_INVALID_DIGEST" 2. copy the output of (or similar for other container tools): - `docker version` - `docker info` - `docker exec <registry-container> registry --version` 3. copy the command line you used to launch your Registry 4. restart your docker daemon in debug mode (add `-D` to the daemon launch arguments) 5. reproduce your problem and get your docker daemon logs showing the error 6. if relevant, copy your registry logs that show the error 7. provide any relevant detail about your specific Registry configuration (e.g., storage backend used) 8. indicate if you are using an enterprise proxy, Nginx, or anything else between you and your Registry ## Contributing Code Contributions should be made via pull requests. Pull requests will be reviewed by one or more maintainers or reviewers and merged when acceptable. You should follow the basic GitHub workflow: 1. Use your own [fork](https://help.github.com/en/articles/about-forks) 2. Create your [change](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) 3. Test your code 4. [Commit](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) your work, always [sign your commits](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) 5. Push your change to your fork and create a [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) Refer to [containerd's contribution guide](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) for tips on creating a successful contribution. ## Sign your work The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` Then you just add a line to every git commit message: Signed-off-by: Joe Smith <[email protected]> Use your real name (sorry, no pseudonyms or anonymous contributions.) If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
{ "source": "yandex/perforator", "title": "vendor/github.com/distribution/reference/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/distribution/reference/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 5416 }
# Distribution reference Go library to handle references to container images. <img src="/distribution-logo.svg" width="200px" /> [![Build Status](https://github.com/distribution/reference/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/distribution/reference/actions?query=workflow%3ACI) [![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/distribution/reference) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE) [![codecov](https://codecov.io/gh/distribution/reference/branch/main/graph/badge.svg)](https://codecov.io/gh/distribution/reference) [![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference?ref=badge_shield) This repository contains a library for handling refrences to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details. ## Contribution Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute issues, fixes, and patches to this project. ## Communication For async communication and long running discussions please use issues and pull requests on the github repo. This will be the best place to discuss design and implementation. For sync communication we have a #distribution channel in the [CNCF Slack](https://slack.cncf.io/) that everyone is welcome to join and chat about development. ## Licenses The distribution codebase is released under the [Apache 2.0 license](LICENSE).
{ "source": "yandex/perforator", "title": "vendor/github.com/distribution/reference/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/distribution/reference/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1719 }
# Contributing to go-units Want to hack on go-units? Awesome! Here are instructions to get you started. go-units is a part of the [Docker](https://www.docker.com) project, and follows the same rules and principles. If you're already familiar with the way Docker does things, you'll feel right at home. Otherwise, go read Docker's [contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), [issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), [review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and [branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). ### Sign your work The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)): ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 660 York Street, Suite 102, San Francisco, CA 94110 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` Then you just add a line to every git commit message: Signed-off-by: Joe Smith <[email protected]> Use your real name (sorry, no pseudonyms or anonymous contributions.) If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
{ "source": "yandex/perforator", "title": "vendor/github.com/docker/go-units/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/docker/go-units/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2762 }
[![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) # Introduction go-units is a library to transform human friendly measurements into machine friendly values. ## Usage See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. ## Copyright and license Copyright © 2015 Docker, Inc. go-units is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full text of the license.
{ "source": "yandex/perforator", "title": "vendor/github.com/docker/go-units/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/docker/go-units/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 511 }
## v1.11.0 - added WithNormalField handler ## v1.10.0 - added NoopVisitor and updated README with an example ## v1.9.2 - fix for scanning content of single-quote option values (#129) ## v1.9.1 - fix for issue #127 reserved keyword as suffix in type (#128) ## v1.9.0 - Fix & guard Parent value for options (#124) ## v1.8.0 - Add WithImport handler. ## v1.7.0 - Add WithPackage handler for walking a proto. ## v1.6.17 - add Oneof documented ## v1.6.16 - Handle inline comments before definition body ## v1.6.15 - Handle scanner change in Go 1.13 ## v1.6.14 - Handle comment inside option array value ## v1.6.13 - fixes breaking change introduced by v1.6.11 w.r.t Literal ## < v1.6.12 - see git log
{ "source": "yandex/perforator", "title": "vendor/github.com/emicklei/proto/CHANGES.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/emicklei/proto/CHANGES.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 723 }
# proto [![Build Status](https://api.travis-ci.com/emicklei/proto.svg?branch=master)](https://travis-ci.com/github/emicklei/proto) [![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/proto)](https://goreportcard.com/report/github.com/emicklei/proto) [![GoDoc](https://pkg.go.dev/badge/github.com/emicklei/proto)](https://pkg.go.dev/github.com/emicklei/proto) [![codecov](https://codecov.io/gh/emicklei/proto/branch/master/graph/badge.svg)](https://codecov.io/gh/emicklei/proto) Package in Go for parsing Google Protocol Buffers [.proto files version 2 + 3](https://developers.google.com/protocol-buffers/docs/reference/proto3-spec) ### install go get -u -v github.com/emicklei/proto ### usage package main import ( "fmt" "os" "github.com/emicklei/proto" ) func main() { reader, _ := os.Open("test.proto") defer reader.Close() parser := proto.NewParser(reader) definition, _ := parser.Parse() proto.Walk(definition, proto.WithService(handleService), proto.WithMessage(handleMessage)) } func handleService(s *proto.Service) { fmt.Println(s.Name) } func handleMessage(m *proto.Message) { lister := new(optionLister) for _, each := range m.Elements { each.Accept(lister) } fmt.Println(m.Name) } type optionLister struct { proto.NoopVisitor } func (l optionLister) VisitOption(o *proto.Option) { fmt.Println(o.Name) } ### validation Current parser implementation is not completely validating `.proto` definitions. In many but not all cases, the parser will report syntax errors when reading unexpected charaters or tokens. Use some linting tools (e.g. https://github.com/uber/prototool) or `protoc` for full validation. ### contributions See [proto-contrib](https://github.com/emicklei/proto-contrib) for other contributions on top of this package such as protofmt, proto2xsd and proto2gql. [protobuf2map](https://github.com/emicklei/protobuf2map) is a small package for inspecting serialized protobuf messages using its `.proto` definition. © 2017-2022, [ernestmicklei.com](http://ernestmicklei.com). MIT License. Contributions welcome.
{ "source": "yandex/perforator", "title": "vendor/github.com/emicklei/proto/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/emicklei/proto/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2127 }
# httpsnoop Package httpsnoop provides an easy way to capture http related metrics (i.e. response time, bytes written, and http status code) from your application's http.Handlers. Doing this requires non-trivial wrapping of the http.ResponseWriter interface, which is also exposed for users interested in a more low-level API. [![Go Reference](https://pkg.go.dev/badge/github.com/felixge/httpsnoop.svg)](https://pkg.go.dev/github.com/felixge/httpsnoop) [![Build Status](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml/badge.svg)](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml) ## Usage Example ```go // myH is your app's http handler, perhaps a http.ServeMux or similar. var myH http.Handler // wrappedH wraps myH in order to log every request. wrappedH := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { m := httpsnoop.CaptureMetrics(myH, w, r) log.Printf( "%s %s (code=%d dt=%s written=%d)", r.Method, r.URL, m.Code, m.Duration, m.Written, ) }) http.ListenAndServe(":8080", wrappedH) ``` ## Why this package exists Instrumenting an application's http.Handler is surprisingly difficult. However if you google for e.g. "capture ResponseWriter status code" you'll find lots of advise and code examples that suggest it to be a fairly trivial undertaking. Unfortunately everything I've seen so far has a high chance of breaking your application. The main problem is that a `http.ResponseWriter` often implements additional interfaces such as `http.Flusher`, `http.CloseNotifier`, `http.Hijacker`, `http.Pusher`, and `io.ReaderFrom`. So the naive approach of just wrapping `http.ResponseWriter` in your own struct that also implements the `http.ResponseWriter` interface will hide the additional interfaces mentioned above. This has a high change of introducing subtle bugs into any non-trivial application. Another approach I've seen people take is to return a struct that implements all of the interfaces above. However, that's also problematic, because it's difficult to fake some of these interfaces behaviors when the underlying `http.ResponseWriter` doesn't have an implementation. It's also dangerous, because an application may choose to operate differently, merely because it detects the presence of these additional interfaces. This package solves this problem by checking which additional interfaces a `http.ResponseWriter` implements, returning a wrapped version implementing the exact same set of interfaces. Additionally this package properly handles edge cases such as `WriteHeader` not being called, or called more than once, as well as concurrent calls to `http.ResponseWriter` methods, and even calls happening after the wrapped `ServeHTTP` has already returned. Unfortunately this package is not perfect either. It's possible that it is still missing some interfaces provided by the go core (let me know if you find one), and it won't work for applications adding their own interfaces into the mix. You can however use `httpsnoop.Unwrap(w)` to access the underlying `http.ResponseWriter` and type-assert the result to its other interfaces. However, hopefully the explanation above has sufficiently scared you of rolling your own solution to this problem. httpsnoop may still break your application, but at least it tries to avoid it as much as possible. Anyway, the real problem here is that smuggling additional interfaces inside `http.ResponseWriter` is a problematic design choice, but it probably goes as deep as the Go language specification itself. But that's okay, I still prefer Go over the alternatives ;). ## Performance ``` BenchmarkBaseline-8 20000 94912 ns/op BenchmarkCaptureMetrics-8 20000 95461 ns/op ``` As you can see, using `CaptureMetrics` on a vanilla http.Handler introduces an overhead of ~500 ns per http request on my machine. However, the margin of error appears to be larger than that, therefor it should be reasonable to assume that the overhead introduced by `CaptureMetrics` is absolutely negligible. ## License MIT
{ "source": "yandex/perforator", "title": "vendor/github.com/felixge/httpsnoop/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/felixge/httpsnoop/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 4069 }
# city [![](https://img.shields.io/badge/go-pkg-00ADD8)](https://pkg.go.dev/github.com/go-faster/city#section-documentation) [![](https://img.shields.io/codecov/c/github/go-faster/city?label=cover)](https://codecov.io/gh/go-faster/city) [![stable](https://img.shields.io/badge/-stable-brightgreen)](https://go-faster.org/docs/projects/status#stable) [CityHash](https://github.com/google/cityhash) in Go. Fork of [tenfyzhong/cityhash](https://github.com/tenfyzhong/cityhash). Note: **prefer [xxhash](https://github.com/cespare/xxhash) as non-cryptographic hash algorithm**, this package is intended for places where CityHash is already used. CityHash **is not compatible** to [FarmHash](https://github.com/google/farmhash), use [go-farm](https://github.com/dgryski/go-farm). ```console go get github.com/go-faster/city ``` ```go city.Hash128([]byte("hello")) ``` * Faster * Supports ClickHouse hash ``` name old time/op new time/op delta CityHash64-32 333ns ± 2% 108ns ± 3% -67.57% (p=0.000 n=10+10) CityHash128-32 347ns ± 2% 112ns ± 2% -67.74% (p=0.000 n=9+10) name old speed new speed delta CityHash64-32 3.08GB/s ± 2% 9.49GB/s ± 3% +208.40% (p=0.000 n=10+10) CityHash128-32 2.95GB/s ± 2% 9.14GB/s ± 2% +209.98% (p=0.000 n=9+10) ``` ## Benchmarks ``` goos: linux goarch: amd64 pkg: github.com/go-faster/city cpu: AMD Ryzen 9 5950X 16-Core Processor BenchmarkClickHouse128/16 2213.98 MB/s BenchmarkClickHouse128/64 4712.24 MB/s BenchmarkClickHouse128/256 7561.58 MB/s BenchmarkClickHouse128/1024 10158.98 MB/s BenchmarkClickHouse64 10379.89 MB/s BenchmarkCityHash32 3140.54 MB/s BenchmarkCityHash64 9508.45 MB/s BenchmarkCityHash128 9304.27 MB/s BenchmarkCityHash64Small 2700.84 MB/s BenchmarkCityHash128Small 1175.65 MB/s ```
{ "source": "yandex/perforator", "title": "vendor/github.com/go-faster/city/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-faster/city/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1862 }
# errors [![Go Reference](https://img.shields.io/badge/go-pkg-00ADD8)](https://pkg.go.dev/github.com/go-faster/errors#section-documentation) [![codecov](https://img.shields.io/codecov/c/github/go-faster/errors?label=cover)](https://codecov.io/gh/go-faster/errors) Fork of [xerrors](https://pkg.go.dev/golang.org/x/xerrors) with explicit [Wrap](https://pkg.go.dev/github.com/go-faster/errors#Wrap) instead of `%w`. > Clear is better than clever. ``` go get github.com/go-faster/errors ``` ```go errors.Wrap(err, "message") ``` ## Why * Using `Wrap` is the most explicit way to wrap errors * Wrapping with `fmt.Errorf("foo: %w", err)` is implicit, redundant and error-prone * Parsing `"foo: %w"` is implicit, redundant and slow * The [pkg/errors](https://github.com/pkg/errors) and [xerrors](https://pkg.go.dev/golang.org/x/xerrors) are not maintainted * The [cockroachdb/errors](https://github.com/cockroachdb/errors) is too big * The `errors` has no caller stack trace ## Don't need traces? Call `errors.DisableTrace` or use build tag `noerrtrace`. ## Additional features ### Into Generic type assertion for errors. ```go // Into finds the first error in err's chain that matches target type T, and if so, returns it. // // Into is type-safe alternative to As. func Into[T error](err error) (val T, ok bool) ``` ```go if pathError, ok := errors.Into[*os.PathError](err); ok { fmt.Println("Failed at path:", pathError.Path) } ``` ### Must Must is a generic helper, like template.Must, that wraps a call to a function returning (T, error) and panics if the error is non-nil. ```go func Must[T any](val T, err error) T ``` ## License BSD-3-Clause, same as Go sources
{ "source": "yandex/perforator", "title": "vendor/github.com/go-faster/errors/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-faster/errors/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1683 }
# CHANGELOG ## v1.0.0-rc1 This is the first logged release. Major changes (including breaking changes) have occurred since earlier tags.
{ "source": "yandex/perforator", "title": "vendor/github.com/go-logr/logr/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-logr/logr/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 139 }
# Contributing Logr is open to pull-requests, provided they fit within the intended scope of the project. Specifically, this library aims to be VERY small and minimalist, with no external dependencies. ## Compatibility This project intends to follow [semantic versioning](http://semver.org) and is very strict about compatibility. Any proposed changes MUST follow those rules. ## Performance As a logging library, logr must be as light-weight as possible. Any proposed code change must include results of running the [benchmark](./benchmark) before and after the change.
{ "source": "yandex/perforator", "title": "vendor/github.com/go-logr/logr/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-logr/logr/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 578 }
# A minimal logging API for Go [![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/logr.svg)](https://pkg.go.dev/github.com/go-logr/logr) [![Go Report Card](https://goreportcard.com/badge/github.com/go-logr/logr)](https://goreportcard.com/report/github.com/go-logr/logr) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-logr/logr/badge)](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr) logr offers an(other) opinion on how Go programs and libraries can do logging without becoming coupled to a particular logging implementation. This is not an implementation of logging - it is an API. In fact it is two APIs with two different sets of users. The `Logger` type is intended for application and library authors. It provides a relatively small API which can be used everywhere you want to emit logs. It defers the actual act of writing logs (to files, to stdout, or whatever) to the `LogSink` interface. The `LogSink` interface is intended for logging library implementers. It is a pure interface which can be implemented by logging frameworks to provide the actual logging functionality. This decoupling allows application and library developers to write code in terms of `logr.Logger` (which has very low dependency fan-out) while the implementation of logging is managed "up stack" (e.g. in or near `main()`.) Application developers can then switch out implementations as necessary. Many people assert that libraries should not be logging, and as such efforts like this are pointless. Those people are welcome to convince the authors of the tens-of-thousands of libraries that *DO* write logs that they are all wrong. In the meantime, logr takes a more practical approach. ## Typical usage Somewhere, early in an application's life, it will make a decision about which logging library (implementation) it actually wants to use. Something like: ``` func main() { // ... other setup code ... // Create the "root" logger. We have chosen the "logimpl" implementation, // which takes some initial parameters and returns a logr.Logger. logger := logimpl.New(param1, param2) // ... other setup code ... ``` Most apps will call into other libraries, create structures to govern the flow, etc. The `logr.Logger` object can be passed to these other libraries, stored in structs, or even used as a package-global variable, if needed. For example: ``` app := createTheAppObject(logger) app.Run() ``` Outside of this early setup, no other packages need to know about the choice of implementation. They write logs in terms of the `logr.Logger` that they received: ``` type appObject struct { // ... other fields ... logger logr.Logger // ... other fields ... } func (app *appObject) Run() { app.logger.Info("starting up", "timestamp", time.Now()) // ... app code ... ``` ## Background If the Go standard library had defined an interface for logging, this project probably would not be needed. Alas, here we are. When the Go developers started developing such an interface with [slog](https://github.com/golang/go/issues/56345), they adopted some of the logr design but also left out some parts and changed others: | Feature | logr | slog | |---------|------|------| | High-level API | `Logger` (passed by value) | `Logger` (passed by [pointer](https://github.com/golang/go/issues/59126)) | | Low-level API | `LogSink` | `Handler` | | Stack unwinding | done by `LogSink` | done by `Logger` | | Skipping helper functions | `WithCallDepth`, `WithCallStackHelper` | [not supported by Logger](https://github.com/golang/go/issues/59145) | | Generating a value for logging on demand | `Marshaler` | `LogValuer` | | Log levels | >= 0, higher meaning "less important" | positive and negative, with 0 for "info" and higher meaning "more important" | | Error log entries | always logged, don't have a verbosity level | normal log entries with level >= `LevelError` | | Passing logger via context | `NewContext`, `FromContext` | no API | | Adding a name to a logger | `WithName` | no API | | Modify verbosity of log entries in a call chain | `V` | no API | | Grouping of key/value pairs | not supported | `WithGroup`, `GroupValue` | | Pass context for extracting additional values | no API | API variants like `InfoCtx` | The high-level slog API is explicitly meant to be one of many different APIs that can be layered on top of a shared `slog.Handler`. logr is one such alternative API, with [interoperability](#slog-interoperability) provided by some conversion functions. ### Inspiration Before you consider this package, please read [this blog post by the inimitable Dave Cheney][warning-makes-no-sense]. We really appreciate what he has to say, and it largely aligns with our own experiences. ### Differences from Dave's ideas The main differences are: 1. Dave basically proposes doing away with the notion of a logging API in favor of `fmt.Printf()`. We disagree, especially when you consider things like output locations, timestamps, file and line decorations, and structured logging. This package restricts the logging API to just 2 types of logs: info and error. Info logs are things you want to tell the user which are not errors. Error logs are, well, errors. If your code receives an `error` from a subordinate function call and is logging that `error` *and not returning it*, use error logs. 2. Verbosity-levels on info logs. This gives developers a chance to indicate arbitrary grades of importance for info logs, without assigning names with semantic meaning such as "warning", "trace", and "debug." Superficially this may feel very similar, but the primary difference is the lack of semantics. Because verbosity is a numerical value, it's safe to assume that an app running with higher verbosity means more (and less important) logs will be generated. ## Implementations (non-exhaustive) There are implementations for the following logging libraries: - **a function** (can bridge to non-structured libraries): [funcr](https://github.com/go-logr/logr/tree/master/funcr) - **a testing.T** (for use in Go tests, with JSON-like output): [testr](https://github.com/go-logr/logr/tree/master/testr) - **github.com/google/glog**: [glogr](https://github.com/go-logr/glogr) - **k8s.io/klog** (for Kubernetes): [klogr](https://git.k8s.io/klog/klogr) - **a testing.T** (with klog-like text output): [ktesting](https://git.k8s.io/klog/ktesting) - **go.uber.org/zap**: [zapr](https://github.com/go-logr/zapr) - **log** (the Go standard library logger): [stdr](https://github.com/go-logr/stdr) - **github.com/sirupsen/logrus**: [logrusr](https://github.com/bombsimon/logrusr) - **github.com/wojas/genericr**: [genericr](https://github.com/wojas/genericr) (makes it easy to implement your own backend) - **logfmt** (Heroku style [logging](https://www.brandur.org/logfmt)): [logfmtr](https://github.com/iand/logfmtr) - **github.com/rs/zerolog**: [zerologr](https://github.com/go-logr/zerologr) - **github.com/go-kit/log**: [gokitlogr](https://github.com/tonglil/gokitlogr) (also compatible with github.com/go-kit/kit/log since v0.12.0) - **bytes.Buffer** (writing to a buffer): [bufrlogr](https://github.com/tonglil/buflogr) (useful for ensuring values were logged, like during testing) ## slog interoperability Interoperability goes both ways, using the `logr.Logger` API with a `slog.Handler` and using the `slog.Logger` API with a `logr.LogSink`. `FromSlogHandler` and `ToSlogHandler` convert between a `logr.Logger` and a `slog.Handler`. As usual, `slog.New` can be used to wrap such a `slog.Handler` in the high-level slog API. ### Using a `logr.LogSink` as backend for slog Ideally, a logr sink implementation should support both logr and slog by implementing both the normal logr interface(s) and `SlogSink`. Because of a conflict in the parameters of the common `Enabled` method, it is [not possible to implement both slog.Handler and logr.Sink in the same type](https://github.com/golang/go/issues/59110). If both are supported, log calls can go from the high-level APIs to the backend without the need to convert parameters. `FromSlogHandler` and `ToSlogHandler` can convert back and forth without adding additional wrappers, with one exception: when `Logger.V` was used to adjust the verbosity for a `slog.Handler`, then `ToSlogHandler` has to use a wrapper which adjusts the verbosity for future log calls. Such an implementation should also support values that implement specific interfaces from both packages for logging (`logr.Marshaler`, `slog.LogValuer`, `slog.GroupValue`). logr does not convert those. Not supporting slog has several drawbacks: - Recording source code locations works correctly if the handler gets called through `slog.Logger`, but may be wrong in other cases. That's because a `logr.Sink` does its own stack unwinding instead of using the program counter provided by the high-level API. - slog levels <= 0 can be mapped to logr levels by negating the level without a loss of information. But all slog levels > 0 (e.g. `slog.LevelWarning` as used by `slog.Logger.Warn`) must be mapped to 0 before calling the sink because logr does not support "more important than info" levels. - The slog group concept is supported by prefixing each key in a key/value pair with the group names, separated by a dot. For structured output like JSON it would be better to group the key/value pairs inside an object. - Special slog values and interfaces don't work as expected. - The overhead is likely to be higher. These drawbacks are severe enough that applications using a mixture of slog and logr should switch to a different backend. ### Using a `slog.Handler` as backend for logr Using a plain `slog.Handler` without support for logr works better than the other direction: - All logr verbosity levels can be mapped 1:1 to their corresponding slog level by negating them. - Stack unwinding is done by the `SlogSink` and the resulting program counter is passed to the `slog.Handler`. - Names added via `Logger.WithName` are gathered and recorded in an additional attribute with `logger` as key and the names separated by slash as value. - `Logger.Error` is turned into a log record with `slog.LevelError` as level and an additional attribute with `err` as key, if an error was provided. The main drawback is that `logr.Marshaler` will not be supported. Types should ideally support both `logr.Marshaler` and `slog.Valuer`. If compatibility with logr implementations without slog support is not important, then `slog.Valuer` is sufficient. ### Context support for slog Storing a logger in a `context.Context` is not supported by slog. `NewContextWithSlogLogger` and `FromContextAsSlogLogger` can be used to fill this gap. They store and retrieve a `slog.Logger` pointer under the same context key that is also used by `NewContext` and `FromContext` for `logr.Logger` value. When `NewContextWithSlogLogger` is followed by `FromContext`, the latter will automatically convert the `slog.Logger` to a `logr.Logger`. `FromContextAsSlogLogger` does the same for the other direction. With this approach, binaries which use either slog or logr are as efficient as possible with no unnecessary allocations. This is also why the API stores a `slog.Logger` pointer: when storing a `slog.Handler`, creating a `slog.Logger` on retrieval would need to allocate one. The downside is that switching back and forth needs more allocations. Because logr is the API that is already in use by different packages, in particular Kubernetes, the recommendation is to use the `logr.Logger` API in code which uses contextual logging. An alternative to adding values to a logger and storing that logger in the context is to store the values in the context and to configure a logging backend to extract those values when emitting log entries. This only works when log calls are passed the context, which is not supported by the logr API. With the slog API, it is possible, but not required. https://github.com/veqryn/slog-context is a package for slog which provides additional support code for this approach. It also contains wrappers for the context functions in logr, so developers who prefer to not use the logr APIs directly can use those instead and the resulting code will still be interoperable with logr. ## FAQ ### Conceptual #### Why structured logging? - **Structured logs are more easily queryable**: Since you've got key-value pairs, it's much easier to query your structured logs for particular values by filtering on the contents of a particular key -- think searching request logs for error codes, Kubernetes reconcilers for the name and namespace of the reconciled object, etc. - **Structured logging makes it easier to have cross-referenceable logs**: Similarly to searchability, if you maintain conventions around your keys, it becomes easy to gather all log lines related to a particular concept. - **Structured logs allow better dimensions of filtering**: if you have structure to your logs, you've got more precise control over how much information is logged -- you might choose in a particular configuration to log certain keys but not others, only log lines where a certain key matches a certain value, etc., instead of just having v-levels and names to key off of. - **Structured logs better represent structured data**: sometimes, the data that you want to log is inherently structured (think tuple-link objects.) Structured logs allow you to preserve that structure when outputting. #### Why V-levels? **V-levels give operators an easy way to control the chattiness of log operations**. V-levels provide a way for a given package to distinguish the relative importance or verbosity of a given log message. Then, if a particular logger or package is logging too many messages, the user of the package can simply change the v-levels for that library. #### Why not named levels, like Info/Warning/Error? Read [Dave Cheney's post][warning-makes-no-sense]. Then read [Differences from Dave's ideas](#differences-from-daves-ideas). #### Why not allow format strings, too? **Format strings negate many of the benefits of structured logs**: - They're not easily searchable without resorting to fuzzy searching, regular expressions, etc. - They don't store structured data well, since contents are flattened into a string. - They're not cross-referenceable. - They don't compress easily, since the message is not constant. (Unless you turn positional parameters into key-value pairs with numerical keys, at which point you've gotten key-value logging with meaningless keys.) ### Practical #### Why key-value pairs, and not a map? Key-value pairs are *much* easier to optimize, especially around allocations. Zap (a structured logger that inspired logr's interface) has [performance measurements](https://github.com/uber-go/zap#performance) that show this quite nicely. While the interface ends up being a little less obvious, you get potentially better performance, plus avoid making users type `map[string]string{}` every time they want to log. #### What if my V-levels differ between libraries? That's fine. Control your V-levels on a per-logger basis, and use the `WithName` method to pass different loggers to different libraries. Generally, you should take care to ensure that you have relatively consistent V-levels within a given logger, however, as this makes deciding on what verbosity of logs to request easier. #### But I really want to use a format string! That's not actually a question. Assuming your question is "how do I convert my mental model of logging with format strings to logging with constant messages": 1. Figure out what the error actually is, as you'd write in a TL;DR style, and use that as a message. 2. For every place you'd write a format specifier, look to the word before it, and add that as a key value pair. For instance, consider the following examples (all taken from spots in the Kubernetes codebase): - `klog.V(4).Infof("Client is returning errors: code %v, error %v", responseCode, err)` becomes `logger.Error(err, "client returned an error", "code", responseCode)` - `klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", seconds, retries, url)` becomes `logger.V(4).Info("got a retry-after response when requesting url", "attempt", retries, "after seconds", seconds, "url", url)` If you *really* must use a format string, use it in a key's value, and call `fmt.Sprintf` yourself. For instance: `log.Printf("unable to reflect over type %T")` becomes `logger.Info("unable to reflect over type", "type", fmt.Sprintf("%T"))`. In general though, the cases where this is necessary should be few and far between. #### How do I choose my V-levels? This is basically the only hard constraint: increase V-levels to denote more verbose or more debug-y logs. Otherwise, you can start out with `0` as "you always want to see this", `1` as "common logging that you might *possibly* want to turn off", and `10` as "I would like to performance-test your log collection stack." Then gradually choose levels in between as you need them, working your way down from 10 (for debug and trace style logs) and up from 1 (for chattier info-type logs). For reference, slog pre-defines -4 for debug logs (corresponds to 4 in logr), which matches what is [recommended for Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use). #### How do I choose my keys? Keys are fairly flexible, and can hold more or less any string value. For best compatibility with implementations and consistency with existing code in other projects, there are a few conventions you should consider. - Make your keys human-readable. - Constant keys are generally a good idea. - Be consistent across your codebase. - Keys should naturally match parts of the message string. - Use lower case for simple keys and [lowerCamelCase](https://en.wiktionary.org/wiki/lowerCamelCase) for more complex ones. Kubernetes is one example of a project that has [adopted that convention](https://github.com/kubernetes/community/blob/HEAD/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments). While key names are mostly unrestricted (and spaces are acceptable), it's generally a good idea to stick to printable ascii characters, or at least match the general character set of your log lines. #### Why should keys be constant values? The point of structured logging is to make later log processing easier. Your keys are, effectively, the schema of each log message. If you use different keys across instances of the same log line, you will make your structured logs much harder to use. `Sprintf()` is for values, not for keys! #### Why is this not a pure interface? The Logger type is implemented as a struct in order to allow the Go compiler to optimize things like high-V `Info` logs that are not triggered. Not all of these implementations are implemented yet, but this structure was suggested as a way to ensure they *can* be implemented. All of the real work is behind the `LogSink` interface. [warning-makes-no-sense]: http://dave.cheney.net/2015/11/05/lets-talk-about-logging
{ "source": "yandex/perforator", "title": "vendor/github.com/go-logr/logr/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-logr/logr/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 19462 }
# Minimal Go logging using logr and Go's standard library [![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/stdr.svg)](https://pkg.go.dev/github.com/go-logr/stdr) This package implements the [logr interface](https://github.com/go-logr/logr) in terms of Go's standard log package(https://pkg.go.dev/log).
{ "source": "yandex/perforator", "title": "vendor/github.com/go-logr/stdr/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-logr/stdr/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 316 }
# qt: quicker Go tests `go get github.com/go-quicktest/qt` Package qt provides a collection of Go helpers for writing tests. It uses generics, so requires Go 1.18 at least. For a complete API reference, see the [package documentation](https://pkg.go.dev/github.com/go-quicktest/qt). Quicktest helpers can be easily integrated inside regular Go tests, for instance: ```go import "github.com/go-quicktest/qt" func TestFoo(t *testing.T) { t.Run("numbers", func(t *testing.T) { numbers, err := somepackage.Numbers() qt.Assert(t, qt.DeepEquals(numbers, []int{42, 47}) qt.Assert(t, qt.ErrorMatches(err, "bad wolf")) }) t.Run("nil", func(t *testing.T) { got := somepackage.MaybeNil() qt.Assert(t, qt.IsNil(got), qt.Commentf("value: %v", somepackage.Value)) }) } ``` ### Assertions An assertion looks like this, where `qt.Equals` could be replaced by any available checker. If the assertion fails, the underlying `t.Fatal` method is called to describe the error and abort the test. qt.Assert(t, qt.Equals(someValue, wantValue)) If you don’t want to abort on failure, use `Check` instead, which calls `Error` instead of `Fatal`: qt.Check(t, qt.Equals(someValue, wantValue)) The library provides some base checkers like `Equals`, `DeepEquals`, `Matches`, `ErrorMatches`, `IsNil` and others. More can be added by implementing the Checker interface. ### Other helpers The `Patch` helper makes it a little more convenient to change a global or other variable for the duration of a test.
{ "source": "yandex/perforator", "title": "vendor/github.com/go-quicktest/qt/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-quicktest/qt/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1598 }
## Version 1.7.1 (2023-04-25) Changes: - bump actions/checkout@v3 and actions/setup-go@v3 (#1375) - Add go1.20 and mariadb10.11 to the testing matrix (#1403) - Increase default maxAllowedPacket size. (#1411) Bugfixes: - Use SET syntax as specified in the MySQL documentation (#1402) ## Version 1.7 (2022-11-29) Changes: - Drop support of Go 1.12 (#1211) - Refactoring `(*textRows).readRow` in a more clear way (#1230) - util: Reduce boundary check in escape functions. (#1316) - enhancement for mysqlConn handleAuthResult (#1250) New Features: - support Is comparison on MySQLError (#1210) - return unsigned in database type name when necessary (#1238) - Add API to express like a --ssl-mode=PREFERRED MySQL client (#1370) - Add SQLState to MySQLError (#1321) Bugfixes: - Fix parsing 0 year. (#1257) ## Version 1.6 (2021-04-01) Changes: - Migrate the CI service from travis-ci to GitHub Actions (#1176, #1183, #1190) - `NullTime` is deprecated (#960, #1144) - Reduce allocations when building SET command (#1111) - Performance improvement for time formatting (#1118) - Performance improvement for time parsing (#1098, #1113) New Features: - Implement `driver.Validator` interface (#1106, #1174) - Support returning `uint64` from `Valuer` in `ConvertValue` (#1143) - Add `json.RawMessage` for converter and prepared statement (#1059) - Interpolate `json.RawMessage` as `string` (#1058) - Implements `CheckNamedValue` (#1090) Bugfixes: - Stop rounding times (#1121, #1172) - Put zero filler into the SSL handshake packet (#1066) - Fix checking cancelled connections back into the connection pool (#1095) - Fix remove last 0 byte for mysql_old_password when password is empty (#1133) ## Version 1.5 (2020-01-07) Changes: - Dropped support Go 1.9 and lower (#823, #829, #886, #1016, #1017) - Improve buffer handling (#890) - Document potentially insecure TLS configs (#901) - Use a double-buffering scheme to prevent data races (#943) - Pass uint64 values without converting them to string (#838, #955) - Update collations and make utf8mb4 default (#877, #1054) - Make NullTime compatible with sql.NullTime in Go 1.13+ (#995) - Removed CloudSQL support (#993, #1007) - Add Go Module support (#1003) New Features: - Implement support of optional TLS (#900) - Check connection liveness (#934, #964, #997, #1048, #1051, #1052) - Implement Connector Interface (#941, #958, #1020, #1035) Bugfixes: - Mark connections as bad on error during ping (#875) - Mark connections as bad on error during dial (#867) - Fix connection leak caused by rapid context cancellation (#1024) - Mark connections as bad on error during Conn.Prepare (#1030) ## Version 1.4.1 (2018-11-14) Bugfixes: - Fix TIME format for binary columns (#818) - Fix handling of empty auth plugin names (#835) - Fix caching_sha2_password with empty password (#826) - Fix canceled context broke mysqlConn (#862) - Fix OldAuthSwitchRequest support (#870) - Fix Auth Response packet for cleartext password (#887) ## Version 1.4 (2018-06-03) Changes: - Documentation fixes (#530, #535, #567) - Refactoring (#575, #579, #580, #581, #603, #615, #704) - Cache column names (#444) - Sort the DSN parameters in DSNs generated from a config (#637) - Allow native password authentication by default (#644) - Use the default port if it is missing in the DSN (#668) - Removed the `strict` mode (#676) - Do not query `max_allowed_packet` by default (#680) - Dropped support Go 1.6 and lower (#696) - Updated `ConvertValue()` to match the database/sql/driver implementation (#760) - Document the usage of `0000-00-00T00:00:00` as the time.Time zero value (#783) - Improved the compatibility of the authentication system (#807) New Features: - Multi-Results support (#537) - `rejectReadOnly` DSN option (#604) - `context.Context` support (#608, #612, #627, #761) - Transaction isolation level support (#619, #744) - Read-Only transactions support (#618, #634) - `NewConfig` function which initializes a config with default values (#679) - Implemented the `ColumnType` interfaces (#667, #724) - Support for custom string types in `ConvertValue` (#623) - Implemented `NamedValueChecker`, improving support for uint64 with high bit set (#690, #709, #710) - `caching_sha2_password` authentication plugin support (#794, #800, #801, #802) - Implemented `driver.SessionResetter` (#779) - `sha256_password` authentication plugin support (#808) Bugfixes: - Use the DSN hostname as TLS default ServerName if `tls=true` (#564, #718) - Fixed LOAD LOCAL DATA INFILE for empty files (#590) - Removed columns definition cache since it sometimes cached invalid data (#592) - Don't mutate registered TLS configs (#600) - Make RegisterTLSConfig concurrency-safe (#613) - Handle missing auth data in the handshake packet correctly (#646) - Do not retry queries when data was written to avoid data corruption (#302, #736) - Cache the connection pointer for error handling before invalidating it (#678) - Fixed imports for appengine/cloudsql (#700) - Fix sending STMT_LONG_DATA for 0 byte data (#734) - Set correct capacity for []bytes read from length-encoded strings (#766) - Make RegisterDial concurrency-safe (#773) ## Version 1.3 (2016-12-01) Changes: - Go 1.1 is no longer supported - Use decimals fields in MySQL to format time types (#249) - Buffer optimizations (#269) - TLS ServerName defaults to the host (#283) - Refactoring (#400, #410, #437) - Adjusted documentation for second generation CloudSQL (#485) - Documented DSN system var quoting rules (#502) - Made statement.Close() calls idempotent to avoid errors in Go 1.6+ (#512) New Features: - Enable microsecond resolution on TIME, DATETIME and TIMESTAMP (#249) - Support for returning table alias on Columns() (#289, #359, #382) - Placeholder interpolation, can be actived with the DSN parameter `interpolateParams=true` (#309, #318, #490) - Support for uint64 parameters with high bit set (#332, #345) - Cleartext authentication plugin support (#327) - Exported ParseDSN function and the Config struct (#403, #419, #429) - Read / Write timeouts (#401) - Support for JSON field type (#414) - Support for multi-statements and multi-results (#411, #431) - DSN parameter to set the driver-side max_allowed_packet value manually (#489) - Native password authentication plugin support (#494, #524) Bugfixes: - Fixed handling of queries without columns and rows (#255) - Fixed a panic when SetKeepAlive() failed (#298) - Handle ERR packets while reading rows (#321) - Fixed reading NULL length-encoded integers in MySQL 5.6+ (#349) - Fixed absolute paths support in LOAD LOCAL DATA INFILE (#356) - Actually zero out bytes in handshake response (#378) - Fixed race condition in registering LOAD DATA INFILE handler (#383) - Fixed tests with MySQL 5.7.9+ (#380) - QueryUnescape TLS config names (#397) - Fixed "broken pipe" error by writing to closed socket (#390) - Fixed LOAD LOCAL DATA INFILE buffering (#424) - Fixed parsing of floats into float64 when placeholders are used (#434) - Fixed DSN tests with Go 1.7+ (#459) - Handle ERR packets while waiting for EOF (#473) - Invalidate connection on error while discarding additional results (#513) - Allow terminating packets of length 0 (#516) ## Version 1.2 (2014-06-03) Changes: - We switched back to a "rolling release". `go get` installs the current master branch again - Version v1 of the driver will not be maintained anymore. Go 1.0 is no longer supported by this driver - Exported errors to allow easy checking from application code - Enabled TCP Keepalives on TCP connections - Optimized INFILE handling (better buffer size calculation, lazy init, ...) - The DSN parser also checks for a missing separating slash - Faster binary date / datetime to string formatting - Also exported the MySQLWarning type - mysqlConn.Close returns the first error encountered instead of ignoring all errors - writePacket() automatically writes the packet size to the header - readPacket() uses an iterative approach instead of the recursive approach to merge splitted packets New Features: - `RegisterDial` allows the usage of a custom dial function to establish the network connection - Setting the connection collation is possible with the `collation` DSN parameter. This parameter should be preferred over the `charset` parameter - Logging of critical errors is configurable with `SetLogger` - Google CloudSQL support Bugfixes: - Allow more than 32 parameters in prepared statements - Various old_password fixes - Fixed TestConcurrent test to pass Go's race detection - Fixed appendLengthEncodedInteger for large numbers - Renamed readLengthEnodedString to readLengthEncodedString and skipLengthEnodedString to skipLengthEncodedString (fixed typo) ## Version 1.1 (2013-11-02) Changes: - Go-MySQL-Driver now requires Go 1.1 - Connections now use the collation `utf8_general_ci` by default. Adding `&charset=UTF8` to the DSN should not be necessary anymore - Made closing rows and connections error tolerant. This allows for example deferring rows.Close() without checking for errors - `[]byte(nil)` is now treated as a NULL value. Before, it was treated like an empty string / `[]byte("")` - DSN parameter values must now be url.QueryEscape'ed. This allows text values to contain special characters, such as '&'. - Use the IO buffer also for writing. This results in zero allocations (by the driver) for most queries - Optimized the buffer for reading - stmt.Query now caches column metadata - New Logo - Changed the copyright header to include all contributors - Improved the LOAD INFILE documentation - The driver struct is now exported to make the driver directly accessible - Refactored the driver tests - Added more benchmarks and moved all to a separate file - Other small refactoring New Features: - Added *old_passwords* support: Required in some cases, but must be enabled by adding `allowOldPasswords=true` to the DSN since it is insecure - Added a `clientFoundRows` parameter: Return the number of matching rows instead of the number of rows changed on UPDATEs - Added TLS/SSL support: Use a TLS/SSL encrypted connection to the server. Custom TLS configs can be registered and used Bugfixes: - Fixed MySQL 4.1 support: MySQL 4.1 sends packets with lengths which differ from the specification - Convert to DB timezone when inserting `time.Time` - Splitted packets (more than 16MB) are now merged correctly - Fixed false positive `io.EOF` errors when the data was fully read - Avoid panics on reuse of closed connections - Fixed empty string producing false nil values - Fixed sign byte for positive TIME fields ## Version 1.0 (2013-05-14) Initial Release
{ "source": "yandex/perforator", "title": "vendor/github.com/go-sql-driver/mysql/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-sql-driver/mysql/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 10883 }
# Go-MySQL-Driver A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) package ![Go-MySQL-Driver logo](https://raw.github.com/wiki/go-sql-driver/mysql/gomysql_m.png "Golang Gopher holding the MySQL Dolphin") --------------------------------------- * [Features](#features) * [Requirements](#requirements) * [Installation](#installation) * [Usage](#usage) * [DSN (Data Source Name)](#dsn-data-source-name) * [Password](#password) * [Protocol](#protocol) * [Address](#address) * [Parameters](#parameters) * [Examples](#examples) * [Connection pool and timeouts](#connection-pool-and-timeouts) * [context.Context Support](#contextcontext-support) * [ColumnType Support](#columntype-support) * [LOAD DATA LOCAL INFILE support](#load-data-local-infile-support) * [time.Time support](#timetime-support) * [Unicode support](#unicode-support) * [Testing / Development](#testing--development) * [License](#license) --------------------------------------- ## Features * Lightweight and [fast](https://github.com/go-sql-driver/sql-benchmark "golang MySQL-Driver performance") * Native Go implementation. No C-bindings, just pure Go * Connections over TCP/IPv4, TCP/IPv6, Unix domain sockets or [custom protocols](https://godoc.org/github.com/go-sql-driver/mysql#DialFunc) * Automatic handling of broken connections * Automatic Connection Pooling *(by database/sql package)* * Supports queries larger than 16MB * Full [`sql.RawBytes`](https://golang.org/pkg/database/sql/#RawBytes) support. * Intelligent `LONG DATA` handling in prepared statements * Secure `LOAD DATA LOCAL INFILE` support with file allowlisting and `io.Reader` support * Optional `time.Time` parsing * Optional placeholder interpolation ## Requirements * Go 1.13 or higher. We aim to support the 3 latest versions of Go. * MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+) --------------------------------------- ## Installation Simple install the package to your [$GOPATH](https://github.com/golang/go/wiki/GOPATH "GOPATH") with the [go tool](https://golang.org/cmd/go/ "go command") from shell: ```bash $ go get -u github.com/go-sql-driver/mysql ``` Make sure [Git is installed](https://git-scm.com/downloads) on your machine and in your system's `PATH`. ## Usage _Go MySQL Driver_ is an implementation of Go's `database/sql/driver` interface. You only need to import the driver and can use the full [`database/sql`](https://golang.org/pkg/database/sql/) API then. Use `mysql` as `driverName` and a valid [DSN](#dsn-data-source-name) as `dataSourceName`: ```go import ( "database/sql" "time" _ "github.com/go-sql-driver/mysql" ) // ... db, err := sql.Open("mysql", "user:password@/dbname") if err != nil { panic(err) } // See "Important settings" section. db.SetConnMaxLifetime(time.Minute * 3) db.SetMaxOpenConns(10) db.SetMaxIdleConns(10) ``` [Examples are available in our Wiki](https://github.com/go-sql-driver/mysql/wiki/Examples "Go-MySQL-Driver Examples"). ### Important settings `db.SetConnMaxLifetime()` is required to ensure connections are closed by the driver safely before connection is closed by MySQL server, OS, or other middlewares. Since some middlewares close idle connections by 5 minutes, we recommend timeout shorter than 5 minutes. This setting helps load balancing and changing system variables too. `db.SetMaxOpenConns()` is highly recommended to limit the number of connection used by the application. There is no recommended limit number because it depends on application and MySQL server. `db.SetMaxIdleConns()` is recommended to be set same to `db.SetMaxOpenConns()`. When it is smaller than `SetMaxOpenConns()`, connections can be opened and closed much more frequently than you expect. Idle connections can be closed by the `db.SetConnMaxLifetime()`. If you want to close idle connections more rapidly, you can use `db.SetConnMaxIdleTime()` since Go 1.15. ### DSN (Data Source Name) The Data Source Name has a common format, like e.g. [PEAR DB](http://pear.php.net/manual/en/package.database.db.intro-dsn.php) uses it, but without type-prefix (optional parts marked by squared brackets): ``` [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN] ``` A DSN in its fullest form: ``` username:password@protocol(address)/dbname?param=value ``` Except for the databasename, all values are optional. So the minimal DSN is: ``` /dbname ``` If you do not want to preselect a database, leave `dbname` empty: ``` / ``` This has the same effect as an empty DSN string: ``` ``` Alternatively, [Config.FormatDSN](https://godoc.org/github.com/go-sql-driver/mysql#Config.FormatDSN) can be used to create a DSN string by filling a struct. #### Password Passwords can consist of any character. Escaping is **not** necessary. #### Protocol See [net.Dial](https://golang.org/pkg/net/#Dial) for more information which networks are available. In general you should use an Unix domain socket if available and TCP otherwise for best performance. #### Address For TCP and UDP networks, addresses have the form `host[:port]`. If `port` is omitted, the default port will be used. If `host` is a literal IPv6 address, it must be enclosed in square brackets. The functions [net.JoinHostPort](https://golang.org/pkg/net/#JoinHostPort) and [net.SplitHostPort](https://golang.org/pkg/net/#SplitHostPort) manipulate addresses in this form. For Unix domain sockets the address is the absolute path to the MySQL-Server-socket, e.g. `/var/run/mysqld/mysqld.sock` or `/tmp/mysql.sock`. #### Parameters *Parameters are case-sensitive!* Notice that any of `true`, `TRUE`, `True` or `1` is accepted to stand for a true boolean value. Not surprisingly, false can be specified as any of: `false`, `FALSE`, `False` or `0`. ##### `allowAllFiles` ``` Type: bool Valid Values: true, false Default: false ``` `allowAllFiles=true` disables the file allowlist for `LOAD DATA LOCAL INFILE` and allows *all* files. [*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html) ##### `allowCleartextPasswords` ``` Type: bool Valid Values: true, false Default: false ``` `allowCleartextPasswords=true` allows using the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network. ##### `allowFallbackToPlaintext` ``` Type: bool Valid Values: true, false Default: false ``` `allowFallbackToPlaintext=true` acts like a `--ssl-mode=PREFERRED` MySQL client as described in [Command Options for Connecting to the Server](https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#option_general_ssl-mode) ##### `allowNativePasswords` ``` Type: bool Valid Values: true, false Default: true ``` `allowNativePasswords=false` disallows the usage of MySQL native password method. ##### `allowOldPasswords` ``` Type: bool Valid Values: true, false Default: false ``` `allowOldPasswords=true` allows the usage of the insecure old password method. This should be avoided, but is necessary in some cases. See also [the old_passwords wiki page](https://github.com/go-sql-driver/mysql/wiki/old_passwords). ##### `charset` ``` Type: string Valid Values: <name> Default: none ``` Sets the charset used for client-server interaction (`"SET NAMES <value>"`). If multiple charsets are set (separated by a comma), the following charset is used if setting the charset failes. This enables for example support for `utf8mb4` ([introduced in MySQL 5.5.3](http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html)) with fallback to `utf8` for older servers (`charset=utf8mb4,utf8`). Usage of the `charset` parameter is discouraged because it issues additional queries to the server. Unless you need the fallback behavior, please use `collation` instead. ##### `checkConnLiveness` ``` Type: bool Valid Values: true, false Default: true ``` On supported platforms connections retrieved from the connection pool are checked for liveness before using them. If the check fails, the respective connection is marked as bad and the query retried with another connection. `checkConnLiveness=false` disables this liveness check of connections. ##### `collation` ``` Type: string Valid Values: <name> Default: utf8mb4_general_ci ``` Sets the collation used for client-server interaction on connection. In contrast to `charset`, `collation` does not issue additional queries. If the specified collation is unavailable on the target server, the connection will fail. A list of valid charsets for a server is retrievable with `SHOW COLLATION`. The default collation (`utf8mb4_general_ci`) is supported from MySQL 5.5. You should use an older collation (e.g. `utf8_general_ci`) for older MySQL. Collations for charset "ucs2", "utf16", "utf16le", and "utf32" can not be used ([ref](https://dev.mysql.com/doc/refman/5.7/en/charset-connection.html#charset-connection-impermissible-client-charset)). ##### `clientFoundRows` ``` Type: bool Valid Values: true, false Default: false ``` `clientFoundRows=true` causes an UPDATE to return the number of matching rows instead of the number of rows changed. ##### `columnsWithAlias` ``` Type: bool Valid Values: true, false Default: false ``` When `columnsWithAlias` is true, calls to `sql.Rows.Columns()` will return the table alias and the column name separated by a dot. For example: ``` SELECT u.id FROM users as u ``` will return `u.id` instead of just `id` if `columnsWithAlias=true`. ##### `interpolateParams` ``` Type: bool Valid Values: true, false Default: false ``` If `interpolateParams` is true, placeholders (`?`) in calls to `db.Query()` and `db.Exec()` are interpolated into a single query string with given parameters. This reduces the number of roundtrips, since the driver has to prepare a statement, execute it with given parameters and close the statement again with `interpolateParams=false`. *This can not be used together with the multibyte encodings BIG5, CP932, GB2312, GBK or SJIS. These are rejected as they may [introduce a SQL injection vulnerability](http://stackoverflow.com/a/12118602/3430118)!* ##### `loc` ``` Type: string Valid Values: <escaped name> Default: UTC ``` Sets the location for time.Time values (when using `parseTime=true`). *"Local"* sets the system's location. See [time.LoadLocation](https://golang.org/pkg/time/#LoadLocation) for details. Note that this sets the location for time.Time values but does not change MySQL's [time_zone setting](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html). For that see the [time_zone system variable](#system-variables), which can also be set as a DSN parameter. Please keep in mind, that param values must be [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`. ##### `maxAllowedPacket` ``` Type: decimal number Default: 64*1024*1024 ``` Max packet size allowed in bytes. The default value is 64 MiB and should be adjusted to match the server settings. `maxAllowedPacket=0` can be used to automatically fetch the `max_allowed_packet` variable from server *on every connection*. ##### `multiStatements` ``` Type: bool Valid Values: true, false Default: false ``` Allow multiple statements in one query. While this allows batch queries, it also greatly increases the risk of SQL injections. Only the result of the first query is returned, all other results are silently discarded. When `multiStatements` is used, `?` parameters must only be used in the first statement. ##### `parseTime` ``` Type: bool Valid Values: true, false Default: false ``` `parseTime=true` changes the output type of `DATE` and `DATETIME` values to `time.Time` instead of `[]byte` / `string` The date or datetime like `0000-00-00 00:00:00` is converted into zero value of `time.Time`. ##### `readTimeout` ``` Type: duration Default: 0 ``` I/O read timeout. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*. ##### `rejectReadOnly` ``` Type: bool Valid Values: true, false Default: false ``` `rejectReadOnly=true` causes the driver to reject read-only connections. This is for a possible race condition during an automatic failover, where the mysql client gets connected to a read-only replica after the failover. Note that this should be a fairly rare case, as an automatic failover normally happens when the primary is down, and the race condition shouldn't happen unless it comes back up online as soon as the failover is kicked off. On the other hand, when this happens, a MySQL application can get stuck on a read-only connection until restarted. It is however fairly easy to reproduce, for example, using a manual failover on AWS Aurora's MySQL-compatible cluster. If you are not relying on read-only transactions to reject writes that aren't supposed to happen, setting this on some MySQL providers (such as AWS Aurora) is safer for failovers. Note that ERROR 1290 can be returned for a `read-only` server and this option will cause a retry for that error. However the same error number is used for some other cases. You should ensure your application will never cause an ERROR 1290 except for `read-only` mode when enabling this option. ##### `serverPubKey` ``` Type: string Valid Values: <name> Default: none ``` Server public keys can be registered with [`mysql.RegisterServerPubKey`](https://godoc.org/github.com/go-sql-driver/mysql#RegisterServerPubKey), which can then be used by the assigned name in the DSN. Public keys are used to transmit encrypted data, e.g. for authentication. If the server's public key is known, it should be set manually to avoid expensive and potentially insecure transmissions of the public key from the server to the client each time it is required. ##### `timeout` ``` Type: duration Default: OS default ``` Timeout for establishing connections, aka dial timeout. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*. ##### `tls` ``` Type: bool / string Valid Values: true, false, skip-verify, preferred, <name> Default: false ``` `tls=true` enables TLS / SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side) or use `preferred` to use TLS only when advertised by the server. This is similar to `skip-verify`, but additionally allows a fallback to a connection which is not encrypted. Neither `skip-verify` nor `preferred` add any reliable security. You can use a custom TLS config after registering it with [`mysql.RegisterTLSConfig`](https://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig). ##### `writeTimeout` ``` Type: duration Default: 0 ``` I/O write timeout. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*. ##### System Variables Any other parameters are interpreted as system variables: * `<boolean_var>=<value>`: `SET <boolean_var>=<value>` * `<enum_var>=<value>`: `SET <enum_var>=<value>` * `<string_var>=%27<value>%27`: `SET <string_var>='<value>'` Rules: * The values for string variables must be quoted with `'`. * The values must also be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed! (which implies values of string variables must be wrapped with `%27`). Examples: * `autocommit=1`: `SET autocommit=1` * [`time_zone=%27Europe%2FParis%27`](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html): `SET time_zone='Europe/Paris'` * [`transaction_isolation=%27REPEATABLE-READ%27`](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_isolation): `SET transaction_isolation='REPEATABLE-READ'` #### Examples ``` user@unix(/path/to/socket)/dbname ``` ``` root:pw@unix(/tmp/mysql.sock)/myDatabase?loc=Local ``` ``` user:password@tcp(localhost:5555)/dbname?tls=skip-verify&autocommit=true ``` Treat warnings as errors by setting the system variable [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html): ``` user:password@/dbname?sql_mode=TRADITIONAL ``` TCP via IPv6: ``` user:password@tcp([de:ad:be:ef::ca:fe]:80)/dbname?timeout=90s&collation=utf8mb4_unicode_ci ``` TCP on a remote host, e.g. Amazon RDS: ``` id:password@tcp(your-amazonaws-uri.com:3306)/dbname ``` Google Cloud SQL on App Engine: ``` user:password@unix(/cloudsql/project-id:region-name:instance-name)/dbname ``` TCP using default port (3306) on localhost: ``` user:password@tcp/dbname?charset=utf8mb4,utf8&sys_var=esc%40ped ``` Use the default protocol (tcp) and host (localhost:3306): ``` user:password@/dbname ``` No Database preselected: ``` user:password@/ ``` ### Connection pool and timeouts The connection pool is managed by Go's database/sql package. For details on how to configure the size of the pool and how long connections stay in the pool see `*DB.SetMaxOpenConns`, `*DB.SetMaxIdleConns`, and `*DB.SetConnMaxLifetime` in the [database/sql documentation](https://golang.org/pkg/database/sql/). The read, write, and dial timeouts for each individual connection are configured with the DSN parameters [`readTimeout`](#readtimeout), [`writeTimeout`](#writetimeout), and [`timeout`](#timeout), respectively. ## `ColumnType` Support This driver supports the [`ColumnType` interface](https://golang.org/pkg/database/sql/#ColumnType) introduced in Go 1.8, with the exception of [`ColumnType.Length()`](https://golang.org/pkg/database/sql/#ColumnType.Length), which is currently not supported. All Unsigned database type names will be returned `UNSIGNED ` with `INT`, `TINYINT`, `SMALLINT`, `BIGINT`. ## `context.Context` Support Go 1.8 added `database/sql` support for `context.Context`. This driver supports query timeouts and cancellation via contexts. See [context support in the database/sql package](https://golang.org/doc/go1.8#database_sql) for more details. ### `LOAD DATA LOCAL INFILE` support For this feature you need direct access to the package. Therefore you must change the import path (no `_`): ```go import "github.com/go-sql-driver/mysql" ``` Files must be explicitly allowed by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the allowlist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)). To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::<name>` then. Choose different names for different handlers and `DeregisterReaderHandler` when you don't need it anymore. See the [godoc of Go-MySQL-Driver](https://godoc.org/github.com/go-sql-driver/mysql "golang mysql driver documentation") for details. ### `time.Time` support The default internal output type of MySQL `DATE` and `DATETIME` values is `[]byte` which allows you to scan the value into a `[]byte`, `string` or `sql.RawBytes` variable in your program. However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical equivalent in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](https://golang.org/pkg/time/#Location) with the `loc` DSN parameter. **Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes). ### Unicode support Since version 1.5 Go-MySQL-Driver automatically uses the collation ` utf8mb4_general_ci` by default. Other collations / charsets can be set using the [`collation`](#collation) DSN parameter. Version 1.0 of the driver recommended adding `&charset=utf8` (alias for `SET NAMES utf8`) to the DSN to enable proper UTF-8 support. This is not necessary anymore. The [`collation`](#collation) parameter should be preferred to set another collation / charset than the default. See http://dev.mysql.com/doc/refman/8.0/en/charset-unicode.html for more details on MySQL's Unicode support. ## Testing / Development To run the driver tests you may need to adjust the configuration. See the [Testing Wiki-Page](https://github.com/go-sql-driver/mysql/wiki/Testing "Testing") for details. Go-MySQL-Driver is not feature-complete yet. Your help is very appreciated. If you want to contribute, you can work on an [open issue](https://github.com/go-sql-driver/mysql/issues?state=open) or review a [pull request](https://github.com/go-sql-driver/mysql/pulls). See the [Contribution Guidelines](https://github.com/go-sql-driver/mysql/blob/master/.github/CONTRIBUTING.md) for details. --------------------------------------- ## License Go-MySQL-Driver is licensed under the [Mozilla Public License Version 2.0](https://raw.github.com/go-sql-driver/mysql/master/LICENSE) Mozilla summarizes the license scope as follows: > MPL: The copyleft applies to any files containing MPLed code. That means: * You can **use** the **unchanged** source code both in private and commercially. * When distributing, you **must publish** the source code of any **changed files** licensed under the MPL 2.0 under a) the MPL 2.0 itself or b) a compatible license (e.g. GPL 3.0 or Apache License 2.0). * You **needn't publish** the source code of your library as long as the files licensed under the MPL 2.0 are **unchanged**. Please read the [MPL 2.0 FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/) if you have further questions regarding the license. You can read the full terms here: [LICENSE](https://raw.github.com/go-sql-driver/mysql/master/LICENSE). ![Go Gopher and MySQL Dolphin](https://raw.github.com/wiki/go-sql-driver/mysql/go-mysql-driver_m.jpg "Golang Gopher transporting the MySQL Dolphin in a wheelbarrow")
{ "source": "yandex/perforator", "title": "vendor/github.com/go-sql-driver/mysql/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/go-sql-driver/mysql/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 23095 }
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Added ### Changed ### Fixed ## [1.6.0] - 2023-08-28 ### Added - Added the InstaclustrPasswordAuthenticator to the list of default approved authenticators. (#1711) - Added the `com.scylladb.auth.SaslauthdAuthenticator` and `com.scylladb.auth.TransitionalAuthenticator` to the list of default approved authenticators. (#1712) - Added transferring Keyspace and Table names to the Query from the prepared response and updating information about that every time this information is received. (#1714) ### Changed - Tracer created with NewTraceWriter now includes the thread information from trace events in the output. (#1716) - Increased default timeouts so that they are higher than Cassandra default timeouts. This should help prevent issues where a default configuration overloads a server using default timeouts during retries. (#1701, #1719) ## [1.5.2] - 2023-06-12 Same as 1.5.0. GitHub does not like gpg signed text in the tag message (even with prefixed armor), so pushing a new tag. ## [1.5.1] - 2023-06-12 Same as 1.5.0. GitHub does not like gpg signed text in the tag message, so pushing a new tag. ## [1.5.0] - 2023-06-12 ### Added - gocql now advertises the driver name and version in the STARTUP message to the server. The values are taken from the Go module's path and version (or from the replacement module, if used). (#1702) That allows the server to track which fork of the driver is being used. - Query.Values() to retrieve the values bound to the Query. This makes writing wrappers around Query easier. (#1700) ### Fixed - Potential panic on deserialization (#1695) - Unmarshalling of dates outside of `[1677-09-22, 2262-04-11]` range. (#1692) ## [1.4.0] - 2023-04-26 ### Added ### Changed - gocql now refreshes the entire ring when it receives a topology change event and when control connection is re-connected. This simplifies code managing ring state. (#1680) - Supported versions of Cassandra that we test against are now 4.0.x and 4.1.x. (#1685) - Default HostDialer now uses already-resolved connect address instead of hostname when establishing TCP connections (#1683). ### Fixed - Deadlock in Session.Close(). (#1688) - Race between Query.Release() and speculative executions (#1684) - Missed ring update during control connection reconnection (#1680) ## [1.3.2] - 2023-03-27 ### Changed - Supported versions of Go that we test against are now Go 1.19 and Go 1.20. ### Fixed - Node event handling now processes topology events before status events. This fixes some cases where new nodes were missed. (#1682) - Learning a new IP address for an existing node (identified by host ID) now triggers replacement of that host. This fixes some Kubernetes reconnection failures. (#1682) - Refresh ring when processing a node UP event for an unknown host. This fixes some cases where new nodes were missed. (#1669) ## [1.3.1] - 2022-12-13 ### Fixed - Panic in RackAwareRoundRobinPolicy caused by wrong alignment on 32-bit platforms. (#1666) ## [1.3.0] - 2022-11-29 ### Added - Added a RackAwareRoundRobinPolicy that attempts to keep client->server traffic in the same rack when possible. ### Changed - Supported versions of Go that we test against are now Go 1.18 and Go 1.19. ## [1.2.1] - 2022-09-02 ### Changed - GetCustomPayload now returns nil instead of panicking in case of query error. (#1385) ### Fixed - Nil pointer dereference in events.go when handling node removal. (#1652) - Reading peers from DataStax Enterprise clusters. This was a regression in 1.2.0. (#1646) - Unmarshaling maps did not pre-allocate the map. (#1642) ## [1.2.0] - 2022-07-07 This release improves support for connecting through proxies and some improvements when using Cassandra 4.0 or later. ### Added - HostDialer interface now allows customizing connection including TLS setup per host. (#1629) ### Changed - The driver now uses `host_id` instead of connect address to identify nodes. (#1632) - gocql reads `system.peers_v2` instead of `system.peers` when connected to Cassandra 4.0 or later and populates `HostInfo.Port` using the native port. (#1635) ### Fixed - Data race in `HostInfo.HostnameAndPort()`. (#1631) - Handling of nils when marshaling/unmarshaling lists and maps. (#1630) - Silent data corruption in case a map was serialized into UDT and some fields in the UDT were not present in the map. The driver now correctly writes nulls instead of shifting fields. (#1626, #1639) ## [1.1.0] - 2022-04-29 ### Added - Changelog. - StreamObserver and StreamObserverContext interfaces to allow observing CQL streams. - ClusterConfig.WriteTimeout option now allows to specify a write-timeout different from read-timeout. - TypeInfo.NewWithError method. ### Changed - Supported versions of Go that we test against are now Go 1.17 and Go 1.18. - The driver now returns an error if SetWriteDeadline fails. If you need to run gocql on a platform that does not support SetWriteDeadline, set WriteTimeout to zero to disable the timeout. - Creating streams on a connection that is closing now fails early. - HostFilter now also applies to control connections. - TokenAwareHostPolicy now panics immediately during initialization instead of at random point later if you reuse the TokenAwareHostPolicy between multiple sessions. Reusing TokenAwareHostPolicy between sessions was never supported. ### Fixed - The driver no longer resets the network connection if a write fails with non-network-related error. - Blocked network write to a network could block other goroutines, this is now fixed. - Fixed panic in unmarshalUDT when trying to unmarshal a user-defined-type to a non-pointer Go type. - Fixed panic when trying to unmarshal unknown/custom CQL type. ## Deprecated - TypeInfo.New, please use TypeInfo.NewWithError instead. ## [1.0.0] - 2022-03-04 ### Changed - Started tagging versions with semantic version tags
{ "source": "yandex/perforator", "title": "vendor/github.com/gocql/gocql/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/gocql/gocql/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 6172 }
# Contributing to gocql **TL;DR** - this manifesto sets out the bare minimum requirements for submitting a patch to gocql. This guide outlines the process of landing patches in gocql and the general approach to maintaining the code base. ## Background The goal of the gocql project is to provide a stable and robust CQL driver for Go. gocql is a community driven project that is coordinated by a small team of core developers. ## Minimum Requirement Checklist The following is a check list of requirements that need to be satisfied in order for us to merge your patch: * You should raise a pull request to gocql/gocql on Github * The pull request has a title that clearly summarizes the purpose of the patch * The motivation behind the patch is clearly defined in the pull request summary * Your name and email have been added to the `AUTHORS` file (for copyright purposes) * The patch will merge cleanly * The test coverage does not fall below the critical threshold (currently 64%) * The merge commit passes the regression test suite on Travis * `go fmt` has been applied to the submitted code * Notable changes (i.e. new features or changed behavior, bugfixes) are appropriately documented in CHANGELOG.md, functional changes also in godoc If there are any requirements that can't be reasonably satisfied, please state this either on the pull request or as part of discussion on the mailing list. Where appropriate, the core team may apply discretion and make an exception to these requirements. ## Beyond The Checklist In addition to stating the hard requirements, there are a bunch of things that we consider when assessing changes to the library. These soft requirements are helpful pointers of how to get a patch landed quicker and with less fuss. ### General QA Approach The gocql team needs to consider the ongoing maintainability of the library at all times. Patches that look like they will introduce maintenance issues for the team will not be accepted. Your patch will get merged quicker if you have decent test cases that provide test coverage for the new behavior you wish to introduce. Unit tests are good, integration tests are even better. An example of a unit test is `marshal_test.go` - this tests the serialization code in isolation. `cassandra_test.go` is an integration test suite that is executed against every version of Cassandra that gocql supports as part of the CI process on Travis. That said, the point of writing tests is to provide a safety net to catch regressions, so there is no need to go overboard with tests. Remember that the more tests you write, the more code we will have to maintain. So there's a balance to strike there. ### When It's Too Difficult To Automate Testing There are legitimate examples of where it is infeasible to write a regression test for a change. Never fear, we will still consider the patch and quite possibly accept the change without a test. The gocql team takes a pragmatic approach to testing. At the end of the day, you could be addressing an issue that is too difficult to reproduce in a test suite, but still occurs in a real production app. In this case, your production app is the test case, and we will have to trust that your change is good. Examples of pull requests that have been accepted without tests include: * https://github.com/gocql/gocql/pull/181 - this patch would otherwise require a multi-node cluster to be booted as part of the CI build * https://github.com/gocql/gocql/pull/179 - this bug can only be reproduced under heavy load in certain circumstances ### Sign Off Procedure Generally speaking, a pull request can get merged by any one of the core gocql team. If your change is minor, chances are that one team member will just go ahead and merge it there and then. As stated earlier, suitable test coverage will increase the likelihood that a single reviewer will assess and merge your change. If your change has no test coverage, or looks like it may have wider implications for the health and stability of the library, the reviewer may elect to refer the change to another team member to achieve consensus before proceeding. Therefore, the tighter and cleaner your patch is, the quicker it will go through the review process. ### Supported Features gocql is a low level wire driver for Cassandra CQL. By and large, we would like to keep the functional scope of the library as narrow as possible. We think that gocql should be tight and focused, and we will be naturally skeptical of things that could just as easily be implemented in a higher layer. Inevitably you will come across something that could be implemented in a higher layer, save for a minor change to the core API. In this instance, please strike up a conversation with the gocql team. Chances are we will understand what you are trying to achieve and will try to accommodate this in a maintainable way. ### Longer Term Evolution There are some long term plans for gocql that have to be taken into account when assessing changes. That said, gocql is ultimately a community driven project and we don't have a massive development budget, so sometimes the long term view might need to be de-prioritized ahead of short term changes. ## Officially Supported Server Versions Currently, the officially supported versions of the Cassandra server include: * 1.2.18 * 2.0.9 Chances are that gocql will work with many other versions. If you would like us to support a particular version of Cassandra, please start a conversation about what version you'd like us to consider. We are more likely to accept a new version if you help out by extending the regression suite to cover the new version to be supported. ## The Core Dev Team The core development team includes: * tux21b * phillipCouto * Zariel * 0x6e6562
{ "source": "yandex/perforator", "title": "vendor/github.com/gocql/gocql/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/gocql/gocql/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 5792 }
gocql ===== [![Join the chat at https://gitter.im/gocql/gocql](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gocql/gocql?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![go build](https://github.com/gocql/gocql/actions/workflows/main.yml/badge.svg) [![GoDoc](https://godoc.org/github.com/gocql/gocql?status.svg)](https://godoc.org/github.com/gocql/gocql) Package gocql implements a fast and robust Cassandra client for the Go programming language. Project Website: https://gocql.github.io/<br> API documentation: https://godoc.org/github.com/gocql/gocql<br> Discussions: https://groups.google.com/forum/#!forum/gocql Supported Versions ------------------ The following matrix shows the versions of Go and Cassandra that are tested with the integration test suite as part of the CI build: | Go/Cassandra | 4.0.x | 4.1.x | |--------------|-------|-------| | 1.19 | yes | yes | | 1.20 | yes | yes | Gocql has been tested in production against many versions of Cassandra. Due to limits in our CI setup we only test against the latest 2 GA releases. Sunsetting Model ---------------- In general, the gocql team will focus on supporting the current and previous versions of Go. gocql may still work with older versions of Go, but official support for these versions will have been sunset. Installation ------------ go get github.com/gocql/gocql Features -------- * Modern Cassandra client using the native transport * Automatic type conversions between Cassandra and Go * Support for all common types including sets, lists and maps * Custom types can implement a `Marshaler` and `Unmarshaler` interface * Strict type conversions without any loss of precision * Built-In support for UUIDs (version 1 and 4) * Support for logged, unlogged and counter batches * Cluster management * Automatic reconnect on connection failures with exponential falloff * Round robin distribution of queries to different hosts * Round robin distribution of queries to different connections on a host * Each connection can execute up to n concurrent queries (whereby n is the limit set by the protocol version the client chooses to use) * Optional automatic discovery of nodes * Policy based connection pool with token aware and round-robin policy implementations * Support for password authentication * Iteration over paged results with configurable page size * Support for TLS/SSL * Optional frame compression (using snappy) * Automatic query preparation * Support for query tracing * Support for Cassandra 2.1+ [binary protocol version 3](https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v3.spec) * Support for up to 32768 streams * Support for tuple types * Support for client side timestamps by default * Support for UDTs via a custom marshaller or struct tags * Support for Cassandra 3.0+ [binary protocol version 4](https://github.com/apache/cassandra/blob/trunk/doc/native_protocol_v4.spec) * An API to access the schema metadata of a given keyspace Performance ----------- While the driver strives to be highly performant, there are cases where it is difficult to test and verify. The driver is built with maintainability and code readability in mind first and then performance and features, as such every now and then performance may degrade, if this occurs please report and issue and it will be looked at and remedied. The only time the driver copies data from its read buffer is when it Unmarshal's data into supplied types. Some tips for getting more performance from the driver: * Use the TokenAware policy * Use many goroutines when doing inserts, the driver is asynchronous but provides a synchronous API, it can execute many queries concurrently * Tune query page size * Reading data from the network to unmarshal will incur a large amount of allocations, this can adversely affect the garbage collector, tune `GOGC` * Close iterators after use to recycle byte buffers Important Default Keyspace Changes ---------------------------------- gocql no longer supports executing "use <keyspace>" statements to simplify the library. The user still has the ability to define the default keyspace for connections but now the keyspace can only be defined before a session is created. Queries can still access keyspaces by indicating the keyspace in the query: ```sql SELECT * FROM example2.table; ``` Example of correct usage: ```go cluster := gocql.NewCluster("192.168.1.1", "192.168.1.2", "192.168.1.3") cluster.Keyspace = "example" ... session, err := cluster.CreateSession() ``` Example of incorrect usage: ```go cluster := gocql.NewCluster("192.168.1.1", "192.168.1.2", "192.168.1.3") cluster.Keyspace = "example" ... session, err := cluster.CreateSession() if err = session.Query("use example2").Exec(); err != nil { log.Fatal(err) } ``` This will result in an err being returned from the session.Query line as the user is trying to execute a "use" statement. Example ------- See [package documentation](https://pkg.go.dev/github.com/gocql/gocql#pkg-examples). Data Binding ------------ There are various ways to bind application level data structures to CQL statements: * You can write the data binding by hand, as outlined in the Tweet example. This provides you with the greatest flexibility, but it does mean that you need to keep your application code in sync with your Cassandra schema. * You can dynamically marshal an entire query result into an `[]map[string]interface{}` using the `SliceMap()` API. This returns a slice of row maps keyed by CQL column names. This method requires no special interaction with the gocql API, but it does require your application to be able to deal with a key value view of your data. * As a refinement on the `SliceMap()` API you can also call `MapScan()` which returns `map[string]interface{}` instances in a row by row fashion. * The `Bind()` API provides a client app with a low level mechanism to introspect query meta data and extract appropriate field values from application level data structures. * The [gocqlx](https://github.com/scylladb/gocqlx) package is an idiomatic extension to gocql that provides usability features. With gocqlx you can bind the query parameters from maps and structs, use named query parameters (:identifier) and scan the query results into structs and slices. It comes with a fluent and flexible CQL query builder that supports full CQL spec, including BATCH statements and custom functions. * Building on top of the gocql driver, [cqlr](https://github.com/relops/cqlr) adds the ability to auto-bind a CQL iterator to a struct or to bind a struct to an INSERT statement. * Another external project that layers on top of gocql is [cqlc](http://relops.com/cqlc) which generates gocql compliant code from your Cassandra schema so that you can write type safe CQL statements in Go with a natural query syntax. * [gocassa](https://github.com/hailocab/gocassa) is an external project that layers on top of gocql to provide convenient query building and data binding. * [gocqltable](https://github.com/kristoiv/gocqltable) provides an ORM-style convenience layer to make CRUD operations with gocql easier. Ecosystem --------- The following community maintained tools are known to integrate with gocql: * [gocqlx](https://github.com/scylladb/gocqlx) is a gocql extension that automates data binding, adds named queries support, provides flexible query builders and plays well with gocql. * [journey](https://github.com/db-journey/journey) is a migration tool with Cassandra support. * [negronicql](https://github.com/mikebthun/negronicql) is gocql middleware for Negroni. * [cqlr](https://github.com/relops/cqlr) adds the ability to auto-bind a CQL iterator to a struct or to bind a struct to an INSERT statement. * [cqlc](http://relops.com/cqlc) generates gocql compliant code from your Cassandra schema so that you can write type safe CQL statements in Go with a natural query syntax. * [gocassa](https://github.com/hailocab/gocassa) provides query building, adds data binding, and provides easy-to-use "recipe" tables for common query use-cases. * [gocqltable](https://github.com/kristoiv/gocqltable) is a wrapper around gocql that aims to simplify common operations. * [gockle](https://github.com/willfaught/gockle) provides simple, mockable interfaces that wrap gocql types * [scylladb](https://github.com/scylladb/scylla) is a fast Apache Cassandra-compatible NoSQL database * [go-cql-driver](https://github.com/MichaelS11/go-cql-driver) is an CQL driver conforming to the built-in database/sql interface. It is good for simple use cases where the database/sql interface is wanted. The CQL driver is a wrapper around this project. Other Projects -------------- * [gocqldriver](https://github.com/tux21b/gocqldriver) is the predecessor of gocql based on Go's `database/sql` package. This project isn't maintained anymore, because Cassandra wasn't a good fit for the traditional `database/sql` API. Use this package instead. SEO --- For some reason, when you Google `golang cassandra`, this project doesn't feature very highly in the result list. But if you Google `go cassandra`, then we're a bit higher up the list. So this is note to try to convince Google that golang is an alias for Go. License ------- > Copyright (c) 2012-2016 The gocql Authors. All rights reserved. > Use of this source code is governed by a BSD-style > license that can be found in the LICENSE file.
{ "source": "yandex/perforator", "title": "vendor/github.com/gocql/gocql/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/gocql/gocql/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 9500 }
# UUID [![License](https://img.shields.io/github/license/gofrs/uuid.svg)](https://github.com/gofrs/uuid/blob/master/LICENSE) [![Build Status](https://travis-ci.org/gofrs/uuid.svg?branch=master)](https://travis-ci.org/gofrs/uuid) [![GoDoc](http://godoc.org/github.com/gofrs/uuid?status.svg)](http://godoc.org/github.com/gofrs/uuid) [![Coverage Status](https://codecov.io/gh/gofrs/uuid/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/gofrs/uuid/) [![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/uuid)](https://goreportcard.com/report/github.com/gofrs/uuid) Package uuid provides a pure Go implementation of Universally Unique Identifiers (UUID) variant as defined in RFC-4122. This package supports both the creation and parsing of UUIDs in different formats. This package supports the following UUID versions: * Version 1, based on timestamp and MAC address (RFC-4122) * Version 3, based on MD5 hashing of a named value (RFC-4122) * Version 4, based on random numbers (RFC-4122) * Version 5, based on SHA-1 hashing of a named value (RFC-4122) This package also supports experimental Universally Unique Identifier implementations based on a [draft RFC](https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html) that updates RFC-4122 * Version 6, a k-sortable id based on timestamp, and field-compatible with v1 (draft-peabody-dispatch-new-uuid-format, RFC-4122) * Version 7, a k-sortable id based on timestamp (draft-peabody-dispatch-new-uuid-format, RFC-4122) The v6 and v7 IDs are **not** considered a part of the stable API, and may be subject to behavior or API changes as part of minor releases to this package. They will be updated as the draft RFC changes, and will become stable if and when the draft RFC is accepted. ## Project History This project was originally forked from the [github.com/satori/go.uuid](https://github.com/satori/go.uuid) repository after it appeared to be no longer maintained, while exhibiting [critical flaws](https://github.com/satori/go.uuid/issues/73). We have decided to take over this project to ensure it receives regular maintenance for the benefit of the larger Go community. We'd like to thank Maxim Bublis for his hard work on the original iteration of the package. ## License This source code of this package is released under the MIT License. Please see the [LICENSE](https://github.com/gofrs/uuid/blob/master/LICENSE) for the full content of the license. ## Recommended Package Version We recommend using v2.0.0+ of this package, as versions prior to 2.0.0 were created before our fork of the original package and have some known deficiencies. ## Installation It is recommended to use a package manager like `dep` that understands tagged releases of a package, as well as semantic versioning. If you are unable to make use of a dependency manager with your project, you can use the `go get` command to download it directly: ```Shell $ go get github.com/gofrs/uuid ``` ## Requirements Due to subtests not being supported in older versions of Go, this package is only regularly tested against Go 1.7+. This package may work perfectly fine with Go 1.2+, but support for these older versions is not actively maintained. ## Go 1.11 Modules As of v3.2.0, this repository no longer adopts Go modules, and v3.2.0 no longer has a `go.mod` file. As a result, v3.2.0 also drops support for the `github.com/gofrs/uuid/v3` import path. Only module-based consumers are impacted. With the v3.2.0 release, _all_ gofrs/uuid consumers should use the `github.com/gofrs/uuid` import path. An existing module-based consumer will continue to be able to build using the `github.com/gofrs/uuid/v3` import path using any valid consumer `go.mod` that worked prior to the publishing of v3.2.0, but any module-based consumer should start using the `github.com/gofrs/uuid` import path when possible and _must_ use the `github.com/gofrs/uuid` import path prior to upgrading to v3.2.0. Please refer to [Issue #61](https://github.com/gofrs/uuid/issues/61) and [Issue #66](https://github.com/gofrs/uuid/issues/66) for more details. ## Usage Here is a quick overview of how to use this package. For more detailed documentation, please see the [GoDoc Page](http://godoc.org/github.com/gofrs/uuid). ```go package main import ( "log" "github.com/gofrs/uuid" ) // Create a Version 4 UUID, panicking on error. // Use this form to initialize package-level variables. var u1 = uuid.Must(uuid.NewV4()) func main() { // Create a Version 4 UUID. u2, err := uuid.NewV4() if err != nil { log.Fatalf("failed to generate UUID: %v", err) } log.Printf("generated Version 4 UUID %v", u2) // Parse a UUID from a string. s := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" u3, err := uuid.FromString(s) if err != nil { log.Fatalf("failed to parse UUID %q: %v", s, err) } log.Printf("successfully parsed UUID %v", u3) } ``` ## References * [RFC-4122](https://tools.ietf.org/html/rfc4122) * [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01) * [New UUID Formats RFC Draft (Peabody) Rev 04](https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#)
{ "source": "yandex/perforator", "title": "vendor/github.com/gofrs/uuid/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/gofrs/uuid/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 5239 }
# glog [![PkgGoDev](https://pkg.go.dev/badge/github.com/golang/glog)](https://pkg.go.dev/github.com/golang/glog) Leveled execution logs for Go. This is an efficient pure Go implementation of leveled logs in the manner of the open source C++ package [_glog_](https://github.com/google/glog). By binding methods to booleans it is possible to use the log package without paying the expense of evaluating the arguments to the log. Through the `-vmodule` flag, the package also provides fine-grained control over logging at the file level. The comment from `glog.go` introduces the ideas: Package _glog_ implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. It provides the functions Info, Warning, Error, Fatal, plus formatting variants such as Infof. It also provides V-style loggingcontrolled by the `-v` and `-vmodule=file=2` flags. Basic examples: ```go glog.Info("Prepare to repel boarders") glog.Fatalf("Initialization failed: %s", err) ``` See the documentation for the V function for an explanation of these examples: ```go if glog.V(2) { glog.Info("Starting transaction...") } glog.V(2).Infoln("Processed", nItems, "elements") ``` The repository contains an open source version of the log package used inside Google. The master copy of the source lives inside Google, not here. The code in this repo is for export only and is not itself under development. Feature requests will be ignored. Send bug reports to [email protected].
{ "source": "yandex/perforator", "title": "vendor/github.com/golang/glog/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/golang/glog/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1484 }
# How to contribute # We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow. ## Contributor License Agreement ## Contributions to any Google project must be accompanied by a Contributor License Agreement. This is not a copyright **assignment**, it simply gives Google permission to use and redistribute your contributions as part of the project. * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA][]. * If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA][]. You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again. [individual CLA]: https://developers.google.com/open-source/cla/individual [corporate CLA]: https://developers.google.com/open-source/cla/corporate ## Submitting a patch ## 1. It's generally best to start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, it's helpful to know what people are working on. Mention in the initial issue that you are planning to work on that bug or feature so that it can be assigned to you. 1. Follow the normal process of [forking][] the project, and setup a new branch to work in. It's important that each group of changes be done in separate branches in order to ensure that a pull request only includes the commits related to that bug or feature. 1. Go makes it very simple to ensure properly formatted code, so always run `go fmt` on your code before committing it. You should also run [golint][] over your code. As noted in the [golint readme][], it's not strictly necessary that your code be completely "lint-free", but this will help you find common style issues. 1. Any significant changes should almost always be accompanied by tests. The project already has good test coverage, so look at some of the existing tests if you're unsure how to go about it. [gocov][] and [gocov-html][] are invaluable tools for seeing which parts of your code aren't being exercised by your tests. 1. Do your best to have [well-formed commit messages][] for each change. This provides consistency throughout the project, and ensures that commit messages are able to be formatted properly by various git tools. 1. Finally, push the commits to your fork and submit a [pull request][]. [forking]: https://help.github.com/articles/fork-a-repo [golint]: https://github.com/golang/lint [golint readme]: https://github.com/golang/lint/blob/master/README [gocov]: https://github.com/axw/gocov [gocov-html]: https://github.com/matm/gocov-html [well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits [pull request]: https://help.github.com/articles/creating-a-pull-request
{ "source": "yandex/perforator", "title": "vendor/github.com/google/gofuzz/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/gofuzz/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 3175 }
gofuzz ====== gofuzz is a library for populating go objects with random values. [![GoDoc](https://godoc.org/github.com/google/gofuzz?status.svg)](https://godoc.org/github.com/google/gofuzz) [![Travis](https://travis-ci.org/google/gofuzz.svg?branch=master)](https://travis-ci.org/google/gofuzz) This is useful for testing: * Do your project's objects really serialize/unserialize correctly in all cases? * Is there an incorrectly formatted object that will cause your project to panic? Import with ```import "github.com/google/gofuzz"``` You can use it on single variables: ```go f := fuzz.New() var myInt int f.Fuzz(&myInt) // myInt gets a random value. ``` You can use it on maps: ```go f := fuzz.New().NilChance(0).NumElements(1, 1) var myMap map[ComplexKeyType]string f.Fuzz(&myMap) // myMap will have exactly one element. ``` Customize the chance of getting a nil pointer: ```go f := fuzz.New().NilChance(.5) var fancyStruct struct { A, B, C, D *string } f.Fuzz(&fancyStruct) // About half the pointers should be set. ``` You can even customize the randomization completely if needed: ```go type MyEnum string const ( A MyEnum = "A" B MyEnum = "B" ) type MyInfo struct { Type MyEnum AInfo *string BInfo *string } f := fuzz.New().NilChance(0).Funcs( func(e *MyInfo, c fuzz.Continue) { switch c.Intn(2) { case 0: e.Type = A c.Fuzz(&e.AInfo) case 1: e.Type = B c.Fuzz(&e.BInfo) } }, ) var myObject MyInfo f.Fuzz(&myObject) // Type will correspond to whether A or B info is set. ``` See more examples in ```example_test.go```. You can use this library for easier [go-fuzz](https://github.com/dvyukov/go-fuzz)ing. go-fuzz provides the user a byte-slice, which should be converted to different inputs for the tested function. This library can help convert the byte slice. Consider for example a fuzz test for a the function `mypackage.MyFunc` that takes an int arguments: ```go // +build gofuzz package mypackage import fuzz "github.com/google/gofuzz" func Fuzz(data []byte) int { var i int fuzz.NewFromGoFuzz(data).Fuzz(&i) MyFunc(i) return 0 } ``` Happy testing!
{ "source": "yandex/perforator", "title": "vendor/github.com/google/gofuzz/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/gofuzz/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2328 }
# Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. This Code of Conduct also applies outside the project spaces when the Project Steward has a reasonable belief that an individual's behavior may have a negative impact on the project or its community. ## Conflict Resolution We do not believe that all conflict is bad; healthy debate and disagreement often yield positive results. However, it is never okay to be disrespectful or to engage in behavior that violates the project’s code of conduct. If you see someone violating the code of conduct, you are encouraged to address the behavior directly with those involved. Many issues can be resolved quickly and easily, and this gives people more control over the outcome of their dispute. If you are unable to resolve the matter for any reason, or if the behavior is threatening or harassing, report it. We are dedicated to providing an environment where participants feel welcome and safe. Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to receive and address reported violations of the code of conduct. They will then work with a committee consisting of representatives from the Open Source Programs Office and the Google Open Source Strategy team. If for any reason you are uncomfortable reaching out to the Project Steward, please email [email protected]. We will investigate every complaint, but you may not receive a direct response. We will use our discretion in determining when and how to follow up on reported incidents, which may range from not taking action to permanent expulsion from the project and project-sponsored spaces. We will notify the accused of the report and provide them an opportunity to discuss it before any action is taken. The identity of the reporter will be omitted from the details of the report supplied to the accused. In potentially harmful situations, such as ongoing harassment or threats to anyone's safety, we may take action without notice. ## Attribution This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
{ "source": "yandex/perforator", "title": "vendor/github.com/google/s2a-go/CODE_OF_CONDUCT.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/s2a-go/CODE_OF_CONDUCT.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 4498 }
# How to Contribute We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow. ## Contributor License Agreement Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one. You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again. ## Code reviews All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests. ## Community Guidelines This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/).
{ "source": "yandex/perforator", "title": "vendor/github.com/google/s2a-go/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/s2a-go/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1102 }
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
{ "source": "yandex/perforator", "title": "vendor/github.com/google/s2a-go/LICENSE.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/s2a-go/LICENSE.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 11323 }
# Secure Session Agent Client Libraries The Secure Session Agent is a service that enables a workload to offload select operations from the mTLS handshake and protects a workload's private key material from exfiltration. Specifically, the workload asks the Secure Session Agent for the TLS configuration to use during the handshake, to perform private key operations, and to validate the peer certificate chain. The Secure Session Agent's client libraries enable applications to communicate with the Secure Session Agent during the TLS handshake, and to encrypt traffic to the peer after the TLS handshake is complete. This repository contains the source code for the Secure Session Agent's Go client libraries, which allow gRPC and HTTP Go applications to use the Secure Session Agent.
{ "source": "yandex/perforator", "title": "vendor/github.com/google/s2a-go/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/s2a-go/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 788 }
# Changelog ## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16) ### Features * add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3)) ### Bug Fixes * fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06)) * Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6)) ## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12) ### Features * Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29)) ## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) ### Features * UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) ### Fixes * Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) ## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18) ### Bug Fixes * Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0)) ## Changelog
{ "source": "yandex/perforator", "title": "vendor/github.com/google/uuid/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/uuid/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1647 }
# How to contribute We definitely welcome patches and contribution to this project! ### Tips Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org). Always try to include a test case! If it is not possible or not necessary, please explain why in the pull request description. ### Releasing Commits that would precipitate a SemVer change, as described in the Conventional Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action) to create a release candidate pull request. Once submitted, `release-please` will create a release. For tips on how to work with `release-please`, see its documentation. ### Legal requirements In order to protect both you and ourselves, you will need to sign the [Contributor License Agreement](https://cla.developers.google.com/clas). You may have already signed it for other Google projects.
{ "source": "yandex/perforator", "title": "vendor/github.com/google/uuid/CONTRIBUTING.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/uuid/CONTRIBUTING.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 955 }
# uuid The uuid package generates and inspects UUIDs based on [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) and DCE 1.1: Authentication and Security Services. This package is based on the github.com/pborman/uuid package (previously named code.google.com/p/go-uuid). It differs from these earlier packages in that a UUID is a 16 byte array rather than a byte slice. One loss due to this change is the ability to represent an invalid UUID (vs a NIL UUID). ###### Install ```sh go get github.com/google/uuid ``` ###### Documentation [![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: http://pkg.go.dev/github.com/google/uuid
{ "source": "yandex/perforator", "title": "vendor/github.com/google/uuid/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/google/uuid/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 838 }
# Gorilla WebSocket [![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) [![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket) Gorilla WebSocket is a [Go](http://golang.org/) implementation of the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. ### Documentation * [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc) * [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat) * [Command example](https://github.com/gorilla/websocket/tree/master/examples/command) * [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo) * [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch) ### Status The Gorilla WebSocket package provides a complete and tested implementation of the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The package API is stable. ### Installation go get github.com/gorilla/websocket ### Protocol Compliance The Gorilla WebSocket package passes the server tests in the [Autobahn Test Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn).
{ "source": "yandex/perforator", "title": "vendor/github.com/gorilla/websocket/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/gorilla/websocket/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1375 }
go-hostpool =========== A Go package to intelligently and flexibly pool among multiple hosts from your Go application. Host selection can operate in round robin or epsilon greedy mode, and unresponsive hosts are avoided. Usage example: ```go hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{}) hostResponse := hp.Get() hostname := hostResponse.Host() err := _ // (make a request with hostname) hostResponse.Mark(err) ``` View more detailed documentation on [godoc.org](http://godoc.org/github.com/bitly/go-hostpool)
{ "source": "yandex/perforator", "title": "vendor/github.com/hailocab/go-hostpool/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/hailocab/go-hostpool/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 563 }
# errwrap `errwrap` is a package for Go that formalizes the pattern of wrapping errors and checking if an error contains another error. There is a common pattern in Go of taking a returned `error` value and then wrapping it (such as with `fmt.Errorf`) before returning it. The problem with this pattern is that you completely lose the original `error` structure. Arguably the _correct_ approach is that you should make a custom structure implementing the `error` interface, and have the original error as a field on that structure, such [as this example](http://golang.org/pkg/os/#PathError). This is a good approach, but you have to know the entire chain of possible rewrapping that happens, when you might just care about one. `errwrap` formalizes this pattern (it doesn't matter what approach you use above) by giving a single interface for wrapping errors, checking if a specific error is wrapped, and extracting that error. ## Installation and Docs Install using `go get github.com/hashicorp/errwrap`. Full documentation is available at http://godoc.org/github.com/hashicorp/errwrap ## Usage #### Basic Usage Below is a very basic example of its usage: ```go // A function that always returns an error, but wraps it, like a real // function might. func tryOpen() error { _, err := os.Open("/i/dont/exist") if err != nil { return errwrap.Wrapf("Doesn't exist: {{err}}", err) } return nil } func main() { err := tryOpen() // We can use the Contains helpers to check if an error contains // another error. It is safe to do this with a nil error, or with // an error that doesn't even use the errwrap package. if errwrap.Contains(err, "does not exist") { // Do something } if errwrap.ContainsType(err, new(os.PathError)) { // Do something } // Or we can use the associated `Get` functions to just extract // a specific error. This would return nil if that specific error doesn't // exist. perr := errwrap.GetType(err, new(os.PathError)) } ``` #### Custom Types If you're already making custom types that properly wrap errors, then you can get all the functionality of `errwraps.Contains` and such by implementing the `Wrapper` interface with just one function. Example: ```go type AppError { Code ErrorCode Err error } func (e *AppError) WrappedErrors() []error { return []error{e.Err} } ``` Now this works: ```go err := &AppError{Err: fmt.Errorf("an error")} if errwrap.ContainsType(err, fmt.Errorf("")) { // This will work! } ```
{ "source": "yandex/perforator", "title": "vendor/github.com/hashicorp/errwrap/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/hashicorp/errwrap/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2483 }
# go-multierror [![CircleCI](https://img.shields.io/circleci/build/github/hashicorp/go-multierror/master)](https://circleci.com/gh/hashicorp/go-multierror) [![Go Reference](https://pkg.go.dev/badge/github.com/hashicorp/go-multierror.svg)](https://pkg.go.dev/github.com/hashicorp/go-multierror) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/hashicorp/go-multierror) [circleci]: https://app.circleci.com/pipelines/github/hashicorp/go-multierror [godocs]: https://pkg.go.dev/github.com/hashicorp/go-multierror `go-multierror` is a package for Go that provides a mechanism for representing a list of `error` values as a single `error`. This allows a function in Go to return an `error` that might actually be a list of errors. If the caller knows this, they can unwrap the list and access the errors. If the caller doesn't know, the error formats to a nice human-readable format. `go-multierror` is fully compatible with the Go standard library [errors](https://golang.org/pkg/errors/) package, including the functions `As`, `Is`, and `Unwrap`. This provides a standardized approach for introspecting on error values. ## Installation and Docs Install using `go get github.com/hashicorp/go-multierror`. Full documentation is available at https://pkg.go.dev/github.com/hashicorp/go-multierror ### Requires go version 1.13 or newer `go-multierror` requires go version 1.13 or newer. Go 1.13 introduced [error wrapping](https://golang.org/doc/go1.13#error_wrapping), which this library takes advantage of. If you need to use an earlier version of go, you can use the [v1.0.0](https://github.com/hashicorp/go-multierror/tree/v1.0.0) tag, which doesn't rely on features in go 1.13. If you see compile errors that look like the below, it's likely that you're on an older version of go: ``` /go/src/github.com/hashicorp/go-multierror/multierror.go:112:9: undefined: errors.As /go/src/github.com/hashicorp/go-multierror/multierror.go:117:9: undefined: errors.Is ``` ## Usage go-multierror is easy to use and purposely built to be unobtrusive in existing Go applications/libraries that may not be aware of it. **Building a list of errors** The `Append` function is used to create a list of errors. This function behaves a lot like the Go built-in `append` function: it doesn't matter if the first argument is nil, a `multierror.Error`, or any other `error`, the function behaves as you would expect. ```go var result error if err := step1(); err != nil { result = multierror.Append(result, err) } if err := step2(); err != nil { result = multierror.Append(result, err) } return result ``` **Customizing the formatting of the errors** By specifying a custom `ErrorFormat`, you can customize the format of the `Error() string` function: ```go var result *multierror.Error // ... accumulate errors here, maybe using Append if result != nil { result.ErrorFormat = func([]error) string { return "errors!" } } ``` **Accessing the list of errors** `multierror.Error` implements `error` so if the caller doesn't know about multierror, it will work just fine. But if you're aware a multierror might be returned, you can use type switches to access the list of errors: ```go if err := something(); err != nil { if merr, ok := err.(*multierror.Error); ok { // Use merr.Errors } } ``` You can also use the standard [`errors.Unwrap`](https://golang.org/pkg/errors/#Unwrap) function. This will continue to unwrap into subsequent errors until none exist. **Extracting an error** The standard library [`errors.As`](https://golang.org/pkg/errors/#As) function can be used directly with a multierror to extract a specific error: ```go // Assume err is a multierror value err := somefunc() // We want to know if "err" has a "RichErrorType" in it and extract it. var errRich RichErrorType if errors.As(err, &errRich) { // It has it, and now errRich is populated. } ``` **Checking for an exact error value** Some errors are returned as exact errors such as the [`ErrNotExist`](https://golang.org/pkg/os/#pkg-variables) error in the `os` package. You can check if this error is present by using the standard [`errors.Is`](https://golang.org/pkg/errors/#Is) function. ```go // Assume err is a multierror value err := somefunc() if errors.Is(err, os.ErrNotExist) { // err contains os.ErrNotExist } ``` **Returning a multierror only if there are errors** If you build a `multierror.Error`, you can use the `ErrorOrNil` function to return an `error` implementation only if there are errors to return: ```go var result *multierror.Error // ... accumulate errors here // Return the `error` only if errors were added to the multierror, otherwise // return nil since there are no errors. return result.ErrorOrNil() ```
{ "source": "yandex/perforator", "title": "vendor/github.com/hashicorp/go-multierror/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/hashicorp/go-multierror/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 4757 }
golang-lru ========== Please upgrade to github.com/hashicorp/golang-lru/v2 for all new code as v1 will not be updated anymore. The v2 version supports generics and is faster; old code can specify a specific tag, e.g. github.com/hashicorp/golang-lru/v1.0.2 for backwards compatibility.
{ "source": "yandex/perforator", "title": "vendor/github.com/hashicorp/golang-lru/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/hashicorp/golang-lru/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 285 }
# github.com/ianlancetaylor/demangle A Go package that can be used to demangle C++ and Rust symbol names.
{ "source": "yandex/perforator", "title": "vendor/github.com/ianlancetaylor/demangle/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/ianlancetaylor/demangle/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 106 }
# 1.14.0 (February 11, 2023) * Fix: each connection attempt to new node gets own timeout (Nathan Giardina) * Set SNI for SSL connections (Stas Kelvich) * Fix: CopyFrom I/O race (Tommy Reilly) * Minor dependency upgrades # 1.13.0 (August 6, 2022) * Add sslpassword support (Eric McCormack and yun.xu) * Add prefer-standby target_session_attrs support (sergey.bashilov) * Fix GSS ErrorResponse handling (Oliver Tan) # 1.12.1 (May 7, 2022) * Fix: setting krbspn and krbsrvname in connection string (sireax) * Add support for Unix sockets on Windows (Eno Compton) * Stop ignoring ErrorResponse during SCRAM auth (Rafi Shamim) # 1.12.0 (April 21, 2022) * Add pluggable GSSAPI support (Oliver Tan) * Fix: Consider any "0A000" error a possible cached plan changed error due to locale * Better match psql fallback behavior with multiple hosts # 1.11.0 (February 7, 2022) * Support port in ip from LookupFunc to override config (James Hartig) * Fix TLS connection timeout (Blake Embrey) * Add support for read-only, primary, standby, prefer-standby target_session_attributes (Oscar) * Fix connect when receiving NoticeResponse # 1.10.1 (November 20, 2021) * Close without waiting for response (Kei Kamikawa) * Save waiting for network round-trip in CopyFrom (Rueian) * Fix concurrency issue with ContextWatcher * LRU.Get always checks context for cancellation / expiration (Georges Varouchas) # 1.10.0 (July 24, 2021) * net.Timeout errors are no longer returned when a query is canceled via context. A wrapped context error is returned. # 1.9.0 (July 10, 2021) * pgconn.Timeout only is true for errors originating in pgconn (Michael Darr) * Add defaults for sslcert, sslkey, and sslrootcert (Joshua Brindle) * Solve issue with 'sslmode=verify-full' when there are multiple hosts (mgoddard) * Fix default host when parsing URL without host but with port * Allow dbname query parameter in URL conn string * Update underlying dependencies # 1.8.1 (March 25, 2021) * Better connection string sanitization (ip.novikov) * Use proper pgpass location on Windows (Moshe Katz) * Use errors instead of golang.org/x/xerrors * Resume fallback on server error in Connect (Andrey Borodin) # 1.8.0 (December 3, 2020) * Add StatementErrored method to stmtcache.Cache. This allows the cache to purge invalidated prepared statements. (Ethan Pailes) # 1.7.2 (November 3, 2020) * Fix data value slices into work buffer with capacities larger than length. # 1.7.1 (October 31, 2020) * Do not asyncClose after receiving FATAL error from PostgreSQL server # 1.7.0 (September 26, 2020) * Exec(Params|Prepared) return ResultReader with FieldDescriptions loaded * Add ReceiveResults (Sebastiaan Mannem) * Fix parsing DSN connection with bad backslash * Add PgConn.CleanupDone so connection pools can determine when async close is complete # 1.6.4 (July 29, 2020) * Fix deadlock on error after CommandComplete but before ReadyForQuery * Fix panic on parsing DSN with trailing '=' # 1.6.3 (July 22, 2020) * Fix error message after AppendCertsFromPEM failure (vahid-sohrabloo) # 1.6.2 (July 14, 2020) * Update pgservicefile library # 1.6.1 (June 27, 2020) * Update golang.org/x/crypto to latest * Update golang.org/x/text to 0.3.3 * Fix error handling for bad PGSERVICE definition * Redact passwords in ParseConfig errors (Lukas Vogel) # 1.6.0 (June 6, 2020) * Fix panic when closing conn during cancellable query * Fix behavior of sslmode=require with sslrootcert present (Petr Jediný) * Fix field descriptions available after command concluded (Tobias Salzmann) * Support connect_timeout (georgysavva) * Handle IPv6 in connection URLs (Lukas Vogel) * Fix ValidateConnect with cancelable context * Improve CopyFrom performance * Add Config.Copy (georgysavva) # 1.5.0 (March 30, 2020) * Update golang.org/x/crypto for security fix * Implement "verify-ca" SSL mode (Greg Curtis) # 1.4.0 (March 7, 2020) * Fix ExecParams and ExecPrepared handling of empty query. * Support reading config from PostgreSQL service files. # 1.3.2 (February 14, 2020) * Update chunkreader to v2.0.1 for optimized default buffer size. # 1.3.1 (February 5, 2020) * Fix CopyFrom deadlock when multiple NoticeResponse received during copy # 1.3.0 (January 23, 2020) * Add Hijack and Construct. * Update pgproto3 to v2.0.1. # 1.2.1 (January 13, 2020) * Fix data race in context cancellation introduced in v1.2.0. # 1.2.0 (January 11, 2020) ## Features * Add Insert(), Update(), Delete(), and Select() statement type query methods to CommandTag. * Add PgError.SQLState method. This could be used for compatibility with other drivers and databases. ## Performance * Improve performance when context.Background() is used. (bakape) * CommandTag.RowsAffected is faster and does not allocate. ## Fixes * Try to cancel any in-progress query when a conn is closed by ctx cancel. * Handle NoticeResponse during CopyFrom. * Ignore errors sending Terminate message while closing connection. This mimics the behavior of libpq PGfinish. # 1.1.0 (October 12, 2019) * Add PgConn.IsBusy() method. # 1.0.1 (September 19, 2019) * Fix statement cache not properly cleaning discarded statements.
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgconn/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgconn/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 5166 }
[![](https://godoc.org/github.com/jackc/pgconn?status.svg)](https://godoc.org/github.com/jackc/pgconn) ![CI](https://github.com/jackc/pgconn/workflows/CI/badge.svg) --- This version is used with pgx `v4`. In pgx `v5` it is part of the https://github.com/jackc/pgx repository. --- # pgconn Package pgconn is a low-level PostgreSQL database driver. It operates at nearly the same level as the C library libpq. It is primarily intended to serve as the foundation for higher level libraries such as https://github.com/jackc/pgx. Applications should handle normal queries with a higher level library and only use pgconn directly when required for low-level access to PostgreSQL functionality. ## Example Usage ```go pgConn, err := pgconn.Connect(context.Background(), os.Getenv("DATABASE_URL")) if err != nil { log.Fatalln("pgconn failed to connect:", err) } defer pgConn.Close(context.Background()) result := pgConn.ExecParams(context.Background(), "SELECT email FROM users WHERE id=$1", [][]byte{[]byte("123")}, nil, nil, nil) for result.NextRow() { fmt.Println("User 123 has email:", string(result.Values()[0])) } _, err = result.Close() if err != nil { log.Fatalln("failed reading result:", err) } ``` ## Testing The pgconn tests require a PostgreSQL database. It will connect to the database specified in the `PGX_TEST_CONN_STRING` environment variable. The `PGX_TEST_CONN_STRING` environment variable can be a URL or DSN. In addition, the standard `PG*` environment variables will be respected. Consider using [direnv](https://github.com/direnv/direnv) to simplify environment variable handling. ### Example Test Environment Connect to your PostgreSQL server and run: ``` create database pgx_test; ``` Now you can run the tests: ```bash PGX_TEST_CONN_STRING="host=/var/run/postgresql dbname=pgx_test" go test ./... ``` ### Connection and Authentication Tests Pgconn supports multiple connection types and means of authentication. These tests are optional. They will only run if the appropriate environment variable is set. Run `go test -v | grep SKIP` to see if any tests are being skipped. Most developers will not need to enable these tests. See `ci/setup_test.bash` for an example set up if you need change authentication code.
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgconn/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgconn/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2251 }
[![](https://godoc.org/github.com/jackc/pgerrcode?status.svg)](https://godoc.org/github.com/jackc/pgerrcode) # pgerrcode Package pgerrcode contains constants for PostgreSQL error codes. ## License MIT for this package's code and PostgreSQL License for the underlying data.
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgerrcode/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgerrcode/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 276 }
[![](https://godoc.org/github.com/jackc/pgio?status.svg)](https://godoc.org/github.com/jackc/pgio) [![Build Status](https://travis-ci.org/jackc/pgio.svg)](https://travis-ci.org/jackc/pgio) # pgio Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. pgio provides functions for appending integers to a []byte while doing byte order conversion. Extracted from original implementation in https://github.com/jackc/pgx.
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgio/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgio/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 452 }
[![](https://godoc.org/github.com/jackc/pgpassfile?status.svg)](https://godoc.org/github.com/jackc/pgpassfile) [![Build Status](https://travis-ci.org/jackc/pgpassfile.svg)](https://travis-ci.org/jackc/pgpassfile) # pgpassfile Package pgpassfile is a parser PostgreSQL .pgpass files. Extracted and rewritten from original implementation in https://github.com/jackc/pgx.
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgpassfile/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgpassfile/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 371 }
[![Go Reference](https://pkg.go.dev/badge/github.com/jackc/pgservicefile.svg)](https://pkg.go.dev/github.com/jackc/pgservicefile) [![Build Status](https://github.com/jackc/pgservicefile/actions/workflows/ci.yml/badge.svg)](https://github.com/jackc/pgservicefile/actions/workflows/ci.yml) # pgservicefile Package pgservicefile is a parser for PostgreSQL service files (e.g. `.pg_service.conf`).
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgservicefile/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgservicefile/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 396 }
# 1.12.0 (August 6, 2022) * Add JSONArray (Jakob Ackermann) * Support Inet from fmt.Stringer and encoding.TextMarshaler (Ville Skyttä) * Support UUID from fmt.Stringer interface (Lasse Hyldahl Jensen) * Fix: shopspring-numeric extension does not panic on NaN * Numeric can be assigned to string * Fix: Do not send IPv4 networks as IPv4-mapped IPv6 (William Storey) * Fix: PlanScan for interface{}(nil) (James Hartig) * Fix: *sql.Scanner for NULL handling (James Hartig) * Timestamp[tz].Set() supports string (Harmen) * Fix: Hstore AssignTo with map of *string (Diego Becciolini) # 1.11.0 (April 21, 2022) * Add multirange for numeric, int4, and int8 (Vu) * JSONBArray now supports json.RawMessage (Jens Emil Schulz Østergaard) * Add RecordArray (WGH) * Add UnmarshalJSON to pgtype.Int2 * Hstore.Set accepts map[string]Text # 1.10.0 (February 7, 2022) * Normalize UTC timestamps to comply with stdlib (Torkel Rogstad) * Assign Numeric to *big.Rat (Oleg Lomaka) * Fix typo in float8 error message (Pinank Solanki) * Scan type aliases for floating point types (Collin Forsyth) # 1.9.1 (November 28, 2021) * Fix: binary timestamp is assumed to be in UTC (restored behavior changed in v1.9.0) # 1.9.0 (November 20, 2021) * Fix binary hstore null decoding * Add shopspring/decimal.NullDecimal support to integration (Eli Treuherz) * Inet.Set supports bare IP address (Carl Dunham) * Add zeronull.Float8 * Fix NULL being lost when scanning unknown OID into sql.Scanner * Fix BPChar.AssignTo **rune * Add support for fmt.Stringer and driver.Valuer in String fields encoding (Jan Dubsky) * Fix really big timestamp(tz)s binary format parsing (e.g. year 294276) (Jim Tsao) * Support `map[string]*string` as hstore (Adrian Sieger) * Fix parsing text array with negative bounds * Add infinity support for numeric (Jim Tsao) # 1.8.1 (July 24, 2021) * Cleaned up Go module dependency chain # 1.8.0 (July 10, 2021) * Maintain host bits for inet types (Cameron Daniel) * Support pointers of wrapping structs (Ivan Daunis) * Register JSONBArray at NewConnInfo() (Rueian) * CompositeTextScanner handles backslash escapes # 1.7.0 (March 25, 2021) * Fix scanning int into **sql.Scanner implementor * Add tsrange array type (Vasilii Novikov) * Fix: escaped strings when they start or end with a newline char (Stephane Martin) * Accept nil *time.Time in Time.Set * Fix numeric NaN support * Use Go 1.13 errors instead of xerrors # 1.6.2 (December 3, 2020) * Fix panic on assigning empty array to non-slice or array * Fix text array parsing disambiguates NULL and "NULL" * Fix Timestamptz.DecodeText with too short text # 1.6.1 (October 31, 2020) * Fix simple protocol empty array support # 1.6.0 (October 24, 2020) * Fix AssignTo pointer to pointer to slice and named types. * Fix zero length array assignment (Simo Haasanen) * Add float64, float32 convert to int2, int4, int8 (lqu3j) * Support setting infinite timestamps (Erik Agsjö) * Polygon improvements (duohedron) * Fix Inet.Set with nil (Tomas Volf) # 1.5.0 (September 26, 2020) * Add slice of slice mapping to multi-dimensional arrays (Simo Haasanen) * Fix JSONBArray * Fix selecting empty array * Text formatted values except bytea can be directly scanned to []byte * Add JSON marshalling for UUID (bakmataliev) * Improve point type conversions (bakmataliev) # 1.4.2 (July 22, 2020) * Fix encoding of a large composite data type (Yaz Saito) # 1.4.1 (July 14, 2020) * Fix ArrayType DecodeBinary empty array breaks future reads # 1.4.0 (June 27, 2020) * Add JSON support to ext/gofrs-uuid * Performance improvements in Scan path * Improved ext/shopspring-numeric binary decoding performance * Add composite type support (Maxim Ivanov and Jack Christensen) * Add better generic enum type support * Add generic array type support * Clarify and normalize Value semantics * Fix hstore with empty string values * Numeric supports NaN values (leighhopcroft) * Add slice of pointer support to array types (megaturbo) * Add jsonb array type (tserakhau) * Allow converting intervals with months and days to duration # 1.3.0 (March 30, 2020) * Get implemented on T instead of *T * Set will call Get on src if possible * Range types Set method supports its own type, string, and nil * Date.Set parses string * Fix correct format verb for unknown type error (Robert Welin) * Truncate nanoseconds in EncodeText for Timestamptz and Timestamp # 1.2.0 (February 5, 2020) * Add zeronull package for easier NULL <-> zero conversion * Add JSON marshalling for shopspring-numeric extension * Add JSON marshalling for Bool, Date, JSON/B, Timestamptz (Jeffrey Stiles) * Fix null status in UnmarshalJSON for some types (Jeffrey Stiles) # 1.1.0 (January 11, 2020) * Add PostgreSQL time type support * Add more automatic conversions of integer arrays of different types (Jean-Philippe Quéméner) # 1.0.3 (November 16, 2019) * Support initializing Array types from a slice of the value (Alex Gaynor) # 1.0.2 (October 22, 2019) * Fix scan into null into pointer to pointer implementing Decode* interface. (Jeremy Altavilla) # 1.0.1 (September 19, 2019) * Fix daterange OID
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgtype/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgtype/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 5121 }
[![](https://godoc.org/github.com/jackc/pgtype?status.svg)](https://godoc.org/github.com/jackc/pgtype) ![CI](https://github.com/jackc/pgtype/workflows/CI/badge.svg) # pgtype pgtype implements Go types for over 70 PostgreSQL types. pgtype is the type system underlying the https://github.com/jackc/pgx PostgreSQL driver. These types support the binary format for enhanced performance with pgx. They also support the database/sql `Scan` and `Value` interfaces and can be used with https://github.com/lib/pq.
{ "source": "yandex/perforator", "title": "vendor/github.com/jackc/pgtype/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jackc/pgtype/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 507 }
# httpmock [![Build Status](https://github.com/jarcoal/httpmock/workflows/Build/badge.svg?branch=v1)](https://github.com/jarcoal/httpmock/actions?query=workflow%3ABuild) [![Coverage Status](https://coveralls.io/repos/github/jarcoal/httpmock/badge.svg?branch=v1)](https://coveralls.io/github/jarcoal/httpmock?branch=v1) [![GoDoc](https://godoc.org/github.com/jarcoal/httpmock?status.svg)](https://godoc.org/github.com/jarcoal/httpmock) [![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases) [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go/#testing) Easy mocking of http responses from external resources. ## Install Currently supports Go 1.7 - 1.15. `v1` branch has to be used instead of `master`. ### Using go modules (aka. `go mod`) In your go files, simply use: ```go import "github.com/jarcoal/httpmock" ``` Then next `go mod tidy` or `go test` invocation will automatically populate your `go.mod` with the last httpmock release, now [![Version](https://img.shields.io/github/tag/jarcoal/httpmock.svg)](https://github.com/jarcoal/httpmock/releases). Note you can use `go mod vendor` to vendor your dependencies. ### Using `$GOPATH` `v1` branch is configured as the default branch in github, so: ``` go get github.com/jarcoal/httpmock ``` automatically downloads the `v1` branch in `$GOPATH/src`. Then in your go files use: ```go import "github.com/jarcoal/httpmock" ``` ### Vendoring, using [`govendor`](https://github.com/kardianos/govendor) for example When vendoring is used, `v1` branch has to be specified. Two choices here: - preferred way: ``` govendor fetch github.com/jarcoal/httpmock@v1 ``` then in go files: ```go import "github.com/jarcoal/httpmock" ``` - old way (before `v1` was set as default branch), use gopkg to read from `v1` branch: ``` govendor fetch gopkg.in/jarcoal/httpmock.v1 ``` then in go files: ```go import "gopkg.in/jarcoal/httpmock.v1" ``` ## Usage ### Simple Example: ```go func TestFetchArticles(t *testing.T) { httpmock.Activate() defer httpmock.DeactivateAndReset() // Exact URL match httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles", httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`)) // Regexp match (could use httpmock.RegisterRegexpResponder instead) httpmock.RegisterResponder("GET", `=~^https://api\.mybiz\.com/articles/id/\d+\z`, httpmock.NewStringResponder(200, `{"id": 1, "name": "My Great Article"}`)) // do stuff that makes a request to articles ... // get count info httpmock.GetTotalCallCount() // get the amount of calls for the registered responder info := httpmock.GetCallCountInfo() info["GET https://api.mybiz.com/articles"] // number of GET calls made to https://api.mybiz.com/articles info["GET https://api.mybiz.com/articles/id/12"] // number of GET calls made to https://api.mybiz.com/articles/id/12 info[`GET =~^https://api\.mybiz\.com/articles/id/\d+\z`] // number of GET calls made to https://api.mybiz.com/articles/id/<any-number> } ``` ### Advanced Example: ```go func TestFetchArticles(t *testing.T) { httpmock.Activate() defer httpmock.DeactivateAndReset() // our database of articles articles := make([]map[string]interface{}, 0) // mock to list out the articles httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles", func(req *http.Request) (*http.Response, error) { resp, err := httpmock.NewJsonResponse(200, articles) if err != nil { return httpmock.NewStringResponse(500, ""), nil } return resp, nil }, ) // return an article related to the request with the help of regexp submatch (\d+) httpmock.RegisterResponder("GET", `=~^https://api\.mybiz\.com/articles/id/(\d+)\z`, func(req *http.Request) (*http.Response, error) { // Get ID from request id := httpmock.MustGetSubmatchAsUint(req, 1) // 1=first regexp submatch return httpmock.NewJsonResponse(200, map[string]interface{}{ "id": id, "name": "My Great Article", }) }, ) // mock to add a new article httpmock.RegisterResponder("POST", "https://api.mybiz.com/articles", func(req *http.Request) (*http.Response, error) { article := make(map[string]interface{}) if err := json.NewDecoder(req.Body).Decode(&article); err != nil { return httpmock.NewStringResponse(400, ""), nil } articles = append(articles, article) resp, err := httpmock.NewJsonResponse(200, article) if err != nil { return httpmock.NewStringResponse(500, ""), nil } return resp, nil }, ) // do stuff that adds and checks articles } ``` ### Algorithm When `GET http://example.tld/some/path?b=12&a=foo&a=bar` request is caught, all standard responders are checked against the following URL or paths, the first match stops the search: 1. `http://example.tld/some/path?b=12&a=foo&a=bar` (original URL) 1. `http://example.tld/some/path?a=bar&a=foo&b=12` (sorted query params) 1. `http://example.tld/some/path` (without query params) 1. `/some/path?b=12&a=foo&a=bar` (original URL without scheme and host) 1. `/some/path?a=bar&a=foo&b=12` (same, but sorted query params) 1. `/some/path` (path only) If no standard responder matched, the regexp responders are checked, in the same order, the first match stops the search. ### [Ginkgo](https://onsi.github.io/ginkgo/) Example: ```go // article_suite_test.go import ( // ... "github.com/jarcoal/httpmock" ) // ... var _ = BeforeSuite(func() { // block all HTTP requests httpmock.Activate() }) var _ = BeforeEach(func() { // remove any mocks httpmock.Reset() }) var _ = AfterSuite(func() { httpmock.DeactivateAndReset() }) // article_test.go import ( // ... "github.com/jarcoal/httpmock" ) var _ = Describe("Articles", func() { It("returns a list of articles", func() { httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles.json", httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`)) // do stuff that makes a request to articles.json }) }) ``` ### [Ginkgo](https://onsi.github.io/ginkgo/) + [Resty](https://github.com/go-resty/resty) Example: ```go // article_suite_test.go import ( // ... "github.com/jarcoal/httpmock" "github.com/go-resty/resty" ) // ... var _ = BeforeSuite(func() { // block all HTTP requests httpmock.ActivateNonDefault(resty.DefaultClient.GetClient()) }) var _ = BeforeEach(func() { // remove any mocks httpmock.Reset() }) var _ = AfterSuite(func() { httpmock.DeactivateAndReset() }) // article_test.go import ( // ... "github.com/jarcoal/httpmock" "github.com/go-resty/resty" ) var _ = Describe("Articles", func() { It("returns a list of articles", func() { fixture := `{"status":{"message": "Your message", "code": 200}}` responder := httpmock.NewStringResponder(200, fixture) fakeUrl := "https://api.mybiz.com/articles.json" httpmock.RegisterResponder("GET", fakeUrl, responder) // fetch the article into struct articleObject := &models.Article{} _, err := resty.R().SetResult(articleObject).Get(fakeUrl) // do stuff with the article object ... }) }) ```
{ "source": "yandex/perforator", "title": "vendor/github.com/jarcoal/httpmock/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jarcoal/httpmock/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 7330 }
# go-jmespath - A JMESPath implementation in Go [![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](https://travis-ci.org/jmespath/go-jmespath) go-jmespath is a GO implementation of JMESPath, which is a query language for JSON. It will take a JSON document and transform it into another JSON document through a JMESPath expression. Using go-jmespath is really easy. There's a single function you use, `jmespath.search`: ```go > import "github.com/jmespath/go-jmespath" > > var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data > var data interface{} > err := json.Unmarshal(jsondata, &data) > result, err := jmespath.Search("foo.bar.baz[2]", data) result = 2 ``` In the example we gave the ``search`` function input data of `{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}` as well as the JMESPath expression `foo.bar.baz[2]`, and the `search` function evaluated the expression against the input data to produce the result ``2``. The JMESPath language can do a lot more than select an element from a list. Here are a few more examples: ```go > var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data > var data interface{} > err := json.Unmarshal(jsondata, &data) > result, err := jmespath.search("foo.bar", data) result = { "baz": [ 0, 1, 2, 3, 4 ] } > var jsondata = []byte(`{"foo": [{"first": "a", "last": "b"}, {"first": "c", "last": "d"}]}`) // your data > var data interface{} > err := json.Unmarshal(jsondata, &data) > result, err := jmespath.search({"foo[*].first", data) result [ 'a', 'c' ] > var jsondata = []byte(`{"foo": [{"age": 20}, {"age": 25}, {"age": 30}, {"age": 35}, {"age": 40}]}`) // your data > var data interface{} > err := json.Unmarshal(jsondata, &data) > result, err := jmespath.search("foo[?age > `30`]") result = [ { age: 35 }, { age: 40 } ] ``` You can also pre-compile your query. This is usefull if you are going to run multiple searches with it: ```go > var jsondata = []byte(`{"foo": "bar"}`) > var data interface{} > err := json.Unmarshal(jsondata, &data) > precompiled, err := Compile("foo") > if err != nil{ > // ... handle the error > } > result, err := precompiled.Search(data) result = "bar" ``` ## More Resources The example above only show a small amount of what a JMESPath expression can do. If you want to take a tour of the language, the *best* place to go is the [JMESPath Tutorial](http://jmespath.org/tutorial.html). One of the best things about JMESPath is that it is implemented in many different programming languages including python, ruby, php, lua, etc. To see a complete list of libraries, check out the [JMESPath libraries page](http://jmespath.org/libraries.html). And finally, the full JMESPath specification can be found on the [JMESPath site](http://jmespath.org/specification.html).
{ "source": "yandex/perforator", "title": "vendor/github.com/jmespath/go-jmespath/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jmespath/go-jmespath/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2942 }
# sqlx [![Build Status](https://travis-ci.org/jmoiron/sqlx.svg?branch=master)](https://travis-ci.org/jmoiron/sqlx) [![Coverage Status](https://coveralls.io/repos/github/jmoiron/sqlx/badge.svg?branch=master)](https://coveralls.io/github/jmoiron/sqlx?branch=master) [![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/jmoiron/sqlx) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/jmoiron/sqlx/master/LICENSE) sqlx is a library which provides a set of extensions on go's standard `database/sql` library. The sqlx versions of `sql.DB`, `sql.TX`, `sql.Stmt`, et al. all leave the underlying interfaces untouched, so that their interfaces are a superset on the standard ones. This makes it relatively painless to integrate existing codebases using database/sql with sqlx. Major additional concepts are: * Marshal rows into structs (with embedded struct support), maps, and slices * Named parameter support including prepared statements * `Get` and `Select` to go quickly from query to struct/slice In addition to the [godoc API documentation](http://godoc.org/github.com/jmoiron/sqlx), there is also some [user documentation](http://jmoiron.github.io/sqlx/) that explains how to use `database/sql` along with sqlx. ## Recent Changes 1.3.0: * `sqlx.DB.Connx(context.Context) *sqlx.Conn` * `sqlx.BindDriver(driverName, bindType)` * support for `[]map[string]interface{}` to do "batch" insertions * allocation & perf improvements for `sqlx.In` DB.Connx returns an `sqlx.Conn`, which is an `sql.Conn`-alike consistent with sqlx's wrapping of other types. `BindDriver` allows users to control the bindvars that sqlx will use for drivers, and add new drivers at runtime. This results in a very slight performance hit when resolving the driver into a bind type (~40ns per call), but it allows users to specify what bindtype their driver uses even when sqlx has not been updated to know about it by default. ### Backwards Compatibility Compatibility with the most recent two versions of Go is a requirement for any new changes. Compatibility beyond that is not guaranteed. Versioning is done with Go modules. Breaking changes (eg. removing deprecated API) will get major version number bumps. ## install go get github.com/jmoiron/sqlx ## issues Row headers can be ambiguous (`SELECT 1 AS a, 2 AS a`), and the result of `Columns()` does not fully qualify column names in queries like: ```sql SELECT a.id, a.name, b.id, b.name FROM foos AS a JOIN foos AS b ON a.parent = b.id; ``` making a struct or map destination ambiguous. Use `AS` in your queries to give columns distinct names, `rows.Scan` to scan them manually, or `SliceScan` to get a slice of results. ## usage Below is an example which shows some common use cases for sqlx. Check [sqlx_test.go](https://github.com/jmoiron/sqlx/blob/master/sqlx_test.go) for more usage. ```go package main import ( "database/sql" "fmt" "log" _ "github.com/lib/pq" "github.com/jmoiron/sqlx" ) var schema = ` CREATE TABLE person ( first_name text, last_name text, email text ); CREATE TABLE place ( country text, city text NULL, telcode integer )` type Person struct { FirstName string `db:"first_name"` LastName string `db:"last_name"` Email string } type Place struct { Country string City sql.NullString TelCode int } func main() { // this Pings the database trying to connect // use sqlx.Open() for sql.Open() semantics db, err := sqlx.Connect("postgres", "user=foo dbname=bar sslmode=disable") if err != nil { log.Fatalln(err) } // exec the schema or fail; multi-statement Exec behavior varies between // database drivers; pq will exec them all, sqlite3 won't, ymmv db.MustExec(schema) tx := db.MustBegin() tx.MustExec("INSERT INTO person (first_name, last_name, email) VALUES ($1, $2, $3)", "Jason", "Moiron", "[email protected]") tx.MustExec("INSERT INTO person (first_name, last_name, email) VALUES ($1, $2, $3)", "John", "Doe", "[email protected]") tx.MustExec("INSERT INTO place (country, city, telcode) VALUES ($1, $2, $3)", "United States", "New York", "1") tx.MustExec("INSERT INTO place (country, telcode) VALUES ($1, $2)", "Hong Kong", "852") tx.MustExec("INSERT INTO place (country, telcode) VALUES ($1, $2)", "Singapore", "65") // Named queries can use structs, so if you have an existing struct (i.e. person := &Person{}) that you have populated, you can pass it in as &person tx.NamedExec("INSERT INTO person (first_name, last_name, email) VALUES (:first_name, :last_name, :email)", &Person{"Jane", "Citizen", "[email protected]"}) tx.Commit() // Query the database, storing results in a []Person (wrapped in []interface{}) people := []Person{} db.Select(&people, "SELECT * FROM person ORDER BY first_name ASC") jason, john := people[0], people[1] fmt.Printf("%#v\n%#v", jason, john) // Person{FirstName:"Jason", LastName:"Moiron", Email:"[email protected]"} // Person{FirstName:"John", LastName:"Doe", Email:"[email protected]"} // You can also get a single result, a la QueryRow jason = Person{} err = db.Get(&jason, "SELECT * FROM person WHERE first_name=$1", "Jason") fmt.Printf("%#v\n", jason) // Person{FirstName:"Jason", LastName:"Moiron", Email:"[email protected]"} // if you have null fields and use SELECT *, you must use sql.Null* in your struct places := []Place{} err = db.Select(&places, "SELECT * FROM place ORDER BY telcode ASC") if err != nil { fmt.Println(err) return } usa, singsing, honkers := places[0], places[1], places[2] fmt.Printf("%#v\n%#v\n%#v\n", usa, singsing, honkers) // Place{Country:"United States", City:sql.NullString{String:"New York", Valid:true}, TelCode:1} // Place{Country:"Singapore", City:sql.NullString{String:"", Valid:false}, TelCode:65} // Place{Country:"Hong Kong", City:sql.NullString{String:"", Valid:false}, TelCode:852} // Loop through rows using only one struct place := Place{} rows, err := db.Queryx("SELECT * FROM place") for rows.Next() { err := rows.StructScan(&place) if err != nil { log.Fatalln(err) } fmt.Printf("%#v\n", place) } // Place{Country:"United States", City:sql.NullString{String:"New York", Valid:true}, TelCode:1} // Place{Country:"Hong Kong", City:sql.NullString{String:"", Valid:false}, TelCode:852} // Place{Country:"Singapore", City:sql.NullString{String:"", Valid:false}, TelCode:65} // Named queries, using `:name` as the bindvar. Automatic bindvar support // which takes into account the dbtype based on the driverName on sqlx.Open/Connect _, err = db.NamedExec(`INSERT INTO person (first_name,last_name,email) VALUES (:first,:last,:email)`, map[string]interface{}{ "first": "Bin", "last": "Smuth", "email": "[email protected]", }) // Selects Mr. Smith from the database rows, err = db.NamedQuery(`SELECT * FROM person WHERE first_name=:fn`, map[string]interface{}{"fn": "Bin"}) // Named queries can also use structs. Their bind names follow the same rules // as the name -> db mapping, so struct fields are lowercased and the `db` tag // is taken into consideration. rows, err = db.NamedQuery(`SELECT * FROM person WHERE first_name=:first_name`, jason) // batch insert // batch insert with structs personStructs := []Person{ {FirstName: "Ardie", LastName: "Savea", Email: "[email protected]"}, {FirstName: "Sonny Bill", LastName: "Williams", Email: "[email protected]"}, {FirstName: "Ngani", LastName: "Laumape", Email: "[email protected]"}, } _, err = db.NamedExec(`INSERT INTO person (first_name, last_name, email) VALUES (:first_name, :last_name, :email)`, personStructs) // batch insert with maps personMaps := []map[string]interface{}{ {"first_name": "Ardie", "last_name": "Savea", "email": "[email protected]"}, {"first_name": "Sonny Bill", "last_name": "Williams", "email": "[email protected]"}, {"first_name": "Ngani", "last_name": "Laumape", "email": "[email protected]"}, } _, err = db.NamedExec(`INSERT INTO person (first_name, last_name, email) VALUES (:first_name, :last_name, :email)`, personMaps) } ```
{ "source": "yandex/perforator", "title": "vendor/github.com/jmoiron/sqlx/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/jmoiron/sqlx/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 8567 }
[![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/json-iterator/go) [![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go) [![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go) [![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/json-iterator/go/master/LICENSE) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) A high-performance 100% compatible drop-in replacement of "encoding/json" # Benchmark ![benchmark](http://jsoniter.com/benchmarks/go-benchmark.png) Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go Raw Result (easyjson requires static code generation) | | ns/op | allocation bytes | allocation times | | --------------- | ----------- | ---------------- | ---------------- | | std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | | easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | | jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | | std encode | 2213 ns/op | 712 B/op | 5 allocs/op | | easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | | jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | Always benchmark with your own workload. The result depends heavily on the data input. # Usage 100% compatibility with standard lib Replace ```go import "encoding/json" json.Marshal(&data) ``` with ```go import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary json.Marshal(&data) ``` Replace ```go import "encoding/json" json.Unmarshal(input, &data) ``` with ```go import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary json.Unmarshal(input, &data) ``` [More documentation](http://jsoniter.com/migrate-from-go-std.html) # How to get ``` go get github.com/json-iterator/go ``` # Contribution Welcomed ! Contributors - [thockin](https://github.com/thockin) - [mattn](https://github.com/mattn) - [cch123](https://github.com/cch123) - [Oleg Shaldybin](https://github.com/olegshaldybin) - [Jason Toffaletti](https://github.com/toffaletti) Report issue or pull request, or email [email protected], or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
{ "source": "yandex/perforator", "title": "vendor/github.com/json-iterator/go/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/json-iterator/go/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2932 }
# compress This package provides various compression algorithms. * [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and decompression in pure Go. * [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) is a high performance replacement for Snappy. * Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). * [snappy](https://github.com/klauspost/compress/tree/master/snappy) is a drop-in replacement for `github.com/golang/snappy` offering better compression and concurrent streams. * [huff0](https://github.com/klauspost/compress/tree/master/huff0) and [FSE](https://github.com/klauspost/compress/tree/master/fse) implementations for raw entropy encoding. * [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp) Provides client and server wrappers for handling gzipped requests efficiently. * [pgzip](https://github.com/klauspost/pgzip) is a separate package that provides a very fast parallel gzip implementation. [![Go Reference](https://pkg.go.dev/badge/klauspost/compress.svg)](https://pkg.go.dev/github.com/klauspost/compress?tab=subdirectories) [![Go](https://github.com/klauspost/compress/actions/workflows/go.yml/badge.svg)](https://github.com/klauspost/compress/actions/workflows/go.yml) [![Sourcegraph Badge](https://sourcegraph.com/github.com/klauspost/compress/-/badge.svg)](https://sourcegraph.com/github.com/klauspost/compress?badge) # changelog * Feb 5th, 2024 - [1.17.6](https://github.com/klauspost/compress/releases/tag/v1.17.6) * zstd: Fix incorrect repeat coding in best mode https://github.com/klauspost/compress/pull/923 * s2: Fix DecodeConcurrent deadlock on errors https://github.com/klauspost/compress/pull/925 * Jan 26th, 2024 - [v1.17.5](https://github.com/klauspost/compress/releases/tag/v1.17.5) * flate: Fix reset with dictionary on custom window encodes https://github.com/klauspost/compress/pull/912 * zstd: Add Frame header encoding and stripping https://github.com/klauspost/compress/pull/908 * zstd: Limit better/best default window to 8MB https://github.com/klauspost/compress/pull/913 * zstd: Speed improvements by @greatroar in https://github.com/klauspost/compress/pull/896 https://github.com/klauspost/compress/pull/910 * s2: Fix callbacks for skippable blocks and disallow 0xfe (Padding) by @Jille in https://github.com/klauspost/compress/pull/916 https://github.com/klauspost/compress/pull/917 https://github.com/klauspost/compress/pull/919 https://github.com/klauspost/compress/pull/918 * Dec 1st, 2023 - [v1.17.4](https://github.com/klauspost/compress/releases/tag/v1.17.4) * huff0: Speed up symbol counting by @greatroar in https://github.com/klauspost/compress/pull/887 * huff0: Remove byteReader by @greatroar in https://github.com/klauspost/compress/pull/886 * gzhttp: Allow overriding decompression on transport https://github.com/klauspost/compress/pull/892 * gzhttp: Clamp compression level https://github.com/klauspost/compress/pull/890 * gzip: Error out if reserved bits are set https://github.com/klauspost/compress/pull/891 * Nov 15th, 2023 - [v1.17.3](https://github.com/klauspost/compress/releases/tag/v1.17.3) * fse: Fix max header size https://github.com/klauspost/compress/pull/881 * zstd: Improve better/best compression https://github.com/klauspost/compress/pull/877 * gzhttp: Fix missing content type on Close https://github.com/klauspost/compress/pull/883 * Oct 22nd, 2023 - [v1.17.2](https://github.com/klauspost/compress/releases/tag/v1.17.2) * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876 * Oct 14th, 2023 - [v1.17.1](https://github.com/klauspost/compress/releases/tag/v1.17.1) * s2: Fix S2 "best" dictionary wrong encoding by @klauspost in https://github.com/klauspost/compress/pull/871 * flate: Reduce allocations in decompressor and minor code improvements by @fakefloordiv in https://github.com/klauspost/compress/pull/869 * s2: Fix EstimateBlockSize on 6&7 length input by @klauspost in https://github.com/klauspost/compress/pull/867 * Sept 19th, 2023 - [v1.17.0](https://github.com/klauspost/compress/releases/tag/v1.17.0) * Add experimental dictionary builder https://github.com/klauspost/compress/pull/853 * Add xerial snappy read/writer https://github.com/klauspost/compress/pull/838 * flate: Add limited window compression https://github.com/klauspost/compress/pull/843 * s2: Do 2 overlapping match checks https://github.com/klauspost/compress/pull/839 * flate: Add amd64 assembly matchlen https://github.com/klauspost/compress/pull/837 * gzip: Copy bufio.Reader on Reset by @thatguystone in https://github.com/klauspost/compress/pull/860 <details> <summary>See changes to v1.16.x</summary> * July 1st, 2023 - [v1.16.7](https://github.com/klauspost/compress/releases/tag/v1.16.7) * zstd: Fix default level first dictionary encode https://github.com/klauspost/compress/pull/829 * s2: add GetBufferCapacity() method by @GiedriusS in https://github.com/klauspost/compress/pull/832 * June 13, 2023 - [v1.16.6](https://github.com/klauspost/compress/releases/tag/v1.16.6) * zstd: correctly ignore WithEncoderPadding(1) by @ianlancetaylor in https://github.com/klauspost/compress/pull/806 * zstd: Add amd64 match length assembly https://github.com/klauspost/compress/pull/824 * gzhttp: Handle informational headers by @rtribotte in https://github.com/klauspost/compress/pull/815 * s2: Improve Better compression slightly https://github.com/klauspost/compress/pull/663 * Apr 16, 2023 - [v1.16.5](https://github.com/klauspost/compress/releases/tag/v1.16.5) * zstd: readByte needs to use io.ReadFull by @jnoxon in https://github.com/klauspost/compress/pull/802 * gzip: Fix WriterTo after initial read https://github.com/klauspost/compress/pull/804 * Apr 5, 2023 - [v1.16.4](https://github.com/klauspost/compress/releases/tag/v1.16.4) * zstd: Improve zstd best efficiency by @greatroar and @klauspost in https://github.com/klauspost/compress/pull/784 * zstd: Respect WithAllLitEntropyCompression https://github.com/klauspost/compress/pull/792 * zstd: Fix amd64 not always detecting corrupt data https://github.com/klauspost/compress/pull/785 * zstd: Various minor improvements by @greatroar in https://github.com/klauspost/compress/pull/788 https://github.com/klauspost/compress/pull/794 https://github.com/klauspost/compress/pull/795 * s2: Fix huge block overflow https://github.com/klauspost/compress/pull/779 * s2: Allow CustomEncoder fallback https://github.com/klauspost/compress/pull/780 * gzhttp: Suppport ResponseWriter Unwrap() in gzhttp handler by @jgimenez in https://github.com/klauspost/compress/pull/799 * Mar 13, 2023 - [v1.16.1](https://github.com/klauspost/compress/releases/tag/v1.16.1) * zstd: Speed up + improve best encoder by @greatroar in https://github.com/klauspost/compress/pull/776 * gzhttp: Add optional [BREACH mitigation](https://github.com/klauspost/compress/tree/master/gzhttp#breach-mitigation). https://github.com/klauspost/compress/pull/762 https://github.com/klauspost/compress/pull/768 https://github.com/klauspost/compress/pull/769 https://github.com/klauspost/compress/pull/770 https://github.com/klauspost/compress/pull/767 * s2: Add Intel LZ4s converter https://github.com/klauspost/compress/pull/766 * zstd: Minor bug fixes https://github.com/klauspost/compress/pull/771 https://github.com/klauspost/compress/pull/772 https://github.com/klauspost/compress/pull/773 * huff0: Speed up compress1xDo by @greatroar in https://github.com/klauspost/compress/pull/774 * Feb 26, 2023 - [v1.16.0](https://github.com/klauspost/compress/releases/tag/v1.16.0) * s2: Add [Dictionary](https://github.com/klauspost/compress/tree/master/s2#dictionaries) support. https://github.com/klauspost/compress/pull/685 * s2: Add Compression Size Estimate. https://github.com/klauspost/compress/pull/752 * s2: Add support for custom stream encoder. https://github.com/klauspost/compress/pull/755 * s2: Add LZ4 block converter. https://github.com/klauspost/compress/pull/748 * s2: Support io.ReaderAt in ReadSeeker. https://github.com/klauspost/compress/pull/747 * s2c/s2sx: Use concurrent decoding. https://github.com/klauspost/compress/pull/746 </details> <details> <summary>See changes to v1.15.x</summary> * Jan 21st, 2023 (v1.15.15) * deflate: Improve level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/739 * zstd: Add delta encoding support by @greatroar in https://github.com/klauspost/compress/pull/728 * zstd: Various speed improvements by @greatroar https://github.com/klauspost/compress/pull/741 https://github.com/klauspost/compress/pull/734 https://github.com/klauspost/compress/pull/736 https://github.com/klauspost/compress/pull/744 https://github.com/klauspost/compress/pull/743 https://github.com/klauspost/compress/pull/745 * gzhttp: Add SuffixETag() and DropETag() options to prevent ETag collisions on compressed responses by @willbicks in https://github.com/klauspost/compress/pull/740 * Jan 3rd, 2023 (v1.15.14) * flate: Improve speed in big stateless blocks https://github.com/klauspost/compress/pull/718 * zstd: Minor speed tweaks by @greatroar in https://github.com/klauspost/compress/pull/716 https://github.com/klauspost/compress/pull/720 * export NoGzipResponseWriter for custom ResponseWriter wrappers by @harshavardhana in https://github.com/klauspost/compress/pull/722 * s2: Add example for indexing and existing stream https://github.com/klauspost/compress/pull/723 * Dec 11, 2022 (v1.15.13) * zstd: Add [MaxEncodedSize](https://pkg.go.dev/github.com/klauspost/[email protected]/zstd#Encoder.MaxEncodedSize) to encoder https://github.com/klauspost/compress/pull/691 * zstd: Various tweaks and improvements https://github.com/klauspost/compress/pull/693 https://github.com/klauspost/compress/pull/695 https://github.com/klauspost/compress/pull/696 https://github.com/klauspost/compress/pull/701 https://github.com/klauspost/compress/pull/702 https://github.com/klauspost/compress/pull/703 https://github.com/klauspost/compress/pull/704 https://github.com/klauspost/compress/pull/705 https://github.com/klauspost/compress/pull/706 https://github.com/klauspost/compress/pull/707 https://github.com/klauspost/compress/pull/708 * Oct 26, 2022 (v1.15.12) * zstd: Tweak decoder allocs. https://github.com/klauspost/compress/pull/680 * gzhttp: Always delete `HeaderNoCompression` https://github.com/klauspost/compress/pull/683 * Sept 26, 2022 (v1.15.11) * flate: Improve level 1-3 compression https://github.com/klauspost/compress/pull/678 * zstd: Improve "best" compression by @nightwolfz in https://github.com/klauspost/compress/pull/677 * zstd: Fix+reduce decompression allocations https://github.com/klauspost/compress/pull/668 * zstd: Fix non-effective noescape tag https://github.com/klauspost/compress/pull/667 * Sept 16, 2022 (v1.15.10) * zstd: Add [WithDecodeAllCapLimit](https://pkg.go.dev/github.com/klauspost/[email protected]/zstd#WithDecodeAllCapLimit) https://github.com/klauspost/compress/pull/649 * Add Go 1.19 - deprecate Go 1.16 https://github.com/klauspost/compress/pull/651 * flate: Improve level 5+6 compression https://github.com/klauspost/compress/pull/656 * zstd: Improve "better" compresssion https://github.com/klauspost/compress/pull/657 * s2: Improve "best" compression https://github.com/klauspost/compress/pull/658 * s2: Improve "better" compression. https://github.com/klauspost/compress/pull/635 * s2: Slightly faster non-assembly decompression https://github.com/klauspost/compress/pull/646 * Use arrays for constant size copies https://github.com/klauspost/compress/pull/659 * July 21, 2022 (v1.15.9) * zstd: Fix decoder crash on amd64 (no BMI) on invalid input https://github.com/klauspost/compress/pull/645 * zstd: Disable decoder extended memory copies (amd64) due to possible crashes https://github.com/klauspost/compress/pull/644 * zstd: Allow single segments up to "max decoded size" by @klauspost in https://github.com/klauspost/compress/pull/643 * July 13, 2022 (v1.15.8) * gzip: fix stack exhaustion bug in Reader.Read https://github.com/klauspost/compress/pull/641 * s2: Add Index header trim/restore https://github.com/klauspost/compress/pull/638 * zstd: Optimize seqdeq amd64 asm by @greatroar in https://github.com/klauspost/compress/pull/636 * zstd: Improve decoder memcopy https://github.com/klauspost/compress/pull/637 * huff0: Pass a single bitReader pointer to asm by @greatroar in https://github.com/klauspost/compress/pull/634 * zstd: Branchless getBits for amd64 w/o BMI2 by @greatroar in https://github.com/klauspost/compress/pull/640 * gzhttp: Remove header before writing https://github.com/klauspost/compress/pull/639 * June 29, 2022 (v1.15.7) * s2: Fix absolute forward seeks https://github.com/klauspost/compress/pull/633 * zip: Merge upstream https://github.com/klauspost/compress/pull/631 * zip: Re-add zip64 fix https://github.com/klauspost/compress/pull/624 * zstd: translate fseDecoder.buildDtable into asm by @WojciechMula in https://github.com/klauspost/compress/pull/598 * flate: Faster histograms https://github.com/klauspost/compress/pull/620 * deflate: Use compound hcode https://github.com/klauspost/compress/pull/622 * June 3, 2022 (v1.15.6) * s2: Improve coding for long, close matches https://github.com/klauspost/compress/pull/613 * s2c: Add Snappy/S2 stream recompression https://github.com/klauspost/compress/pull/611 * zstd: Always use configured block size https://github.com/klauspost/compress/pull/605 * zstd: Fix incorrect hash table placement for dict encoding in default https://github.com/klauspost/compress/pull/606 * zstd: Apply default config to ZipDecompressor without options https://github.com/klauspost/compress/pull/608 * gzhttp: Exclude more common archive formats https://github.com/klauspost/compress/pull/612 * s2: Add ReaderIgnoreCRC https://github.com/klauspost/compress/pull/609 * s2: Remove sanity load on index creation https://github.com/klauspost/compress/pull/607 * snappy: Use dedicated function for scoring https://github.com/klauspost/compress/pull/614 * s2c+s2d: Use official snappy framed extension https://github.com/klauspost/compress/pull/610 * May 25, 2022 (v1.15.5) * s2: Add concurrent stream decompression https://github.com/klauspost/compress/pull/602 * s2: Fix final emit oob read crash on amd64 https://github.com/klauspost/compress/pull/601 * huff0: asm implementation of Decompress1X by @WojciechMula https://github.com/klauspost/compress/pull/596 * zstd: Use 1 less goroutine for stream decoding https://github.com/klauspost/compress/pull/588 * zstd: Copy literal in 16 byte blocks when possible https://github.com/klauspost/compress/pull/592 * zstd: Speed up when WithDecoderLowmem(false) https://github.com/klauspost/compress/pull/599 * zstd: faster next state update in BMI2 version of decode by @WojciechMula in https://github.com/klauspost/compress/pull/593 * huff0: Do not check max size when reading table. https://github.com/klauspost/compress/pull/586 * flate: Inplace hashing for level 7-9 by @klauspost in https://github.com/klauspost/compress/pull/590 * May 11, 2022 (v1.15.4) * huff0: decompress directly into output by @WojciechMula in [#577](https://github.com/klauspost/compress/pull/577) * inflate: Keep dict on stack [#581](https://github.com/klauspost/compress/pull/581) * zstd: Faster decoding memcopy in asm [#583](https://github.com/klauspost/compress/pull/583) * zstd: Fix ignored crc [#580](https://github.com/klauspost/compress/pull/580) * May 5, 2022 (v1.15.3) * zstd: Allow to ignore checksum checking by @WojciechMula [#572](https://github.com/klauspost/compress/pull/572) * s2: Fix incorrect seek for io.SeekEnd in [#575](https://github.com/klauspost/compress/pull/575) * Apr 26, 2022 (v1.15.2) * zstd: Add x86-64 assembly for decompression on streams and blocks. Contributed by [@WojciechMula](https://github.com/WojciechMula). Typically 2x faster. [#528](https://github.com/klauspost/compress/pull/528) [#531](https://github.com/klauspost/compress/pull/531) [#545](https://github.com/klauspost/compress/pull/545) [#537](https://github.com/klauspost/compress/pull/537) * zstd: Add options to ZipDecompressor and fixes [#539](https://github.com/klauspost/compress/pull/539) * s2: Use sorted search for index [#555](https://github.com/klauspost/compress/pull/555) * Minimum version is Go 1.16, added CI test on 1.18. * Mar 11, 2022 (v1.15.1) * huff0: Add x86 assembly of Decode4X by @WojciechMula in [#512](https://github.com/klauspost/compress/pull/512) * zstd: Reuse zip decoders in [#514](https://github.com/klauspost/compress/pull/514) * zstd: Detect extra block data and report as corrupted in [#520](https://github.com/klauspost/compress/pull/520) * zstd: Handle zero sized frame content size stricter in [#521](https://github.com/klauspost/compress/pull/521) * zstd: Add stricter block size checks in [#523](https://github.com/klauspost/compress/pull/523) * Mar 3, 2022 (v1.15.0) * zstd: Refactor decoder by @klauspost in [#498](https://github.com/klauspost/compress/pull/498) * zstd: Add stream encoding without goroutines by @klauspost in [#505](https://github.com/klauspost/compress/pull/505) * huff0: Prevent single blocks exceeding 16 bits by @klauspost in[#507](https://github.com/klauspost/compress/pull/507) * flate: Inline literal emission by @klauspost in [#509](https://github.com/klauspost/compress/pull/509) * gzhttp: Add zstd to transport by @klauspost in [#400](https://github.com/klauspost/compress/pull/400) * gzhttp: Make content-type optional by @klauspost in [#510](https://github.com/klauspost/compress/pull/510) Both compression and decompression now supports "synchronous" stream operations. This means that whenever "concurrency" is set to 1, they will operate without spawning goroutines. Stream decompression is now faster on asynchronous, since the goroutine allocation much more effectively splits the workload. On typical streams this will typically use 2 cores fully for decompression. When a stream has finished decoding no goroutines will be left over, so decoders can now safely be pooled and still be garbage collected. While the release has been extensively tested, it is recommended to testing when upgrading. </details> <details> <summary>See changes to v1.14.x</summary> * Feb 22, 2022 (v1.14.4) * flate: Fix rare huffman only (-2) corruption. [#503](https://github.com/klauspost/compress/pull/503) * zip: Update deprecated CreateHeaderRaw to correctly call CreateRaw by @saracen in [#502](https://github.com/klauspost/compress/pull/502) * zip: don't read data descriptor early by @saracen in [#501](https://github.com/klauspost/compress/pull/501) #501 * huff0: Use static decompression buffer up to 30% faster by @klauspost in [#499](https://github.com/klauspost/compress/pull/499) [#500](https://github.com/klauspost/compress/pull/500) * Feb 17, 2022 (v1.14.3) * flate: Improve fastest levels compression speed ~10% more throughput. [#482](https://github.com/klauspost/compress/pull/482) [#489](https://github.com/klauspost/compress/pull/489) [#490](https://github.com/klauspost/compress/pull/490) [#491](https://github.com/klauspost/compress/pull/491) [#494](https://github.com/klauspost/compress/pull/494) [#478](https://github.com/klauspost/compress/pull/478) * flate: Faster decompression speed, ~5-10%. [#483](https://github.com/klauspost/compress/pull/483) * s2: Faster compression with Go v1.18 and amd64 microarch level 3+. [#484](https://github.com/klauspost/compress/pull/484) [#486](https://github.com/klauspost/compress/pull/486) * Jan 25, 2022 (v1.14.2) * zstd: improve header decoder by @dsnet [#476](https://github.com/klauspost/compress/pull/476) * zstd: Add bigger default blocks [#469](https://github.com/klauspost/compress/pull/469) * zstd: Remove unused decompression buffer [#470](https://github.com/klauspost/compress/pull/470) * zstd: Fix logically dead code by @ningmingxiao [#472](https://github.com/klauspost/compress/pull/472) * flate: Improve level 7-9 [#471](https://github.com/klauspost/compress/pull/471) [#473](https://github.com/klauspost/compress/pull/473) * zstd: Add noasm tag for xxhash [#475](https://github.com/klauspost/compress/pull/475) * Jan 11, 2022 (v1.14.1) * s2: Add stream index in [#462](https://github.com/klauspost/compress/pull/462) * flate: Speed and efficiency improvements in [#439](https://github.com/klauspost/compress/pull/439) [#461](https://github.com/klauspost/compress/pull/461) [#455](https://github.com/klauspost/compress/pull/455) [#452](https://github.com/klauspost/compress/pull/452) [#458](https://github.com/klauspost/compress/pull/458) * zstd: Performance improvement in [#420]( https://github.com/klauspost/compress/pull/420) [#456](https://github.com/klauspost/compress/pull/456) [#437](https://github.com/klauspost/compress/pull/437) [#467](https://github.com/klauspost/compress/pull/467) [#468](https://github.com/klauspost/compress/pull/468) * zstd: add arm64 xxhash assembly in [#464](https://github.com/klauspost/compress/pull/464) * Add garbled for binaries for s2 in [#445](https://github.com/klauspost/compress/pull/445) </details> <details> <summary>See changes to v1.13.x</summary> * Aug 30, 2021 (v1.13.5) * gz/zlib/flate: Alias stdlib errors [#425](https://github.com/klauspost/compress/pull/425) * s2: Add block support to commandline tools [#413](https://github.com/klauspost/compress/pull/413) * zstd: pooledZipWriter should return Writers to the same pool [#426](https://github.com/klauspost/compress/pull/426) * Removed golang/snappy as external dependency for tests [#421](https://github.com/klauspost/compress/pull/421) * Aug 12, 2021 (v1.13.4) * Add [snappy replacement package](https://github.com/klauspost/compress/tree/master/snappy). * zstd: Fix incorrect encoding in "best" mode [#415](https://github.com/klauspost/compress/pull/415) * Aug 3, 2021 (v1.13.3) * zstd: Improve Best compression [#404](https://github.com/klauspost/compress/pull/404) * zstd: Fix WriteTo error forwarding [#411](https://github.com/klauspost/compress/pull/411) * gzhttp: Return http.HandlerFunc instead of http.Handler. Unlikely breaking change. [#406](https://github.com/klauspost/compress/pull/406) * s2sx: Fix max size error [#399](https://github.com/klauspost/compress/pull/399) * zstd: Add optional stream content size on reset [#401](https://github.com/klauspost/compress/pull/401) * zstd: use SpeedBestCompression for level >= 10 [#410](https://github.com/klauspost/compress/pull/410) * Jun 14, 2021 (v1.13.1) * s2: Add full Snappy output support [#396](https://github.com/klauspost/compress/pull/396) * zstd: Add configurable [Decoder window](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithDecoderMaxWindow) size [#394](https://github.com/klauspost/compress/pull/394) * gzhttp: Add header to skip compression [#389](https://github.com/klauspost/compress/pull/389) * s2: Improve speed with bigger output margin [#395](https://github.com/klauspost/compress/pull/395) * Jun 3, 2021 (v1.13.0) * Added [gzhttp](https://github.com/klauspost/compress/tree/master/gzhttp#gzip-handler) which allows wrapping HTTP servers and clients with GZIP compressors. * zstd: Detect short invalid signatures [#382](https://github.com/klauspost/compress/pull/382) * zstd: Spawn decoder goroutine only if needed. [#380](https://github.com/klauspost/compress/pull/380) </details> <details> <summary>See changes to v1.12.x</summary> * May 25, 2021 (v1.12.3) * deflate: Better/faster Huffman encoding [#374](https://github.com/klauspost/compress/pull/374) * deflate: Allocate less for history. [#375](https://github.com/klauspost/compress/pull/375) * zstd: Forward read errors [#373](https://github.com/klauspost/compress/pull/373) * Apr 27, 2021 (v1.12.2) * zstd: Improve better/best compression [#360](https://github.com/klauspost/compress/pull/360) [#364](https://github.com/klauspost/compress/pull/364) [#365](https://github.com/klauspost/compress/pull/365) * zstd: Add helpers to compress/decompress zstd inside zip files [#363](https://github.com/klauspost/compress/pull/363) * deflate: Improve level 5+6 compression [#367](https://github.com/klauspost/compress/pull/367) * s2: Improve better/best compression [#358](https://github.com/klauspost/compress/pull/358) [#359](https://github.com/klauspost/compress/pull/358) * s2: Load after checking src limit on amd64. [#362](https://github.com/klauspost/compress/pull/362) * s2sx: Limit max executable size [#368](https://github.com/klauspost/compress/pull/368) * Apr 14, 2021 (v1.12.1) * snappy package removed. Upstream added as dependency. * s2: Better compression in "best" mode [#353](https://github.com/klauspost/compress/pull/353) * s2sx: Add stdin input and detect pre-compressed from signature [#352](https://github.com/klauspost/compress/pull/352) * s2c/s2d: Add http as possible input [#348](https://github.com/klauspost/compress/pull/348) * s2c/s2d/s2sx: Always truncate when writing files [#352](https://github.com/klauspost/compress/pull/352) * zstd: Reduce memory usage further when using [WithLowerEncoderMem](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithLowerEncoderMem) [#346](https://github.com/klauspost/compress/pull/346) * s2: Fix potential problem with amd64 assembly and profilers [#349](https://github.com/klauspost/compress/pull/349) </details> <details> <summary>See changes to v1.11.x</summary> * Mar 26, 2021 (v1.11.13) * zstd: Big speedup on small dictionary encodes [#344](https://github.com/klauspost/compress/pull/344) [#345](https://github.com/klauspost/compress/pull/345) * zstd: Add [WithLowerEncoderMem](https://pkg.go.dev/github.com/klauspost/compress/zstd#WithLowerEncoderMem) encoder option [#336](https://github.com/klauspost/compress/pull/336) * deflate: Improve entropy compression [#338](https://github.com/klauspost/compress/pull/338) * s2: Clean up and minor performance improvement in best [#341](https://github.com/klauspost/compress/pull/341) * Mar 5, 2021 (v1.11.12) * s2: Add `s2sx` binary that creates [self extracting archives](https://github.com/klauspost/compress/tree/master/s2#s2sx-self-extracting-archives). * s2: Speed up decompression on non-assembly platforms [#328](https://github.com/klauspost/compress/pull/328) * Mar 1, 2021 (v1.11.9) * s2: Add ARM64 decompression assembly. Around 2x output speed. [#324](https://github.com/klauspost/compress/pull/324) * s2: Improve "better" speed and efficiency. [#325](https://github.com/klauspost/compress/pull/325) * s2: Fix binaries. * Feb 25, 2021 (v1.11.8) * s2: Fixed occational out-of-bounds write on amd64. Upgrade recommended. * s2: Add AMD64 assembly for better mode. 25-50% faster. [#315](https://github.com/klauspost/compress/pull/315) * s2: Less upfront decoder allocation. [#322](https://github.com/klauspost/compress/pull/322) * zstd: Faster "compression" of incompressible data. [#314](https://github.com/klauspost/compress/pull/314) * zip: Fix zip64 headers. [#313](https://github.com/klauspost/compress/pull/313) * Jan 14, 2021 (v1.11.7) * Use Bytes() interface to get bytes across packages. [#309](https://github.com/klauspost/compress/pull/309) * s2: Add 'best' compression option. [#310](https://github.com/klauspost/compress/pull/310) * s2: Add ReaderMaxBlockSize, changes `s2.NewReader` signature to include varargs. [#311](https://github.com/klauspost/compress/pull/311) * s2: Fix crash on small better buffers. [#308](https://github.com/klauspost/compress/pull/308) * s2: Clean up decoder. [#312](https://github.com/klauspost/compress/pull/312) * Jan 7, 2021 (v1.11.6) * zstd: Make decoder allocations smaller [#306](https://github.com/klauspost/compress/pull/306) * zstd: Free Decoder resources when Reset is called with a nil io.Reader [#305](https://github.com/klauspost/compress/pull/305) * Dec 20, 2020 (v1.11.4) * zstd: Add Best compression mode [#304](https://github.com/klauspost/compress/pull/304) * Add header decoder [#299](https://github.com/klauspost/compress/pull/299) * s2: Add uncompressed stream option [#297](https://github.com/klauspost/compress/pull/297) * Simplify/speed up small blocks with known max size. [#300](https://github.com/klauspost/compress/pull/300) * zstd: Always reset literal dict encoder [#303](https://github.com/klauspost/compress/pull/303) * Nov 15, 2020 (v1.11.3) * inflate: 10-15% faster decompression [#293](https://github.com/klauspost/compress/pull/293) * zstd: Tweak DecodeAll default allocation [#295](https://github.com/klauspost/compress/pull/295) * Oct 11, 2020 (v1.11.2) * s2: Fix out of bounds read in "better" block compression [#291](https://github.com/klauspost/compress/pull/291) * Oct 1, 2020 (v1.11.1) * zstd: Set allLitEntropy true in default configuration [#286](https://github.com/klauspost/compress/pull/286) * Sept 8, 2020 (v1.11.0) * zstd: Add experimental compression [dictionaries](https://github.com/klauspost/compress/tree/master/zstd#dictionaries) [#281](https://github.com/klauspost/compress/pull/281) * zstd: Fix mixed Write and ReadFrom calls [#282](https://github.com/klauspost/compress/pull/282) * inflate/gz: Limit variable shifts, ~5% faster decompression [#274](https://github.com/klauspost/compress/pull/274) </details> <details> <summary>See changes to v1.10.x</summary> * July 8, 2020 (v1.10.11) * zstd: Fix extra block when compressing with ReadFrom. [#278](https://github.com/klauspost/compress/pull/278) * huff0: Also populate compression table when reading decoding table. [#275](https://github.com/klauspost/compress/pull/275) * June 23, 2020 (v1.10.10) * zstd: Skip entropy compression in fastest mode when no matches. [#270](https://github.com/klauspost/compress/pull/270) * June 16, 2020 (v1.10.9): * zstd: API change for specifying dictionaries. See [#268](https://github.com/klauspost/compress/pull/268) * zip: update CreateHeaderRaw to handle zip64 fields. [#266](https://github.com/klauspost/compress/pull/266) * Fuzzit tests removed. The service has been purchased and is no longer available. * June 5, 2020 (v1.10.8): * 1.15x faster zstd block decompression. [#265](https://github.com/klauspost/compress/pull/265) * June 1, 2020 (v1.10.7): * Added zstd decompression [dictionary support](https://github.com/klauspost/compress/tree/master/zstd#dictionaries) * Increase zstd decompression speed up to 1.19x. [#259](https://github.com/klauspost/compress/pull/259) * Remove internal reset call in zstd compression and reduce allocations. [#263](https://github.com/klauspost/compress/pull/263) * May 21, 2020: (v1.10.6) * zstd: Reduce allocations while decoding. [#258](https://github.com/klauspost/compress/pull/258), [#252](https://github.com/klauspost/compress/pull/252) * zstd: Stricter decompression checks. * April 12, 2020: (v1.10.5) * s2-commands: Flush output when receiving SIGINT. [#239](https://github.com/klauspost/compress/pull/239) * Apr 8, 2020: (v1.10.4) * zstd: Minor/special case optimizations. [#251](https://github.com/klauspost/compress/pull/251), [#250](https://github.com/klauspost/compress/pull/250), [#249](https://github.com/klauspost/compress/pull/249), [#247](https://github.com/klauspost/compress/pull/247) * Mar 11, 2020: (v1.10.3) * s2: Use S2 encoder in pure Go mode for Snappy output as well. [#245](https://github.com/klauspost/compress/pull/245) * s2: Fix pure Go block encoder. [#244](https://github.com/klauspost/compress/pull/244) * zstd: Added "better compression" mode. [#240](https://github.com/klauspost/compress/pull/240) * zstd: Improve speed of fastest compression mode by 5-10% [#241](https://github.com/klauspost/compress/pull/241) * zstd: Skip creating encoders when not needed. [#238](https://github.com/klauspost/compress/pull/238) * Feb 27, 2020: (v1.10.2) * Close to 50% speedup in inflate (gzip/zip decompression). [#236](https://github.com/klauspost/compress/pull/236) [#234](https://github.com/klauspost/compress/pull/234) [#232](https://github.com/klauspost/compress/pull/232) * Reduce deflate level 1-6 memory usage up to 59%. [#227](https://github.com/klauspost/compress/pull/227) * Feb 18, 2020: (v1.10.1) * Fix zstd crash when resetting multiple times without sending data. [#226](https://github.com/klauspost/compress/pull/226) * deflate: Fix dictionary use on level 1-6. [#224](https://github.com/klauspost/compress/pull/224) * Remove deflate writer reference when closing. [#224](https://github.com/klauspost/compress/pull/224) * Feb 4, 2020: (v1.10.0) * Add optional dictionary to [stateless deflate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc#StatelessDeflate). Breaking change, send `nil` for previous behaviour. [#216](https://github.com/klauspost/compress/pull/216) * Fix buffer overflow on repeated small block deflate. [#218](https://github.com/klauspost/compress/pull/218) * Allow copying content from an existing ZIP file without decompressing+compressing. [#214](https://github.com/klauspost/compress/pull/214) * Added [S2](https://github.com/klauspost/compress/tree/master/s2#s2-compression) AMD64 assembler and various optimizations. Stream speed >10GB/s. [#186](https://github.com/klauspost/compress/pull/186) </details> <details> <summary>See changes prior to v1.10.0</summary> * Jan 20,2020 (v1.9.8) Optimize gzip/deflate with better size estimates and faster table generation. [#207](https://github.com/klauspost/compress/pull/207) by [luyu6056](https://github.com/luyu6056), [#206](https://github.com/klauspost/compress/pull/206). * Jan 11, 2020: S2 Encode/Decode will use provided buffer if capacity is big enough. [#204](https://github.com/klauspost/compress/pull/204) * Jan 5, 2020: (v1.9.7) Fix another zstd regression in v1.9.5 - v1.9.6 removed. * Jan 4, 2020: (v1.9.6) Regression in v1.9.5 fixed causing corrupt zstd encodes in rare cases. * Jan 4, 2020: Faster IO in [s2c + s2d commandline tools](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) compression/decompression. [#192](https://github.com/klauspost/compress/pull/192) * Dec 29, 2019: Removed v1.9.5 since fuzz tests showed a compatibility problem with the reference zstandard decoder. * Dec 29, 2019: (v1.9.5) zstd: 10-20% faster block compression. [#199](https://github.com/klauspost/compress/pull/199) * Dec 29, 2019: [zip](https://godoc.org/github.com/klauspost/compress/zip) package updated with latest Go features * Dec 29, 2019: zstd: Single segment flag condintions tweaked. [#197](https://github.com/klauspost/compress/pull/197) * Dec 18, 2019: s2: Faster compression when ReadFrom is used. [#198](https://github.com/klauspost/compress/pull/198) * Dec 10, 2019: s2: Fix repeat length output when just above at 16MB limit. * Dec 10, 2019: zstd: Add function to get decoder as io.ReadCloser. [#191](https://github.com/klauspost/compress/pull/191) * Dec 3, 2019: (v1.9.4) S2: limit max repeat length. [#188](https://github.com/klauspost/compress/pull/188) * Dec 3, 2019: Add [WithNoEntropyCompression](https://godoc.org/github.com/klauspost/compress/zstd#WithNoEntropyCompression) to zstd [#187](https://github.com/klauspost/compress/pull/187) * Dec 3, 2019: Reduce memory use for tests. Check for leaked goroutines. * Nov 28, 2019 (v1.9.3) Less allocations in stateless deflate. * Nov 28, 2019: 5-20% Faster huff0 decode. Impacts zstd as well. [#184](https://github.com/klauspost/compress/pull/184) * Nov 12, 2019 (v1.9.2) Added [Stateless Compression](#stateless-compression) for gzip/deflate. * Nov 12, 2019: Fixed zstd decompression of large single blocks. [#180](https://github.com/klauspost/compress/pull/180) * Nov 11, 2019: Set default [s2c](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) block size to 4MB. * Nov 11, 2019: Reduce inflate memory use by 1KB. * Nov 10, 2019: Less allocations in deflate bit writer. * Nov 10, 2019: Fix inconsistent error returned by zstd decoder. * Oct 28, 2019 (v1.9.1) ztsd: Fix crash when compressing blocks. [#174](https://github.com/klauspost/compress/pull/174) * Oct 24, 2019 (v1.9.0) zstd: Fix rare data corruption [#173](https://github.com/klauspost/compress/pull/173) * Oct 24, 2019 zstd: Fix huff0 out of buffer write [#171](https://github.com/klauspost/compress/pull/171) and always return errors [#172](https://github.com/klauspost/compress/pull/172) * Oct 10, 2019: Big deflate rewrite, 30-40% faster with better compression [#105](https://github.com/klauspost/compress/pull/105) </details> <details> <summary>See changes prior to v1.9.0</summary> * Oct 10, 2019: (v1.8.6) zstd: Allow partial reads to get flushed data. [#169](https://github.com/klauspost/compress/pull/169) * Oct 3, 2019: Fix inconsistent results on broken zstd streams. * Sep 25, 2019: Added `-rm` (remove source files) and `-q` (no output except errors) to `s2c` and `s2d` [commands](https://github.com/klauspost/compress/tree/master/s2#commandline-tools) * Sep 16, 2019: (v1.8.4) Add `s2c` and `s2d` [commandline tools](https://github.com/klauspost/compress/tree/master/s2#commandline-tools). * Sep 10, 2019: (v1.8.3) Fix s2 decoder [Skip](https://godoc.org/github.com/klauspost/compress/s2#Reader.Skip). * Sep 7, 2019: zstd: Added [WithWindowSize](https://godoc.org/github.com/klauspost/compress/zstd#WithWindowSize), contributed by [ianwilkes](https://github.com/ianwilkes). * Sep 5, 2019: (v1.8.2) Add [WithZeroFrames](https://godoc.org/github.com/klauspost/compress/zstd#WithZeroFrames) which adds full zero payload block encoding option. * Sep 5, 2019: Lazy initialization of zstandard predefined en/decoder tables. * Aug 26, 2019: (v1.8.1) S2: 1-2% compression increase in "better" compression mode. * Aug 26, 2019: zstd: Check maximum size of Huffman 1X compressed literals while decoding. * Aug 24, 2019: (v1.8.0) Added [S2 compression](https://github.com/klauspost/compress/tree/master/s2#s2-compression), a high performance replacement for Snappy. * Aug 21, 2019: (v1.7.6) Fixed minor issues found by fuzzer. One could lead to zstd not decompressing. * Aug 18, 2019: Add [fuzzit](https://fuzzit.dev/) continuous fuzzing. * Aug 14, 2019: zstd: Skip incompressible data 2x faster. [#147](https://github.com/klauspost/compress/pull/147) * Aug 4, 2019 (v1.7.5): Better literal compression. [#146](https://github.com/klauspost/compress/pull/146) * Aug 4, 2019: Faster zstd compression. [#143](https://github.com/klauspost/compress/pull/143) [#144](https://github.com/klauspost/compress/pull/144) * Aug 4, 2019: Faster zstd decompression. [#145](https://github.com/klauspost/compress/pull/145) [#143](https://github.com/klauspost/compress/pull/143) [#142](https://github.com/klauspost/compress/pull/142) * July 15, 2019 (v1.7.4): Fix double EOF block in rare cases on zstd encoder. * July 15, 2019 (v1.7.3): Minor speedup/compression increase in default zstd encoder. * July 14, 2019: zstd decoder: Fix decompression error on multiple uses with mixed content. * July 7, 2019 (v1.7.2): Snappy update, zstd decoder potential race fix. * June 17, 2019: zstd decompression bugfix. * June 17, 2019: fix 32 bit builds. * June 17, 2019: Easier use in modules (less dependencies). * June 9, 2019: New stronger "default" [zstd](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression mode. Matches zstd default compression ratio. * June 5, 2019: 20-40% throughput in [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression and better compression. * June 5, 2019: deflate/gzip compression: Reduce memory usage of lower compression levels. * June 2, 2019: Added [zstandard](https://github.com/klauspost/compress/tree/master/zstd#zstd) compression! * May 25, 2019: deflate/gzip: 10% faster bit writer, mostly visible in lower levels. * Apr 22, 2019: [zstd](https://github.com/klauspost/compress/tree/master/zstd#zstd) decompression added. * Aug 1, 2018: Added [huff0 README](https://github.com/klauspost/compress/tree/master/huff0#huff0-entropy-compression). * Jul 8, 2018: Added [Performance Update 2018](#performance-update-2018) below. * Jun 23, 2018: Merged [Go 1.11 inflate optimizations](https://go-review.googlesource.com/c/go/+/102235). Go 1.9 is now required. Backwards compatible version tagged with [v1.3.0](https://github.com/klauspost/compress/releases/tag/v1.3.0). * Apr 2, 2018: Added [huff0](https://godoc.org/github.com/klauspost/compress/huff0) en/decoder. Experimental for now, API may change. * Mar 4, 2018: Added [FSE Entropy](https://godoc.org/github.com/klauspost/compress/fse) en/decoder. Experimental for now, API may change. * Nov 3, 2017: Add compression [Estimate](https://godoc.org/github.com/klauspost/compress#Estimate) function. * May 28, 2017: Reduce allocations when resetting decoder. * Apr 02, 2017: Change back to official crc32, since changes were merged in Go 1.7. * Jan 14, 2017: Reduce stack pressure due to array copies. See [Issue #18625](https://github.com/golang/go/issues/18625). * Oct 25, 2016: Level 2-4 have been rewritten and now offers significantly better performance than before. * Oct 20, 2016: Port zlib changes from Go 1.7 to fix zlib writer issue. Please update. * Oct 16, 2016: Go 1.7 changes merged. Apples to apples this package is a few percent faster, but has a significantly better balance between speed and compression per level. * Mar 24, 2016: Always attempt Huffman encoding on level 4-7. This improves base 64 encoded data compression. * Mar 24, 2016: Small speedup for level 1-3. * Feb 19, 2016: Faster bit writer, level -2 is 15% faster, level 1 is 4% faster. * Feb 19, 2016: Handle small payloads faster in level 1-3. * Feb 19, 2016: Added faster level 2 + 3 compression modes. * Feb 19, 2016: [Rebalanced compression levels](https://blog.klauspost.com/rebalancing-deflate-compression-levels/), so there is a more even progresssion in terms of compression. New default level is 5. * Feb 14, 2016: Snappy: Merge upstream changes. * Feb 14, 2016: Snappy: Fix aggressive skipping. * Feb 14, 2016: Snappy: Update benchmark. * Feb 13, 2016: Deflate: Fixed assembler problem that could lead to sub-optimal compression. * Feb 12, 2016: Snappy: Added AMD64 SSE 4.2 optimizations to matching, which makes easy to compress material run faster. Typical speedup is around 25%. * Feb 9, 2016: Added Snappy package fork. This version is 5-7% faster, much more on hard to compress content. * Jan 30, 2016: Optimize level 1 to 3 by not considering static dictionary or storing uncompressed. ~4-5% speedup. * Jan 16, 2016: Optimization on deflate level 1,2,3 compression. * Jan 8 2016: Merge [CL 18317](https://go-review.googlesource.com/#/c/18317): fix reading, writing of zip64 archives. * Dec 8 2015: Make level 1 and -2 deterministic even if write size differs. * Dec 8 2015: Split encoding functions, so hashing and matching can potentially be inlined. 1-3% faster on AMD64. 5% faster on other platforms. * Dec 8 2015: Fixed rare [one byte out-of bounds read](https://github.com/klauspost/compress/issues/20). Please update! * Nov 23 2015: Optimization on token writer. ~2-4% faster. Contributed by [@dsnet](https://github.com/dsnet). * Nov 20 2015: Small optimization to bit writer on 64 bit systems. * Nov 17 2015: Fixed out-of-bound errors if the underlying Writer returned an error. See [#15](https://github.com/klauspost/compress/issues/15). * Nov 12 2015: Added [io.WriterTo](https://golang.org/pkg/io/#WriterTo) support to gzip/inflate. * Nov 11 2015: Merged [CL 16669](https://go-review.googlesource.com/#/c/16669/4): archive/zip: enable overriding (de)compressors per file * Oct 15 2015: Added skipping on uncompressible data. Random data speed up >5x. </details> # deflate usage The packages are drop-in replacements for standard libraries. Simply replace the import path to use them: | old import | new import | Documentation |--------------------|-----------------------------------------|--------------------| | `compress/gzip` | `github.com/klauspost/compress/gzip` | [gzip](https://pkg.go.dev/github.com/klauspost/compress/gzip?tab=doc) | `compress/zlib` | `github.com/klauspost/compress/zlib` | [zlib](https://pkg.go.dev/github.com/klauspost/compress/zlib?tab=doc) | `archive/zip` | `github.com/klauspost/compress/zip` | [zip](https://pkg.go.dev/github.com/klauspost/compress/zip?tab=doc) | `compress/flate` | `github.com/klauspost/compress/flate` | [flate](https://pkg.go.dev/github.com/klauspost/compress/flate?tab=doc) * Optimized [deflate](https://godoc.org/github.com/klauspost/compress/flate) packages which can be used as a dropin replacement for [gzip](https://godoc.org/github.com/klauspost/compress/gzip), [zip](https://godoc.org/github.com/klauspost/compress/zip) and [zlib](https://godoc.org/github.com/klauspost/compress/zlib). You may also be interested in [pgzip](https://github.com/klauspost/pgzip), which is a drop in replacement for gzip, which support multithreaded compression on big files and the optimized [crc32](https://github.com/klauspost/crc32) package used by these packages. The packages contains the same as the standard library, so you can use the godoc for that: [gzip](http://golang.org/pkg/compress/gzip/), [zip](http://golang.org/pkg/archive/zip/), [zlib](http://golang.org/pkg/compress/zlib/), [flate](http://golang.org/pkg/compress/flate/). Currently there is only minor speedup on decompression (mostly CRC32 calculation). Memory usage is typically 1MB for a Writer. stdlib is in the same range. If you expect to have a lot of concurrently allocated Writers consider using the stateless compress described below. For compression performance, see: [this spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). To disable all assembly add `-tags=noasm`. This works across all packages. # Stateless compression This package offers stateless compression as a special option for gzip/deflate. It will do compression but without maintaining any state between Write calls. This means there will be no memory kept between Write calls, but compression and speed will be suboptimal. This is only relevant in cases where you expect to run many thousands of compressors concurrently, but with very little activity. This is *not* intended for regular web servers serving individual requests. Because of this, the size of actual Write calls will affect output size. In gzip, specify level `-3` / `gzip.StatelessCompression` to enable. For direct deflate use, NewStatelessWriter and StatelessDeflate are available. See [documentation](https://godoc.org/github.com/klauspost/compress/flate#NewStatelessWriter) A `bufio.Writer` can of course be used to control write sizes. For example, to use a 4KB buffer: ```go // replace 'ioutil.Discard' with your output. gzw, err := gzip.NewWriterLevel(ioutil.Discard, gzip.StatelessCompression) if err != nil { return err } defer gzw.Close() w := bufio.NewWriterSize(gzw, 4096) defer w.Flush() // Write to 'w' ``` This will only use up to 4KB in memory when the writer is idle. Compression is almost always worse than the fastest compression level and each write will allocate (a little) memory. # Performance Update 2018 It has been a while since we have been looking at the speed of this package compared to the standard library, so I thought I would re-do my tests and give some overall recommendations based on the current state. All benchmarks have been performed with Go 1.10 on my Desktop Intel(R) Core(TM) i7-2600 CPU @3.40GHz. Since I last ran the tests, I have gotten more RAM, which means tests with big files are no longer limited by my SSD. The raw results are in my [updated spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing). Due to cgo changes and upstream updates i could not get the cgo version of gzip to compile. Instead I included the [zstd](https://github.com/datadog/zstd) cgo implementation. If I get cgo gzip to work again, I might replace the results in the sheet. The columns to take note of are: *MB/s* - the throughput. *Reduction* - the data size reduction in percent of the original. *Rel Speed* relative speed compared to the standard library at the same level. *Smaller* - how many percent smaller is the compressed output compared to stdlib. Negative means the output was bigger. *Loss* means the loss (or gain) in compression as a percentage difference of the input. The `gzstd` (standard library gzip) and `gzkp` (this package gzip) only uses one CPU core. [`pgzip`](https://github.com/klauspost/pgzip), [`bgzf`](https://github.com/biogo/hts/tree/master/bgzf) uses all 4 cores. [`zstd`](https://github.com/DataDog/zstd) uses one core, and is a beast (but not Go, yet). ## Overall differences. There appears to be a roughly 5-10% speed advantage over the standard library when comparing at similar compression levels. The biggest difference you will see is the result of [re-balancing](https://blog.klauspost.com/rebalancing-deflate-compression-levels/) the compression levels. I wanted by library to give a smoother transition between the compression levels than the standard library. This package attempts to provide a more smooth transition, where "1" is taking a lot of shortcuts, "5" is the reasonable trade-off and "9" is the "give me the best compression", and the values in between gives something reasonable in between. The standard library has big differences in levels 1-4, but levels 5-9 having no significant gains - often spending a lot more time than can be justified by the achieved compression. There are links to all the test data in the [spreadsheet](https://docs.google.com/spreadsheets/d/1nuNE2nPfuINCZJRMt6wFWhKpToF95I47XjSsc-1rbPQ/edit?usp=sharing) in the top left field on each tab. ## Web Content This test set aims to emulate typical use in a web server. The test-set is 4GB data in 53k files, and is a mixture of (mostly) HTML, JS, CSS. Since level 1 and 9 are close to being the same code, they are quite close. But looking at the levels in-between the differences are quite big. Looking at level 6, this package is 88% faster, but will output about 6% more data. For a web server, this means you can serve 88% more data, but have to pay for 6% more bandwidth. You can draw your own conclusions on what would be the most expensive for your case. ## Object files This test is for typical data files stored on a server. In this case it is a collection of Go precompiled objects. They are very compressible. The picture is similar to the web content, but with small differences since this is very compressible. Levels 2-3 offer good speed, but is sacrificing quite a bit of compression. The standard library seems suboptimal on level 3 and 4 - offering both worse compression and speed than level 6 & 7 of this package respectively. ## Highly Compressible File This is a JSON file with very high redundancy. The reduction starts at 95% on level 1, so in real life terms we are dealing with something like a highly redundant stream of data, etc. It is definitely visible that we are dealing with specialized content here, so the results are very scattered. This package does not do very well at levels 1-4, but picks up significantly at level 5 and levels 7 and 8 offering great speed for the achieved compression. So if you know you content is extremely compressible you might want to go slightly higher than the defaults. The standard library has a huge gap between levels 3 and 4 in terms of speed (2.75x slowdown), so it offers little "middle ground". ## Medium-High Compressible This is a pretty common test corpus: [enwik9](http://mattmahoney.net/dc/textdata.html). It contains the first 10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. This is a very good test of typical text based compression and more data heavy streams. We see a similar picture here as in "Web Content". On equal levels some compression is sacrificed for more speed. Level 5 seems to be the best trade-off between speed and size, beating stdlib level 3 in both. ## Medium Compressible I will combine two test sets, one [10GB file set](http://mattmahoney.net/dc/10gb.html) and a VM disk image (~8GB). Both contain different data types and represent a typical backup scenario. The most notable thing is how quickly the standard library drops to very low compression speeds around level 5-6 without any big gains in compression. Since this type of data is fairly common, this does not seem like good behavior. ## Un-compressible Content This is mainly a test of how good the algorithms are at detecting un-compressible input. The standard library only offers this feature with very conservative settings at level 1. Obviously there is no reason for the algorithms to try to compress input that cannot be compressed. The only downside is that it might skip some compressible data on false detections. ## Huffman only compression This compression library adds a special compression level, named `HuffmanOnly`, which allows near linear time compression. This is done by completely disabling matching of previous data, and only reduce the number of bits to represent each character. This means that often used characters, like 'e' and ' ' (space) in text use the fewest bits to represent, and rare characters like '¤' takes more bits to represent. For more information see [wikipedia](https://en.wikipedia.org/wiki/Huffman_coding) or this nice [video](https://youtu.be/ZdooBTdW5bM). Since this type of compression has much less variance, the compression speed is mostly unaffected by the input data, and is usually more than *180MB/s* for a single core. The downside is that the compression ratio is usually considerably worse than even the fastest conventional compression. The compression ratio can never be better than 8:1 (12.5%). The linear time compression can be used as a "better than nothing" mode, where you cannot risk the encoder to slow down on some content. For comparison, the size of the "Twain" text is *233460 bytes* (+29% vs. level 1) and encode speed is 144MB/s (4.5x level 1). So in this case you trade a 30% size increase for a 4 times speedup. For more information see my blog post on [Fast Linear Time Compression](http://blog.klauspost.com/constant-time-gzipzip-compression/). This is implemented on Go 1.7 as "Huffman Only" mode, though not exposed for gzip. # Other packages Here are other packages of good quality and pure Go (no cgo wrappers or autoconverted code): * [github.com/pierrec/lz4](https://github.com/pierrec/lz4) - strong multithreaded LZ4 compression. * [github.com/cosnicolaou/pbzip2](https://github.com/cosnicolaou/pbzip2) - multithreaded bzip2 decompression. * [github.com/dsnet/compress](https://github.com/dsnet/compress) - brotli decompression, bzip2 writer. * [github.com/ronanh/intcomp](https://github.com/ronanh/intcomp) - Integer compression. * [github.com/spenczar/fpc](https://github.com/spenczar/fpc) - Float compression. * [github.com/minio/zipindex](https://github.com/minio/zipindex) - External ZIP directory index. * [github.com/ybirader/pzip](https://github.com/ybirader/pzip) - Fast concurrent zip archiver and extractor. # license This code is licensed under the same conditions as the original Go code. See LICENSE file.
{ "source": "yandex/perforator", "title": "vendor/github.com/klauspost/compress/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/klauspost/compress/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 56505 }
Copyright (c) 2011-2013, 'pq' Contributors Portions Copyright (C) 2011 Blake Mizerany Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "source": "yandex/perforator", "title": "vendor/github.com/lib/pq/LICENSE.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/lib/pq/LICENSE.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1109 }
# pq - A pure Go postgres driver for Go's database/sql package [![GoDoc](https://godoc.org/github.com/lib/pq?status.svg)](https://pkg.go.dev/github.com/lib/pq?tab=doc) ## Install go get github.com/lib/pq ## Features * SSL * Handles bad connections for `database/sql` * Scan `time.Time` correctly (i.e. `timestamp[tz]`, `time[tz]`, `date`) * Scan binary blobs correctly (i.e. `bytea`) * Package for `hstore` support * COPY FROM support * pq.ParseURL for converting urls to connection strings for sql.Open. * Many libpq compatible environment variables * Unix socket support * Notifications: `LISTEN`/`NOTIFY` * pgpass support * GSS (Kerberos) auth ## Tests `go test` is used for testing. See [TESTS.md](TESTS.md) for more details. ## Status This package is currently in maintenance mode, which means: 1. It generally does not accept new features. 2. It does accept bug fixes and version compatability changes provided by the community. 3. Maintainers usually do not resolve reported issues. 4. Community members are encouraged to help each other with reported issues. For users that require new features or reliable resolution of reported bugs, we recommend using [pgx](https://github.com/jackc/pgx) which is under active development.
{ "source": "yandex/perforator", "title": "vendor/github.com/lib/pq/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/lib/pq/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1253 }
## Changelog ### [1.8.7](https://github.com/magiconair/properties/tree/v1.8.7) - 08 Dec 2022 * [PR #65](https://github.com/magiconair/properties/pull/65): Speedup Merge Thanks to [@AdityaVallabh](https://github.com/AdityaVallabh) for the patch. * [PR #66](https://github.com/magiconair/properties/pull/66): use github actions ### [1.8.6](https://github.com/magiconair/properties/tree/v1.8.6) - 23 Feb 2022 * [PR #57](https://github.com/magiconair/properties/pull/57):Fix "unreachable code" lint error Thanks to [@ellie](https://github.com/ellie) for the patch. * [PR #63](https://github.com/magiconair/properties/pull/63): Make TestMustGetParsedDuration backwards compatible This patch ensures that the `TestMustGetParsedDuration` still works with `go1.3` to make the author happy until it affects real users. Thanks to [@maage](https://github.com/maage) for the patch. ### [1.8.5](https://github.com/magiconair/properties/tree/v1.8.5) - 24 Mar 2021 * [PR #55](https://github.com/magiconair/properties/pull/55): Fix: Encoding Bug in Comments When reading comments \ are loaded correctly, but when writing they are then replaced by \\. This leads to wrong comments when writing and reading multiple times. Thanks to [@doxsch](https://github.com/doxsch) for the patch. ### [1.8.4](https://github.com/magiconair/properties/tree/v1.8.4) - 23 Sep 2020 * [PR #50](https://github.com/magiconair/properties/pull/50): enhance error message for circular references Thanks to [@sriv](https://github.com/sriv) for the patch. ### [1.8.3](https://github.com/magiconair/properties/tree/v1.8.3) - 14 Sep 2020 * [PR #49](https://github.com/magiconair/properties/pull/49): Include the key in error message causing the circular reference The change is include the key in the error message which is causing the circular reference when parsing/loading the properties files. Thanks to [@haroon-sheikh](https://github.com/haroon-sheikh) for the patch. ### [1.8.2](https://github.com/magiconair/properties/tree/v1.8.2) - 25 Aug 2020 * [PR #36](https://github.com/magiconair/properties/pull/36): Escape backslash on write This patch ensures that backslashes are escaped on write. Existing applications which rely on the old behavior may need to be updated. Thanks to [@apesternikov](https://github.com/apesternikov) for the patch. * [PR #42](https://github.com/magiconair/properties/pull/42): Made Content-Type check whitespace agnostic in LoadURL() Thanks to [@aliras1](https://github.com/aliras1) for the patch. * [PR #41](https://github.com/magiconair/properties/pull/41): Make key/value separator configurable on Write() Thanks to [@mkjor](https://github.com/mkjor) for the patch. * [PR #40](https://github.com/magiconair/properties/pull/40): Add method to return a sorted list of keys Thanks to [@mkjor](https://github.com/mkjor) for the patch. ### [1.8.1](https://github.com/magiconair/properties/tree/v1.8.1) - 10 May 2019 * [PR #35](https://github.com/magiconair/properties/pull/35): Close body always after request This patch ensures that in `LoadURL` the response body is always closed. Thanks to [@liubog2008](https://github.com/liubog2008) for the patch. ### [1.8](https://github.com/magiconair/properties/tree/v1.8) - 15 May 2018 * [PR #26](https://github.com/magiconair/properties/pull/26): Disable expansion during loading This adds the option to disable property expansion during loading. Thanks to [@kmala](https://github.com/kmala) for the patch. ### [1.7.6](https://github.com/magiconair/properties/tree/v1.7.6) - 14 Feb 2018 * [PR #29](https://github.com/magiconair/properties/pull/29): Reworked expansion logic to handle more complex cases. See PR for an example. Thanks to [@yobert](https://github.com/yobert) for the fix. ### [1.7.5](https://github.com/magiconair/properties/tree/v1.7.5) - 13 Feb 2018 * [PR #28](https://github.com/magiconair/properties/pull/28): Support duplicate expansions in the same value Values which expand the same key multiple times (e.g. `key=${a} ${a}`) will no longer fail with a `circular reference error`. Thanks to [@yobert](https://github.com/yobert) for the fix. ### [1.7.4](https://github.com/magiconair/properties/tree/v1.7.4) - 31 Oct 2017 * [Issue #23](https://github.com/magiconair/properties/issues/23): Ignore blank lines with whitespaces * [PR #24](https://github.com/magiconair/properties/pull/24): Update keys when DisableExpansion is enabled Thanks to [@mgurov](https://github.com/mgurov) for the fix. ### [1.7.3](https://github.com/magiconair/properties/tree/v1.7.3) - 10 Jul 2017 * [Issue #17](https://github.com/magiconair/properties/issues/17): Add [SetValue()](http://godoc.org/github.com/magiconair/properties#Properties.SetValue) method to set values generically * [Issue #22](https://github.com/magiconair/properties/issues/22): Add [LoadMap()](http://godoc.org/github.com/magiconair/properties#LoadMap) function to load properties from a string map ### [1.7.2](https://github.com/magiconair/properties/tree/v1.7.2) - 20 Mar 2017 * [Issue #15](https://github.com/magiconair/properties/issues/15): Drop gocheck dependency * [PR #21](https://github.com/magiconair/properties/pull/21): Add [Map()](http://godoc.org/github.com/magiconair/properties#Properties.Map) and [FilterFunc()](http://godoc.org/github.com/magiconair/properties#Properties.FilterFunc) ### [1.7.1](https://github.com/magiconair/properties/tree/v1.7.1) - 13 Jan 2017 * [Issue #14](https://github.com/magiconair/properties/issues/14): Decouple TestLoadExpandedFile from `$USER` * [PR #12](https://github.com/magiconair/properties/pull/12): Load from files and URLs * [PR #16](https://github.com/magiconair/properties/pull/16): Keep gofmt happy * [PR #18](https://github.com/magiconair/properties/pull/18): Fix Delete() function ### [1.7.0](https://github.com/magiconair/properties/tree/v1.7.0) - 20 Mar 2016 * [Issue #10](https://github.com/magiconair/properties/issues/10): Add [LoadURL,LoadURLs,MustLoadURL,MustLoadURLs](http://godoc.org/github.com/magiconair/properties#LoadURL) method to load properties from a URL. * [Issue #11](https://github.com/magiconair/properties/issues/11): Add [LoadString,MustLoadString](http://godoc.org/github.com/magiconair/properties#LoadString) method to load properties from an UTF8 string. * [PR #8](https://github.com/magiconair/properties/pull/8): Add [MustFlag](http://godoc.org/github.com/magiconair/properties#Properties.MustFlag) method to provide overrides via command line flags. (@pascaldekloe) ### [1.6.0](https://github.com/magiconair/properties/tree/v1.6.0) - 11 Dec 2015 * Add [Decode](http://godoc.org/github.com/magiconair/properties#Properties.Decode) method to populate struct from properties via tags. ### [1.5.6](https://github.com/magiconair/properties/tree/v1.5.6) - 18 Oct 2015 * Vendored in gopkg.in/check.v1 ### [1.5.5](https://github.com/magiconair/properties/tree/v1.5.5) - 31 Jul 2015 * [PR #6](https://github.com/magiconair/properties/pull/6): Add [Delete](http://godoc.org/github.com/magiconair/properties#Properties.Delete) method to remove keys including comments. (@gerbenjacobs) ### [1.5.4](https://github.com/magiconair/properties/tree/v1.5.4) - 23 Jun 2015 * [Issue #5](https://github.com/magiconair/properties/issues/5): Allow disabling of property expansion [DisableExpansion](http://godoc.org/github.com/magiconair/properties#Properties.DisableExpansion). When property expansion is disabled Properties become a simple key/value store and don't check for circular references. ### [1.5.3](https://github.com/magiconair/properties/tree/v1.5.3) - 02 Jun 2015 * [Issue #4](https://github.com/magiconair/properties/issues/4): Maintain key order in [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) and [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) ### [1.5.2](https://github.com/magiconair/properties/tree/v1.5.2) - 10 Apr 2015 * [Issue #3](https://github.com/magiconair/properties/issues/3): Don't print comments in [WriteComment()](http://godoc.org/github.com/magiconair/properties#Properties.WriteComment) if they are all empty * Add clickable links to README ### [1.5.1](https://github.com/magiconair/properties/tree/v1.5.1) - 08 Dec 2014 * Added [GetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.GetParsedDuration) and [MustGetParsedDuration()](http://godoc.org/github.com/magiconair/properties#Properties.MustGetParsedDuration) for values specified compatible with [time.ParseDuration()](http://golang.org/pkg/time/#ParseDuration). ### [1.5.0](https://github.com/magiconair/properties/tree/v1.5.0) - 18 Nov 2014 * Added support for single and multi-line comments (reading, writing and updating) * The order of keys is now preserved * Calling [Set()](http://godoc.org/github.com/magiconair/properties#Properties.Set) with an empty key now silently ignores the call and does not create a new entry * Added a [MustSet()](http://godoc.org/github.com/magiconair/properties#Properties.MustSet) method * Migrated test library from launchpad.net/gocheck to [gopkg.in/check.v1](http://gopkg.in/check.v1) ### [1.4.2](https://github.com/magiconair/properties/tree/v1.4.2) - 15 Nov 2014 * [Issue #2](https://github.com/magiconair/properties/issues/2): Fixed goroutine leak in parser which created two lexers but cleaned up only one ### [1.4.1](https://github.com/magiconair/properties/tree/v1.4.1) - 13 Nov 2014 * [Issue #1](https://github.com/magiconair/properties/issues/1): Fixed bug in Keys() method which returned an empty string ### [1.4.0](https://github.com/magiconair/properties/tree/v1.4.0) - 23 Sep 2014 * Added [Keys()](http://godoc.org/github.com/magiconair/properties#Properties.Keys) to get the keys * Added [Filter()](http://godoc.org/github.com/magiconair/properties#Properties.Filter), [FilterRegexp()](http://godoc.org/github.com/magiconair/properties#Properties.FilterRegexp) and [FilterPrefix()](http://godoc.org/github.com/magiconair/properties#Properties.FilterPrefix) to get a subset of the properties ### [1.3.0](https://github.com/magiconair/properties/tree/v1.3.0) - 18 Mar 2014 * Added support for time.Duration * Made MustXXX() failure beha[ior configurable (log.Fatal, panic](https://github.com/magiconair/properties/tree/vior configurable (log.Fatal, panic) - custom) * Changed default of MustXXX() failure from panic to log.Fatal ### [1.2.0](https://github.com/magiconair/properties/tree/v1.2.0) - 05 Mar 2014 * Added MustGet... functions * Added support for int and uint with range checks on 32 bit platforms ### [1.1.0](https://github.com/magiconair/properties/tree/v1.1.0) - 20 Jan 2014 * Renamed from goproperties to properties * Added support for expansion of environment vars in filenames and value expressions * Fixed bug where value expressions were not at the start of the string ### [1.0.0](https://github.com/magiconair/properties/tree/v1.0.0) - 7 Jan 2014 * Initial release
{ "source": "yandex/perforator", "title": "vendor/github.com/magiconair/properties/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/magiconair/properties/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 11225 }
Copyright (c) 2013-2020, Frank Schroeder All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{ "source": "yandex/perforator", "title": "vendor/github.com/magiconair/properties/LICENSE.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/magiconair/properties/LICENSE.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1307 }
[![](https://img.shields.io/github/tag/magiconair/properties.svg?style=flat-square&label=release)](https://github.com/magiconair/properties/releases) [![Travis CI Status](https://img.shields.io/travis/magiconair/properties.svg?branch=master&style=flat-square&label=travis)](https://travis-ci.org/magiconair/properties) [![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg?style=flat-square)](https://raw.githubusercontent.com/magiconair/properties/master/LICENSE) [![GoDoc](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](http://godoc.org/github.com/magiconair/properties) # Overview #### Please run `git pull --tags` to update the tags. See [below](#updated-git-tags) why. properties is a Go library for reading and writing properties files. It supports reading from multiple files or URLs and Spring style recursive property expansion of expressions like `${key}` to their corresponding value. Value expressions can refer to other keys like in `${key}` or to environment variables like in `${USER}`. Filenames can also contain environment variables like in `/home/${USER}/myapp.properties`. Properties can be decoded into structs, maps, arrays and values through struct tags. Comments and the order of keys are preserved. Comments can be modified and can be written to the output. The properties library supports both ISO-8859-1 and UTF-8 encoded data. Starting from version 1.3.0 the behavior of the MustXXX() functions is configurable by providing a custom `ErrorHandler` function. The default has changed from `panic` to `log.Fatal` but this is configurable and custom error handling functions can be provided. See the package documentation for details. Read the full documentation on [![GoDoc](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](http://godoc.org/github.com/magiconair/properties) ## Getting Started ```go import ( "flag" "github.com/magiconair/properties" ) func main() { // init from a file p := properties.MustLoadFile("${HOME}/config.properties", properties.UTF8) // or multiple files p = properties.MustLoadFiles([]string{ "${HOME}/config.properties", "${HOME}/config-${USER}.properties", }, properties.UTF8, true) // or from a map p = properties.LoadMap(map[string]string{"key": "value", "abc": "def"}) // or from a string p = properties.MustLoadString("key=value\nabc=def") // or from a URL p = properties.MustLoadURL("http://host/path") // or from multiple URLs p = properties.MustLoadURL([]string{ "http://host/config", "http://host/config-${USER}", }, true) // or from flags p.MustFlag(flag.CommandLine) // get values through getters host := p.MustGetString("host") port := p.GetInt("port", 8080) // or through Decode type Config struct { Host string `properties:"host"` Port int `properties:"port,default=9000"` Accept []string `properties:"accept,default=image/png;image;gif"` Timeout time.Duration `properties:"timeout,default=5s"` } var cfg Config if err := p.Decode(&cfg); err != nil { log.Fatal(err) } } ``` ## Installation and Upgrade ``` $ go get -u github.com/magiconair/properties ``` ## License 2 clause BSD license. See [LICENSE](https://github.com/magiconair/properties/blob/master/LICENSE) file for details. ## ToDo * Dump contents with passwords and secrets obscured ## Updated Git tags #### 13 Feb 2018 I realized that all of the git tags I had pushed before v1.7.5 were lightweight tags and I've only recently learned that this doesn't play well with `git describe` 😞 I have replaced all lightweight tags with signed tags using this script which should retain the commit date, name and email address. Please run `git pull --tags` to update them. Worst case you have to reclone the repo. ```shell #!/bin/bash tag=$1 echo "Updating $tag" date=$(git show ${tag}^0 --format=%aD | head -1) email=$(git show ${tag}^0 --format=%aE | head -1) name=$(git show ${tag}^0 --format=%aN | head -1) GIT_COMMITTER_DATE="$date" GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git tag -s -f ${tag} ${tag}^0 -m ${tag} ``` I apologize for the inconvenience. Frank
{ "source": "yandex/perforator", "title": "vendor/github.com/magiconair/properties/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/magiconair/properties/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 4189 }
# go-isatty [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) [![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) isatty for golang ## Usage ```go package main import ( "fmt" "github.com/mattn/go-isatty" "os" ) func main() { if isatty.IsTerminal(os.Stdout.Fd()) { fmt.Println("Is Terminal") } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { fmt.Println("Is Cygwin/MSYS2 Terminal") } else { fmt.Println("Is Not Terminal") } } ``` ## Installation ``` $ go get github.com/mattn/go-isatty ``` ## License MIT ## Author Yasuhiro Matsumoto (a.k.a mattn) ## Thanks * k-takata: base idea for IsCygwinTerminal https://github.com/k-takata/go-iscygpty
{ "source": "yandex/perforator", "title": "vendor/github.com/mattn/go-isatty/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/mattn/go-isatty/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1087 }
go-sqlite3 ========== [![Go Reference](https://pkg.go.dev/badge/github.com/mattn/go-sqlite3.svg)](https://pkg.go.dev/github.com/mattn/go-sqlite3) [![GitHub Actions](https://github.com/mattn/go-sqlite3/workflows/Go/badge.svg)](https://github.com/mattn/go-sqlite3/actions?query=workflow%3AGo) [![Financial Contributors on Open Collective](https://opencollective.com/mattn-go-sqlite3/all/badge.svg?label=financial+contributors)](https://opencollective.com/mattn-go-sqlite3) [![codecov](https://codecov.io/gh/mattn/go-sqlite3/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-sqlite3) [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-sqlite3)](https://goreportcard.com/report/github.com/mattn/go-sqlite3) Latest stable version is v1.14 or later, not v2. ~~**NOTE:** The increase to v2 was an accident. There were no major changes or features.~~ # Description A sqlite3 driver that conforms to the built-in database/sql interface. Supported Golang version: See [.github/workflows/go.yaml](./.github/workflows/go.yaml). This package follows the official [Golang Release Policy](https://golang.org/doc/devel/release.html#policy). ### Overview - [go-sqlite3](#go-sqlite3) - [Description](#description) - [Overview](#overview) - [Installation](#installation) - [API Reference](#api-reference) - [Connection String](#connection-string) - [DSN Examples](#dsn-examples) - [Features](#features) - [Usage](#usage) - [Feature / Extension List](#feature--extension-list) - [Compilation](#compilation) - [Android](#android) - [ARM](#arm) - [Cross Compile](#cross-compile) - [Google Cloud Platform](#google-cloud-platform) - [Linux](#linux) - [Alpine](#alpine) - [Fedora](#fedora) - [Ubuntu](#ubuntu) - [macOS](#mac-osx) - [Windows](#windows) - [Errors](#errors) - [User Authentication](#user-authentication) - [Compile](#compile) - [Usage](#usage-1) - [Create protected database](#create-protected-database) - [Password Encoding](#password-encoding) - [Available Encoders](#available-encoders) - [Restrictions](#restrictions) - [Support](#support) - [User Management](#user-management) - [SQL](#sql) - [Examples](#examples) - [*SQLiteConn](#sqliteconn) - [Attached database](#attached-database) - [Extensions](#extensions) - [Spatialite](#spatialite) - [FAQ](#faq) - [License](#license) - [Author](#author) # Installation This package can be installed with the `go get` command: go get github.com/mattn/go-sqlite3 _go-sqlite3_ is *cgo* package. If you want to build your app using go-sqlite3, you need gcc. However, after you have built and installed _go-sqlite3_ with `go install github.com/mattn/go-sqlite3` (which requires gcc), you can build your app without relying on gcc in future. ***Important: because this is a `CGO` enabled package, you are required to set the environment variable `CGO_ENABLED=1` and have a `gcc` compiler present within your path.*** # API Reference API documentation can be found [here](http://godoc.org/github.com/mattn/go-sqlite3). Examples can be found under the [examples](./_example) directory. # Connection String When creating a new SQLite database or connection to an existing one, with the file name additional options can be given. This is also known as a DSN (Data Source Name) string. Options are append after the filename of the SQLite database. The database filename and options are separated by an `?` (Question Mark). Options should be URL-encoded (see [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)). This also applies when using an in-memory database instead of a file. Options can be given using the following format: `KEYWORD=VALUE` and multiple options can be combined with the `&` ampersand. This library supports DSN options of SQLite itself and provides additional options. Boolean values can be one of: * `0` `no` `false` `off` * `1` `yes` `true` `on` | Name | Key | Value(s) | Description | |------|-----|----------|-------------| | UA - Create | `_auth` | - | Create User Authentication, for more information see [User Authentication](#user-authentication) | | UA - Username | `_auth_user` | `string` | Username for User Authentication, for more information see [User Authentication](#user-authentication) | | UA - Password | `_auth_pass` | `string` | Password for User Authentication, for more information see [User Authentication](#user-authentication) | | UA - Crypt | `_auth_crypt` | <ul><li>SHA1</li><li>SSHA1</li><li>SHA256</li><li>SSHA256</li><li>SHA384</li><li>SSHA384</li><li>SHA512</li><li>SSHA512</li></ul> | Password encoder to use for User Authentication, for more information see [User Authentication](#user-authentication) | | UA - Salt | `_auth_salt` | `string` | Salt to use if the configure password encoder requires a salt, for User Authentication, for more information see [User Authentication](#user-authentication) | | Auto Vacuum | `_auto_vacuum` \| `_vacuum` | <ul><li>`0` \| `none`</li><li>`1` \| `full`</li><li>`2` \| `incremental`</li></ul> | For more information see [PRAGMA auto_vacuum](https://www.sqlite.org/pragma.html#pragma_auto_vacuum) | | Busy Timeout | `_busy_timeout` \| `_timeout` | `int` | Specify value for sqlite3_busy_timeout. For more information see [PRAGMA busy_timeout](https://www.sqlite.org/pragma.html#pragma_busy_timeout) | | Case Sensitive LIKE | `_case_sensitive_like` \| `_cslike` | `boolean` | For more information see [PRAGMA case_sensitive_like](https://www.sqlite.org/pragma.html#pragma_case_sensitive_like) | | Defer Foreign Keys | `_defer_foreign_keys` \| `_defer_fk` | `boolean` | For more information see [PRAGMA defer_foreign_keys](https://www.sqlite.org/pragma.html#pragma_defer_foreign_keys) | | Foreign Keys | `_foreign_keys` \| `_fk` | `boolean` | For more information see [PRAGMA foreign_keys](https://www.sqlite.org/pragma.html#pragma_foreign_keys) | | Ignore CHECK Constraints | `_ignore_check_constraints` | `boolean` | For more information see [PRAGMA ignore_check_constraints](https://www.sqlite.org/pragma.html#pragma_ignore_check_constraints) | | Immutable | `immutable` | `boolean` | For more information see [Immutable](https://www.sqlite.org/c3ref/open.html) | | Journal Mode | `_journal_mode` \| `_journal` | <ul><li>DELETE</li><li>TRUNCATE</li><li>PERSIST</li><li>MEMORY</li><li>WAL</li><li>OFF</li></ul> | For more information see [PRAGMA journal_mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) | | Locking Mode | `_locking_mode` \| `_locking` | <ul><li>NORMAL</li><li>EXCLUSIVE</li></ul> | For more information see [PRAGMA locking_mode](https://www.sqlite.org/pragma.html#pragma_locking_mode) | | Mode | `mode` | <ul><li>ro</li><li>rw</li><li>rwc</li><li>memory</li></ul> | Access Mode of the database. For more information see [SQLite Open](https://www.sqlite.org/c3ref/open.html) | | Mutex Locking | `_mutex` | <ul><li>no</li><li>full</li></ul> | Specify mutex mode. | | Query Only | `_query_only` | `boolean` | For more information see [PRAGMA query_only](https://www.sqlite.org/pragma.html#pragma_query_only) | | Recursive Triggers | `_recursive_triggers` \| `_rt` | `boolean` | For more information see [PRAGMA recursive_triggers](https://www.sqlite.org/pragma.html#pragma_recursive_triggers) | | Secure Delete | `_secure_delete` | `boolean` \| `FAST` | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete) | | Shared-Cache Mode | `cache` | <ul><li>shared</li><li>private</li></ul> | Set cache mode for more information see [sqlite.org](https://www.sqlite.org/sharedcache.html) | | Synchronous | `_synchronous` \| `_sync` | <ul><li>0 \| OFF</li><li>1 \| NORMAL</li><li>2 \| FULL</li><li>3 \| EXTRA</li></ul> | For more information see [PRAGMA synchronous](https://www.sqlite.org/pragma.html#pragma_synchronous) | | Time Zone Location | `_loc` | auto | Specify location of time format. | | Transaction Lock | `_txlock` | <ul><li>immediate</li><li>deferred</li><li>exclusive</li></ul> | Specify locking behavior for transactions. | | Writable Schema | `_writable_schema` | `Boolean` | When this pragma is on, the SQLITE_MASTER tables in which database can be changed using ordinary UPDATE, INSERT, and DELETE statements. Warning: misuse of this pragma can easily result in a corrupt database file. | | Cache Size | `_cache_size` | `int` | Maximum cache size; default is 2000K (2M). See [PRAGMA cache_size](https://sqlite.org/pragma.html#pragma_cache_size) | ## DSN Examples ``` file:test.db?cache=shared&mode=memory ``` # Features This package allows additional configuration of features available within SQLite3 to be enabled or disabled by golang build constraints also known as build `tags`. Click [here](https://golang.org/pkg/go/build/#hdr-Build_Constraints) for more information about build tags / constraints. ### Usage If you wish to build this library with additional extensions / features, use the following command: ```bash go build -tags "<FEATURE>" ``` For available features, see the extension list. When using multiple build tags, all the different tags should be space delimited. Example: ```bash go build -tags "icu json1 fts5 secure_delete" ``` ### Feature / Extension List | Extension | Build Tag | Description | |-----------|-----------|-------------| | Additional Statistics | sqlite_stat4 | This option adds additional logic to the ANALYZE command and to the query planner that can help SQLite to chose a better query plan under certain situations. The ANALYZE command is enhanced to collect histogram data from all columns of every index and store that data in the sqlite_stat4 table.<br><br>The query planner will then use the histogram data to help it make better index choices. The downside of this compile-time option is that it violates the query planner stability guarantee making it more difficult to ensure consistent performance in mass-produced applications.<br><br>SQLITE_ENABLE_STAT4 is an enhancement of SQLITE_ENABLE_STAT3. STAT3 only recorded histogram data for the left-most column of each index whereas the STAT4 enhancement records histogram data from all columns of each index.<br><br>The SQLITE_ENABLE_STAT3 compile-time option is a no-op and is ignored if the SQLITE_ENABLE_STAT4 compile-time option is used | | Allow URI Authority | sqlite_allow_uri_authority | URI filenames normally throws an error if the authority section is not either empty or "localhost".<br><br>However, if SQLite is compiled with the SQLITE_ALLOW_URI_AUTHORITY compile-time option, then the URI is converted into a Uniform Naming Convention (UNC) filename and passed down to the underlying operating system that way | | App Armor | sqlite_app_armor | When defined, this C-preprocessor macro activates extra code that attempts to detect misuse of the SQLite API, such as passing in NULL pointers to required parameters or using objects after they have been destroyed. <br><br>App Armor is not available under `Windows`. | | Disable Load Extensions | sqlite_omit_load_extension | Loading of external extensions is enabled by default.<br><br>To disable extension loading add the build tag `sqlite_omit_load_extension`. | | Enable Serialization with `libsqlite3` | sqlite_serialize | Serialization and deserialization of a SQLite database is available by default, unless the build tag `libsqlite3` is set.<br><br>To enable this functionality even if `libsqlite3` is set, add the build tag `sqlite_serialize`. | | Foreign Keys | sqlite_foreign_keys | This macro determines whether enforcement of foreign key constraints is enabled or disabled by default for new database connections.<br><br>Each database connection can always turn enforcement of foreign key constraints on and off and run-time using the foreign_keys pragma.<br><br>Enforcement of foreign key constraints is normally off by default, but if this compile-time parameter is set to 1, enforcement of foreign key constraints will be on by default | | Full Auto Vacuum | sqlite_vacuum_full | Set the default auto vacuum to full | | Incremental Auto Vacuum | sqlite_vacuum_incr | Set the default auto vacuum to incremental | | Full Text Search Engine | sqlite_fts5 | When this option is defined in the amalgamation, versions 5 of the full-text search engine (fts5) is added to the build automatically | | International Components for Unicode | sqlite_icu | This option causes the International Components for Unicode or "ICU" extension to SQLite to be added to the build | | Introspect PRAGMAS | sqlite_introspect | This option adds some extra PRAGMA statements. <ul><li>PRAGMA function_list</li><li>PRAGMA module_list</li><li>PRAGMA pragma_list</li></ul> | | JSON SQL Functions | sqlite_json | When this option is defined in the amalgamation, the JSON SQL functions are added to the build automatically | | Math Functions | sqlite_math_functions | This compile-time option enables built-in scalar math functions. For more information see [Built-In Mathematical SQL Functions](https://www.sqlite.org/lang_mathfunc.html) | | OS Trace | sqlite_os_trace | This option enables OSTRACE() debug logging. This can be verbose and should not be used in production. | | Pre Update Hook | sqlite_preupdate_hook | Registers a callback function that is invoked prior to each INSERT, UPDATE, and DELETE operation on a database table. | | Secure Delete | sqlite_secure_delete | This compile-time option changes the default setting of the secure_delete pragma.<br><br>When this option is not used, secure_delete defaults to off. When this option is present, secure_delete defaults to on.<br><br>The secure_delete setting causes deleted content to be overwritten with zeros. There is a small performance penalty since additional I/O must occur.<br><br>On the other hand, secure_delete can prevent fragments of sensitive information from lingering in unused parts of the database file after it has been deleted. See the documentation on the secure_delete pragma for additional information | | Secure Delete (FAST) | sqlite_secure_delete_fast | For more information see [PRAGMA secure_delete](https://www.sqlite.org/pragma.html#pragma_secure_delete) | | Tracing / Debug | sqlite_trace | Activate trace functions | | User Authentication | sqlite_userauth | SQLite User Authentication see [User Authentication](#user-authentication) for more information. | | Virtual Tables | sqlite_vtable | SQLite Virtual Tables see [SQLite Official VTABLE Documentation](https://www.sqlite.org/vtab.html) for more information, and a [full example here](https://github.com/mattn/go-sqlite3/tree/master/_example/vtable) | # Compilation This package requires the `CGO_ENABLED=1` environment variable if not set by default, and the presence of the `gcc` compiler. If you need to add additional CFLAGS or LDFLAGS to the build command, and do not want to modify this package, then this can be achieved by using the `CGO_CFLAGS` and `CGO_LDFLAGS` environment variables. ## Android This package can be compiled for android. Compile with: ```bash go build -tags "android" ``` For more information see [#201](https://github.com/mattn/go-sqlite3/issues/201) # ARM To compile for `ARM` use the following environment: ```bash env CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ \ CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 \ go build -v ``` Additional information: - [#242](https://github.com/mattn/go-sqlite3/issues/242) - [#504](https://github.com/mattn/go-sqlite3/issues/504) # Cross Compile This library can be cross-compiled. In some cases you are required to the `CC` environment variable with the cross compiler. ## Cross Compiling from macOS The simplest way to cross compile from macOS is to use [xgo](https://github.com/karalabe/xgo). Steps: - Install [musl-cross](https://github.com/FiloSottile/homebrew-musl-cross) (`brew install FiloSottile/musl-cross/musl-cross`). - Run `CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++ GOARCH=amd64 GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"`. Please refer to the project's [README](https://github.com/FiloSottile/homebrew-musl-cross#readme) for further information. # Google Cloud Platform Building on GCP is not possible because Google Cloud Platform does not allow `gcc` to be executed. Please work only with compiled final binaries. ## Linux To compile this package on Linux, you must install the development tools for your linux distribution. To compile under linux use the build tag `linux`. ```bash go build -tags "linux" ``` If you wish to link directly to libsqlite3 then you can use the `libsqlite3` build tag. ``` go build -tags "libsqlite3 linux" ``` ### Alpine When building in an `alpine` container run the following command before building: ``` apk add --update gcc musl-dev ``` ### Fedora ```bash sudo yum groupinstall "Development Tools" "Development Libraries" ``` ### Ubuntu ```bash sudo apt-get install build-essential ``` ## macOS macOS should have all the tools present to compile this package. If not, install XCode to add all the developers tools. Required dependency: ```bash brew install sqlite3 ``` For macOS, there is an additional package to install which is required if you wish to build the `icu` extension. This additional package can be installed with `homebrew`: ```bash brew upgrade icu4c ``` To compile for macOS on x86: ```bash go build -tags "darwin amd64" ``` To compile for macOS on ARM chips: ```bash go build -tags "darwin arm64" ``` If you wish to link directly to libsqlite3, use the `libsqlite3` build tag: ``` # x86 go build -tags "libsqlite3 darwin amd64" # ARM go build -tags "libsqlite3 darwin arm64" ``` Additional information: - [#206](https://github.com/mattn/go-sqlite3/issues/206) - [#404](https://github.com/mattn/go-sqlite3/issues/404) ## Windows To compile this package on Windows, you must have the `gcc` compiler installed. 1) Install a Windows `gcc` toolchain. 2) Add the `bin` folder to the Windows path, if the installer did not do this by default. 3) Open a terminal for the TDM-GCC toolchain, which can be found in the Windows Start menu. 4) Navigate to your project folder and run the `go build ...` command for this package. For example the TDM-GCC Toolchain can be found [here](https://jmeubank.github.io/tdm-gcc/). ## Errors - Compile error: `can not be used when making a shared object; recompile with -fPIC` When receiving a compile time error referencing recompile with `-FPIC` then you are probably using a hardend system. You can compile the library on a hardend system with the following command. ```bash go build -ldflags '-extldflags=-fno-PIC' ``` More details see [#120](https://github.com/mattn/go-sqlite3/issues/120) - Can't build go-sqlite3 on windows 64bit. > Probably, you are using go 1.0, go1.0 has a problem when it comes to compiling/linking on windows 64bit. > See: [#27](https://github.com/mattn/go-sqlite3/issues/27) - `go get github.com/mattn/go-sqlite3` throws compilation error. `gcc` throws: `internal compiler error` Remove the download repository from your disk and try re-install with: ```bash go install github.com/mattn/go-sqlite3 ``` # User Authentication This package supports the SQLite User Authentication module. ## Compile To use the User authentication module, the package has to be compiled with the tag `sqlite_userauth`. See [Features](#features). ## Usage ### Create protected database To create a database protected by user authentication, provide the following argument to the connection string `_auth`. This will enable user authentication within the database. This option however requires two additional arguments: - `_auth_user` - `_auth_pass` When `_auth` is present in the connection string user authentication will be enabled and the provided user will be created as an `admin` user. After initial creation, the parameter `_auth` has no effect anymore and can be omitted from the connection string. Example connection strings: Create an user authentication database with user `admin` and password `admin`: `file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin` Create an user authentication database with user `admin` and password `admin` and use `SHA1` for the password encoding: `file:test.s3db?_auth&_auth_user=admin&_auth_pass=admin&_auth_crypt=sha1` ### Password Encoding The passwords within the user authentication module of SQLite are encoded with the SQLite function `sqlite_cryp`. This function uses a ceasar-cypher which is quite insecure. This library provides several additional password encoders which can be configured through the connection string. The password cypher can be configured with the key `_auth_crypt`. And if the configured password encoder also requires an salt this can be configured with `_auth_salt`. #### Available Encoders - SHA1 - SSHA1 (Salted SHA1) - SHA256 - SSHA256 (salted SHA256) - SHA384 - SSHA384 (salted SHA384) - SHA512 - SSHA512 (salted SHA512) ### Restrictions Operations on the database regarding user management can only be preformed by an administrator user. ### Support The user authentication supports two kinds of users: - administrators - regular users ### User Management User management can be done by directly using the `*SQLiteConn` or by SQL. #### SQL The following sql functions are available for user management: | Function | Arguments | Description | |----------|-----------|-------------| | `authenticate` | username `string`, password `string` | Will authenticate an user, this is done by the connection; and should not be used manually. | | `auth_user_add` | username `string`, password `string`, admin `int` | This function will add an user to the database.<br>if the database is not protected by user authentication it will enable it. Argument `admin` is an integer identifying if the added user should be an administrator. Only Administrators can add administrators. | | `auth_user_change` | username `string`, password `string`, admin `int` | Function to modify an user. Users can change their own password, but only an administrator can change the administrator flag. | | `authUserDelete` | username `string` | Delete an user from the database. Can only be used by an administrator. The current logged in administrator cannot be deleted. This is to make sure their is always an administrator remaining. | These functions will return an integer: - 0 (SQLITE_OK) - 23 (SQLITE_AUTH) Failed to perform due to authentication or insufficient privileges ##### Examples ```sql // Autheticate user // Create Admin User SELECT auth_user_add('admin2', 'admin2', 1); // Change password for user SELECT auth_user_change('user', 'userpassword', 0); // Delete user SELECT user_delete('user'); ``` #### *SQLiteConn The following functions are available for User authentication from the `*SQLiteConn`: | Function | Description | |----------|-------------| | `Authenticate(username, password string) error` | Authenticate user | | `AuthUserAdd(username, password string, admin bool) error` | Add user | | `AuthUserChange(username, password string, admin bool) error` | Modify user | | `AuthUserDelete(username string) error` | Delete user | ### Attached database When using attached databases, SQLite will use the authentication from the `main` database for the attached database(s). # Extensions If you want your own extension to be listed here, or you want to add a reference to an extension; please submit an Issue for this. ## Spatialite Spatialite is available as an extension to SQLite, and can be used in combination with this repository. For an example, see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatialite). ## extension-functions.c from SQLite3 Contrib extension-functions.c is available as an extension to SQLite, and provides the following functions: - Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi. - String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter. - Aggregate: stdev, variance, mode, median, lower_quartile, upper_quartile For an example, see [dinedal/go-sqlite3-extension-functions](https://github.com/dinedal/go-sqlite3-extension-functions). # FAQ - Getting insert error while query is opened. > You can pass some arguments into the connection string, for example, a URI. > See: [#39](https://github.com/mattn/go-sqlite3/issues/39) - Do you want to cross compile? mingw on Linux or Mac? > See: [#106](https://github.com/mattn/go-sqlite3/issues/106) > See also: http://www.limitlessfx.com/cross-compile-golang-app-for-windows-from-linux.html - Want to get time.Time with current locale Use `_loc=auto` in SQLite3 filename schema like `file:foo.db?_loc=auto`. - Can I use this in multiple routines concurrently? Yes for readonly. But not for writable. See [#50](https://github.com/mattn/go-sqlite3/issues/50), [#51](https://github.com/mattn/go-sqlite3/issues/51), [#209](https://github.com/mattn/go-sqlite3/issues/209), [#274](https://github.com/mattn/go-sqlite3/issues/274). - Why I'm getting `no such table` error? Why is it racy if I use a `sql.Open("sqlite3", ":memory:")` database? Each connection to `":memory:"` opens a brand new in-memory sql database, so if the stdlib's sql engine happens to open another connection and you've only specified `":memory:"`, that connection will see a brand new database. A workaround is to use `"file::memory:?cache=shared"` (or `"file:foobar?mode=memory&cache=shared"`). Every connection to this string will point to the same in-memory database. Note that if the last database connection in the pool closes, the in-memory database is deleted. Make sure the [max idle connection limit](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns) is > 0, and the [connection lifetime](https://golang.org/pkg/database/sql/#DB.SetConnMaxLifetime) is infinite. For more information see: * [#204](https://github.com/mattn/go-sqlite3/issues/204) * [#511](https://github.com/mattn/go-sqlite3/issues/511) * https://www.sqlite.org/sharedcache.html#shared_cache_and_in_memory_databases * https://www.sqlite.org/inmemorydb.html#sharedmemdb - Reading from database with large amount of goroutines fails on OSX. OS X limits OS-wide to not have more than 1000 files open simultaneously by default. For more information, see [#289](https://github.com/mattn/go-sqlite3/issues/289) - Trying to execute a `.` (dot) command throws an error. Error: `Error: near ".": syntax error` Dot command are part of SQLite3 CLI, not of this library. You need to implement the feature or call the sqlite3 cli. More information see [#305](https://github.com/mattn/go-sqlite3/issues/305). - Error: `database is locked` When you get a database is locked, please use the following options. Add to DSN: `cache=shared` Example: ```go db, err := sql.Open("sqlite3", "file:locked.sqlite?cache=shared") ``` Next, please set the database connections of the SQL package to 1: ```go db.SetMaxOpenConns(1) ``` For more information, see [#209](https://github.com/mattn/go-sqlite3/issues/209). ## Contributors ### Code Contributors This project exists thanks to all the people who [[contribute](CONTRIBUTING.md)]. <a href="https://github.com/mattn/go-sqlite3/graphs/contributors"><img src="https://opencollective.com/mattn-go-sqlite3/contributors.svg?width=890&button=false" /></a> ### Financial Contributors Become a financial contributor and help us sustain our community. [[Contribute here](https://opencollective.com/mattn-go-sqlite3/contribute)]. #### Individuals <a href="https://opencollective.com/mattn-go-sqlite3"><img src="https://opencollective.com/mattn-go-sqlite3/individuals.svg?width=890"></a> #### Organizations Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/mattn-go-sqlite3/contribute)] <a href="https://opencollective.com/mattn-go-sqlite3/organization/0/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/0/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/1/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/1/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/2/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/2/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/3/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/3/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/4/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/4/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/5/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/5/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/6/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/6/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/7/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/7/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/8/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/8/avatar.svg"></a> <a href="https://opencollective.com/mattn-go-sqlite3/organization/9/website"><img src="https://opencollective.com/mattn-go-sqlite3/organization/9/avatar.svg"></a> # License MIT: http://mattn.mit-license.org/2018 sqlite3-binding.c, sqlite3-binding.h, sqlite3ext.h The -binding suffix was added to avoid build failures under gccgo. In this repository, those files are an amalgamation of code that was copied from SQLite3. The license of that code is the same as the license of SQLite3. # Author Yasuhiro Matsumoto (a.k.a mattn) G.J.R. Timmer
{ "source": "yandex/perforator", "title": "vendor/github.com/mattn/go-sqlite3/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/mattn/go-sqlite3/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 30306 }
The MIT License (MIT) Copyright (c) 2014 Mitchell Hashimoto Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{ "source": "yandex/perforator", "title": "vendor/github.com/mitchellh/go-wordwrap/LICENSE.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/mitchellh/go-wordwrap/LICENSE.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1084 }
# go-wordwrap `go-wordwrap` (Golang package: `wordwrap`) is a package for Go that automatically wraps words into multiple lines. The primary use case for this is in formatting CLI output, but of course word wrapping is a generally useful thing to do. ## Installation and Usage Install using `go get github.com/mitchellh/go-wordwrap`. Full documentation is available at http://godoc.org/github.com/mitchellh/go-wordwrap Below is an example of its usage ignoring errors: ```go wrapped := wordwrap.WrapString("foo bar baz", 3) fmt.Println(wrapped) ``` Would output: ``` foo bar baz ``` ## Word Wrap Algorithm This library doesn't use any clever algorithm for word wrapping. The wrapping is actually very naive: whenever there is whitespace or an explicit linebreak. The goal of this library is for word wrapping CLI output, so the input is typically pretty well controlled human language. Because of this, the naive approach typically works just fine. In the future, we'd like to make the algorithm more advanced. We would do so without breaking the API.
{ "source": "yandex/perforator", "title": "vendor/github.com/mitchellh/go-wordwrap/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/mitchellh/go-wordwrap/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1062 }
debugcharts [![Build Status](https://travis-ci.org/mkevac/debugcharts.svg?branch=master)](https://travis-ci.org/mkevac/debugcharts) =========== Go memory debug charts. This package uses [Plotly](https://github.com/plotly/plotly.js) chart library. It is open source and free for use. Installation ------------ `go get -v -u github.com/mkevac/debugcharts` Usage ----- Just install package and start http server. There is an example program [here](https://github.com/mkevac/debugcharts/blob/master/example/example.go). Then go to `http://localhost:8080/debug/charts`. You should see something like this: <img src="example/screenshot.png" /> Data is updated every second. We keep data for last day. User https://github.com/dgryski/ proposed interesing way for turning debugcharts on/off for your project: You can add tagged file like this in your code ``` // +build debugcharts package main import _ "github.com/mkevac/debugcharts" ``` If you want to use debugcharts, then build your project with `-tags debugcharts` Development ----------- I use [bindata](https://github.com/kevinburke/go-bindata) to pack binary files into executable. Run make to rebuild.
{ "source": "yandex/perforator", "title": "vendor/github.com/mkevac/debugcharts/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/mkevac/debugcharts/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1166 }
# term - utilities for dealing with terminals ![Test](https://github.com/moby/term/workflows/Test/badge.svg) [![GoDoc](https://godoc.org/github.com/moby/term?status.svg)](https://godoc.org/github.com/moby/term) [![Go Report Card](https://goreportcard.com/badge/github.com/moby/term)](https://goreportcard.com/report/github.com/moby/term) term provides structures and helper functions to work with terminal (state, sizes). #### Using term ```go package main import ( "log" "os" "github.com/moby/term" ) func main() { fd := os.Stdin.Fd() if term.IsTerminal(fd) { ws, err := term.GetWinsize(fd) if err != nil { log.Fatalf("term.GetWinsize: %s", err) } log.Printf("%d:%d\n", ws.Height, ws.Width) } } ``` ## Contributing Want to hack on term? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply. ## Copyright and license Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.
{ "source": "yandex/perforator", "title": "vendor/github.com/moby/term/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/moby/term/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1027 }
# concurrent [![Sourcegraph](https://sourcegraph.com/github.com/modern-go/concurrent/-/badge.svg)](https://sourcegraph.com/github.com/modern-go/concurrent?badge) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/modern-go/concurrent) [![Build Status](https://travis-ci.org/modern-go/concurrent.svg?branch=master)](https://travis-ci.org/modern-go/concurrent) [![codecov](https://codecov.io/gh/modern-go/concurrent/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-go/concurrent) [![rcard](https://goreportcard.com/badge/github.com/modern-go/concurrent)](https://goreportcard.com/report/github.com/modern-go/concurrent) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/modern-go/concurrent/master/LICENSE) * concurrent.Map: backport sync.Map for go below 1.9 * concurrent.Executor: goroutine with explicit ownership and cancellable # concurrent.Map because sync.Map is only available in go 1.9, we can use concurrent.Map to make code portable ```go m := concurrent.NewMap() m.Store("hello", "world") elem, found := m.Load("hello") // elem will be "world" // found will be true ``` # concurrent.Executor ```go executor := concurrent.NewUnboundedExecutor() executor.Go(func(ctx context.Context) { everyMillisecond := time.NewTicker(time.Millisecond) for { select { case <-ctx.Done(): fmt.Println("goroutine exited") return case <-everyMillisecond.C: // do something } } }) time.Sleep(time.Second) executor.StopAndWaitForever() fmt.Println("executor stopped") ``` attach goroutine to executor instance, so that we can * cancel it by stop the executor with Stop/StopAndWait/StopAndWaitForever * handle panic by callback: the default behavior will no longer crash your application
{ "source": "yandex/perforator", "title": "vendor/github.com/modern-go/concurrent/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/modern-go/concurrent/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 1893 }
# reflect2 [![Sourcegraph](https://sourcegraph.com/github.com/modern-go/reflect2/-/badge.svg)](https://sourcegraph.com/github.com/modern-go/reflect2?badge) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/modern-go/reflect2) [![Build Status](https://travis-ci.org/modern-go/reflect2.svg?branch=master)](https://travis-ci.org/modern-go/reflect2) [![codecov](https://codecov.io/gh/modern-go/reflect2/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-go/reflect2) [![rcard](https://goreportcard.com/badge/github.com/modern-go/reflect2)](https://goreportcard.com/report/github.com/modern-go/reflect2) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/modern-go/reflect2/master/LICENSE) reflect api that avoids runtime reflect.Value cost * reflect get/set interface{}, with type checking * reflect get/set unsafe.Pointer, without type checking * `reflect2.TypeByName` works like `Class.forName` found in java [json-iterator](https://github.com/json-iterator/go) use this package to save runtime dispatching cost. This package is designed for low level libraries to optimize reflection performance. General application should still use reflect standard library. # reflect2.TypeByName ```go // given package is github.com/your/awesome-package type MyStruct struct { // ... } // will return the type reflect2.TypeByName("awesome-package.MyStruct") // however, if the type has not been used // it will be eliminated by compiler, so we can not get it in runtime ``` # reflect2 get/set interface{} ```go valType := reflect2.TypeOf(1) i := 1 j := 10 valType.Set(&i, &j) // i will be 10 ``` to get set `type`, always use its pointer `*type` # reflect2 get/set unsafe.Pointer ```go valType := reflect2.TypeOf(1) i := 1 j := 10 valType.UnsafeSet(unsafe.Pointer(&i), unsafe.Pointer(&j)) // i will be 10 ``` to get set `type`, always use its pointer `*type` # benchmark Benchmark is not necessary for this package. It does nothing actually. As it is just a thin wrapper to make go runtime public. Both `reflect2` and `reflect` call same function provided by `runtime` package exposed by go language. # unsafe safety Instead of casting `[]byte` to `sliceHeader` in your application using unsafe. We can use reflect2 instead. This way, if `sliceHeader` changes in the future, only reflect2 need to be upgraded. reflect2 tries its best to keep the implementation same as reflect (by testing).
{ "source": "yandex/perforator", "title": "vendor/github.com/modern-go/reflect2/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/modern-go/reflect2/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2524 }
<a name="unreleased"></a> ## [Unreleased] <a name="v0.7.1"></a> ## [v0.7.1] - 2023-05-11 ### Add - Add describe functions ([#77](https://github.com/montanaflynn/stats/issues/77)) ### Update - Update .gitignore - Update README.md, LICENSE and DOCUMENTATION.md files - Update github action go workflow to run on push <a name="v0.7.0"></a> ## [v0.7.0] - 2023-01-08 ### Add - Add geometric distribution functions ([#75](https://github.com/montanaflynn/stats/issues/75)) - Add GitHub action go workflow ### Remove - Remove travis CI config ### Update - Update changelog with v0.7.0 changes - Update changelog with v0.7.0 changes - Update github action go workflow - Update geometric distribution tests <a name="v0.6.6"></a> ## [v0.6.6] - 2021-04-26 ### Add - Add support for string and io.Reader in LoadRawData (pr [#68](https://github.com/montanaflynn/stats/issues/68)) - Add latest versions of Go to test against ### Update - Update changelog with v0.6.6 changes ### Use - Use math.Sqrt in StandardDeviation (PR [#64](https://github.com/montanaflynn/stats/issues/64)) <a name="v0.6.5"></a> ## [v0.6.5] - 2021-02-21 ### Add - Add Float64Data.Quartiles documentation - Add Quartiles method to Float64Data type (issue [#60](https://github.com/montanaflynn/stats/issues/60)) ### Fix - Fix make release changelog command and add changelog history ### Update - Update changelog with v0.6.5 changes - Update changelog with v0.6.4 changes - Update README.md links to CHANGELOG.md and DOCUMENTATION.md - Update README.md and Makefile with new release commands <a name="v0.6.4"></a> ## [v0.6.4] - 2021-01-13 ### Fix - Fix failing tests due to precision errors on arm64 ([#58](https://github.com/montanaflynn/stats/issues/58)) ### Update - Update changelog with v0.6.4 changes - Update examples directory to include a README.md used for synopsis - Update go.mod to include go version where modules are enabled by default - Update changelog with v0.6.3 changes <a name="v0.6.3"></a> ## [v0.6.3] - 2020-02-18 ### Add - Add creating and committing changelog to Makefile release directive - Add release-notes.txt and .chglog directory to .gitignore ### Update - Update exported tests to use import for better example documentation - Update documentation using godoc2md - Update changelog with v0.6.2 release <a name="v0.6.2"></a> ## [v0.6.2] - 2020-02-18 ### Fix - Fix linting errcheck warnings in go benchmarks ### Update - Update Makefile release directive to use correct release name <a name="v0.6.1"></a> ## [v0.6.1] - 2020-02-18 ### Add - Add StableSample function signature to readme ### Fix - Fix linting warnings for normal distribution functions formatting and tests ### Update - Update documentation links and rename DOC.md to DOCUMENTATION.md - Update README with link to pkg.go.dev reference and release section - Update Makefile with new changelog, docs, and release directives - Update DOC.md links to GitHub source code - Update doc.go comment and add DOC.md package reference file - Update changelog using git-chglog <a name="v0.6.0"></a> ## [v0.6.0] - 2020-02-17 ### Add - Add Normal Distribution Functions ([#56](https://github.com/montanaflynn/stats/issues/56)) - Add previous versions of Go to travis CI config - Add check for distinct values in Mode function ([#51](https://github.com/montanaflynn/stats/issues/51)) - Add StableSample function ([#48](https://github.com/montanaflynn/stats/issues/48)) - Add doc.go file to show description and usage on godoc.org - Add comments to new error and legacy error variables - Add ExampleRound function to tests - Add go.mod file for module support - Add Sigmoid, SoftMax and Entropy methods and tests - Add Entropy documentation, example and benchmarks - Add Entropy function ([#44](https://github.com/montanaflynn/stats/issues/44)) ### Fix - Fix percentile when only one element ([#47](https://github.com/montanaflynn/stats/issues/47)) - Fix AutoCorrelation name in comments and remove unneeded Sprintf ### Improve - Improve documentation section with command comments ### Remove - Remove very old versions of Go in travis CI config - Remove boolean comparison to get rid of gometalinter warning ### Update - Update license dates - Update Distance functions signatures to use Float64Data - Update Sigmoid examples - Update error names with backward compatibility ### Use - Use relative link to examples/main.go - Use a single var block for exported errors <a name="v0.5.0"></a> ## [v0.5.0] - 2019-01-16 ### Add - Add Sigmoid and Softmax functions ### Fix - Fix syntax highlighting and add CumulativeSum func <a name="v0.4.0"></a> ## [v0.4.0] - 2019-01-14 ### Add - Add goreport badge and documentation section to README.md - Add Examples to test files - Add AutoCorrelation and nist tests - Add String method to statsErr type - Add Y coordinate error for ExponentialRegression - Add syntax highlighting ([#43](https://github.com/montanaflynn/stats/issues/43)) - Add CumulativeSum ([#40](https://github.com/montanaflynn/stats/issues/40)) - Add more tests and rename distance files - Add coverage and benchmarks to azure pipeline - Add go tests to azure pipeline ### Change - Change travis tip alias to master - Change codecov to coveralls for code coverage ### Fix - Fix a few lint warnings - Fix example error ### Improve - Improve test coverage of distance functions ### Only - Only run travis on stable and tip versions - Only check code coverage on tip ### Remove - Remove azure CI pipeline - Remove unnecessary type conversions ### Return - Return EmptyInputErr instead of EmptyInput ### Set - Set up CI with Azure Pipelines <a name="0.3.0"></a> ## [0.3.0] - 2017-12-02 ### Add - Add Chebyshev, Manhattan, Euclidean and Minkowski distance functions ([#35](https://github.com/montanaflynn/stats/issues/35)) - Add function for computing chebyshev distance. ([#34](https://github.com/montanaflynn/stats/issues/34)) - Add support for time.Duration - Add LoadRawData to docs and examples - Add unit test for edge case that wasn't covered - Add unit tests for edge cases that weren't covered - Add pearson alias delegating to correlation - Add CovariancePopulation to Float64Data - Add pearson product-moment correlation coefficient - Add population covariance - Add random slice benchmarks - Add all applicable functions as methods to Float64Data type - Add MIT license badge - Add link to examples/methods.go - Add Protips for usage and documentation sections - Add tests for rounding up - Add webdoc target and remove linting from test target - Add example usage and consolidate contributing information ### Added - Added MedianAbsoluteDeviation ### Annotation - Annotation spelling error ### Auto - auto commit - auto commit ### Calculate - Calculate correlation with sdev and covp ### Clean - Clean up README.md and add info for offline docs ### Consolidated - Consolidated all error values. ### Fix - Fix Percentile logic - Fix InterQuartileRange method test - Fix zero percent bug and add test - Fix usage example output typos ### Improve - Improve bounds checking in Percentile - Improve error log messaging ### Imput - Imput -> Input ### Include - Include alternative way to set Float64Data in example ### Make - Make various changes to README.md ### Merge - Merge branch 'master' of github.com:montanaflynn/stats - Merge master ### Mode - Mode calculation fix and tests ### Realized - Realized the obvious efficiency gains of ignoring the unique numbers at the beginning of the slice. Benchmark joy ensued. ### Refactor - Refactor testing of Round() - Refactor setting Coordinate y field using Exp in place of Pow - Refactor Makefile and add docs target ### Remove - Remove deep links to types and functions ### Rename - Rename file from types to data ### Retrieve - Retrieve InterQuartileRange for the Float64Data. ### Split - Split up stats.go into separate files ### Support - Support more types on LoadRawData() ([#36](https://github.com/montanaflynn/stats/issues/36)) ### Switch - Switch default and check targets ### Update - Update Readme - Update example methods and some text - Update README and include Float64Data type method examples ### Pull Requests - Merge pull request [#32](https://github.com/montanaflynn/stats/issues/32) from a-robinson/percentile - Merge pull request [#30](https://github.com/montanaflynn/stats/issues/30) from montanaflynn/fix-test - Merge pull request [#29](https://github.com/montanaflynn/stats/issues/29) from edupsousa/master - Merge pull request [#27](https://github.com/montanaflynn/stats/issues/27) from andrey-yantsen/fix-percentile-out-of-bounds - Merge pull request [#25](https://github.com/montanaflynn/stats/issues/25) from kazhuravlev/patch-1 - Merge pull request [#22](https://github.com/montanaflynn/stats/issues/22) from JanBerktold/time-duration - Merge pull request [#24](https://github.com/montanaflynn/stats/issues/24) from alouche/master - Merge pull request [#21](https://github.com/montanaflynn/stats/issues/21) from brydavis/master - Merge pull request [#19](https://github.com/montanaflynn/stats/issues/19) from ginodeis/mode-bug - Merge pull request [#17](https://github.com/montanaflynn/stats/issues/17) from Kunde21/master - Merge pull request [#3](https://github.com/montanaflynn/stats/issues/3) from montanaflynn/master - Merge pull request [#2](https://github.com/montanaflynn/stats/issues/2) from montanaflynn/master - Merge pull request [#13](https://github.com/montanaflynn/stats/issues/13) from toashd/pearson - Merge pull request [#12](https://github.com/montanaflynn/stats/issues/12) from alixaxel/MAD - Merge pull request [#1](https://github.com/montanaflynn/stats/issues/1) from montanaflynn/master - Merge pull request [#11](https://github.com/montanaflynn/stats/issues/11) from Kunde21/modeMemReduce - Merge pull request [#10](https://github.com/montanaflynn/stats/issues/10) from Kunde21/ModeRewrite <a name="0.2.0"></a> ## [0.2.0] - 2015-10-14 ### Add - Add Makefile with gometalinter, testing, benchmarking and coverage report targets - Add comments describing functions and structs - Add Correlation func - Add Covariance func - Add tests for new function shortcuts - Add StandardDeviation function as a shortcut to StandardDeviationPopulation - Add Float64Data and Series types ### Change - Change Sample to return a standard []float64 type ### Fix - Fix broken link to Makefile - Fix broken link and simplify code coverage reporting command - Fix go vet warning about printf type placeholder - Fix failing codecov test coverage reporting - Fix link to CHANGELOG.md ### Fixed - Fixed typographical error, changed accomdate to accommodate in README. ### Include - Include Variance and StandardDeviation shortcuts ### Pass - Pass gometalinter ### Refactor - Refactor Variance function to be the same as population variance ### Release - Release version 0.2.0 ### Remove - Remove unneeded do packages and update cover URL - Remove sudo from pip install ### Reorder - Reorder functions and sections ### Revert - Revert to legacy containers to preserve go1.1 testing ### Switch - Switch from legacy to container-based CI infrastructure ### Update - Update contributing instructions and mention Makefile ### Pull Requests - Merge pull request [#5](https://github.com/montanaflynn/stats/issues/5) from orthographic-pedant/spell_check/accommodate <a name="0.1.0"></a> ## [0.1.0] - 2015-08-19 ### Add - Add CONTRIBUTING.md ### Rename - Rename functions while preserving backwards compatibility <a name="0.0.9"></a> ## 0.0.9 - 2015-08-18 ### Add - Add HarmonicMean func - Add GeometricMean func - Add .gitignore to avoid commiting test coverage report - Add Outliers stuct and QuantileOutliers func - Add Interquartile Range, Midhinge and Trimean examples - Add Trimean - Add Midhinge - Add Inter Quartile Range - Add a unit test to check for an empty slice error - Add Quantiles struct and Quantile func - Add more tests and fix a typo - Add Golang 1.5 to build tests - Add a standard MIT license file - Add basic benchmarking - Add regression models - Add codecov token - Add codecov - Add check for slices with a single item - Add coverage tests - Add back previous Go versions to Travis CI - Add Travis CI - Add GoDoc badge - Add Percentile and Float64ToInt functions - Add another rounding test for whole numbers - Add build status badge - Add code coverage badge - Add test for NaN, achieving 100% code coverage - Add round function - Add standard deviation function - Add sum function ### Add - add tests for sample - add sample ### Added - Added sample and population variance and deviation functions - Added README ### Adjust - Adjust API ordering ### Avoid - Avoid unintended consequence of using sort ### Better - Better performing min/max - Better description ### Change - Change package path to potentially fix a bug in earlier versions of Go ### Clean - Clean up README and add some more information - Clean up test error ### Consistent - Consistent empty slice error messages - Consistent var naming - Consistent func declaration ### Convert - Convert ints to floats ### Duplicate - Duplicate packages for all versions ### Export - Export Coordinate struct fields ### First - First commit ### Fix - Fix copy pasta mistake testing the wrong function - Fix error message - Fix usage output and edit API doc section - Fix testing edgecase where map was in wrong order - Fix usage example - Fix usage examples ### Include - Include the Nearest Rank method of calculating percentiles ### More - More commenting ### Move - Move GoDoc link to top ### Redirect - Redirect kills newer versions of Go ### Refactor - Refactor code and error checking ### Remove - Remove unnecassary typecasting in sum func - Remove cover since it doesn't work for later versions of go - Remove golint and gocoveralls ### Rename - Rename StandardDev to StdDev - Rename StandardDev to StdDev ### Return - Return errors for all functions ### Run - Run go fmt to clean up formatting ### Simplify - Simplify min/max function ### Start - Start with minimal tests ### Switch - Switch wercker to travis and update todos ### Table - table testing style ### Update - Update README and move the example main.go into it's own file - Update TODO list - Update README - Update usage examples and todos ### Use - Use codecov the recommended way - Use correct string formatting types ### Pull Requests - Merge pull request [#4](https://github.com/montanaflynn/stats/issues/4) from saromanov/sample [Unreleased]: https://github.com/montanaflynn/stats/compare/v0.7.1...HEAD [v0.7.1]: https://github.com/montanaflynn/stats/compare/v0.7.0...v0.7.1 [v0.7.0]: https://github.com/montanaflynn/stats/compare/v0.6.6...v0.7.0 [v0.6.6]: https://github.com/montanaflynn/stats/compare/v0.6.5...v0.6.6 [v0.6.5]: https://github.com/montanaflynn/stats/compare/v0.6.4...v0.6.5 [v0.6.4]: https://github.com/montanaflynn/stats/compare/v0.6.3...v0.6.4 [v0.6.3]: https://github.com/montanaflynn/stats/compare/v0.6.2...v0.6.3 [v0.6.2]: https://github.com/montanaflynn/stats/compare/v0.6.1...v0.6.2 [v0.6.1]: https://github.com/montanaflynn/stats/compare/v0.6.0...v0.6.1 [v0.6.0]: https://github.com/montanaflynn/stats/compare/v0.5.0...v0.6.0 [v0.5.0]: https://github.com/montanaflynn/stats/compare/v0.4.0...v0.5.0 [v0.4.0]: https://github.com/montanaflynn/stats/compare/0.3.0...v0.4.0 [0.3.0]: https://github.com/montanaflynn/stats/compare/0.2.0...0.3.0 [0.2.0]: https://github.com/montanaflynn/stats/compare/0.1.0...0.2.0 [0.1.0]: https://github.com/montanaflynn/stats/compare/0.0.9...0.1.0
{ "source": "yandex/perforator", "title": "vendor/github.com/montanaflynn/stats/CHANGELOG.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/montanaflynn/stats/CHANGELOG.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 15593 }
# Stats - Golang Statistics Package [![][action-svg]][action-url] [![][codecov-svg]][codecov-url] [![][goreport-svg]][goreport-url] [![][godoc-svg]][godoc-url] [![][pkggodev-svg]][pkggodev-url] [![][license-svg]][license-url] A well tested and comprehensive Golang statistics library / package / module with no dependencies. If you have any suggestions, problems or bug reports please [create an issue](https://github.com/montanaflynn/stats/issues) and I'll do my best to accommodate you. In addition simply starring the repo would show your support for the project and be very much appreciated! ## Installation ``` go get github.com/montanaflynn/stats ``` ## Example Usage All the functions can be seen in [examples/main.go](examples/main.go) but here's a little taste: ```go // start with some source data to use data := []float64{1.0, 2.1, 3.2, 4.823, 4.1, 5.8} // you could also use different types like this // data := stats.LoadRawData([]int{1, 2, 3, 4, 5}) // data := stats.LoadRawData([]interface{}{1.1, "2", 3}) // etc... median, _ := stats.Median(data) fmt.Println(median) // 3.65 roundedMedian, _ := stats.Round(median, 0) fmt.Println(roundedMedian) // 4 ``` ## Documentation The entire API documentation is available on [GoDoc.org](http://godoc.org/github.com/montanaflynn/stats) or [pkg.go.dev](https://pkg.go.dev/github.com/montanaflynn/stats). You can also view docs offline with the following commands: ``` # Command line godoc . # show all exported apis godoc . Median # show a single function godoc -ex . Round # show function with example godoc . Float64Data # show the type and methods # Local website godoc -http=:4444 # start the godoc server on port 4444 open http://localhost:4444/pkg/github.com/montanaflynn/stats/ ``` The exported API is as follows: ```go var ( ErrEmptyInput = statsError{"Input must not be empty."} ErrNaN = statsError{"Not a number."} ErrNegative = statsError{"Must not contain negative values."} ErrZero = statsError{"Must not contain zero values."} ErrBounds = statsError{"Input is outside of range."} ErrSize = statsError{"Must be the same length."} ErrInfValue = statsError{"Value is infinite."} ErrYCoord = statsError{"Y Value must be greater than zero."} ) func Round(input float64, places int) (rounded float64, err error) {} type Float64Data []float64 func LoadRawData(raw interface{}) (f Float64Data) {} func AutoCorrelation(data Float64Data, lags int) (float64, error) {} func ChebyshevDistance(dataPointX, dataPointY Float64Data) (distance float64, err error) {} func Correlation(data1, data2 Float64Data) (float64, error) {} func Covariance(data1, data2 Float64Data) (float64, error) {} func CovariancePopulation(data1, data2 Float64Data) (float64, error) {} func CumulativeSum(input Float64Data) ([]float64, error) {} func Describe(input Float64Data, allowNaN bool, percentiles *[]float64) (*Description, error) {} func DescribePercentileFunc(input Float64Data, allowNaN bool, percentiles *[]float64, percentileFunc func(Float64Data, float64) (float64, error)) (*Description, error) {} func Entropy(input Float64Data) (float64, error) {} func EuclideanDistance(dataPointX, dataPointY Float64Data) (distance float64, err error) {} func GeometricMean(input Float64Data) (float64, error) {} func HarmonicMean(input Float64Data) (float64, error) {} func InterQuartileRange(input Float64Data) (float64, error) {} func ManhattanDistance(dataPointX, dataPointY Float64Data) (distance float64, err error) {} func Max(input Float64Data) (max float64, err error) {} func Mean(input Float64Data) (float64, error) {} func Median(input Float64Data) (median float64, err error) {} func MedianAbsoluteDeviation(input Float64Data) (mad float64, err error) {} func MedianAbsoluteDeviationPopulation(input Float64Data) (mad float64, err error) {} func Midhinge(input Float64Data) (float64, error) {} func Min(input Float64Data) (min float64, err error) {} func MinkowskiDistance(dataPointX, dataPointY Float64Data, lambda float64) (distance float64, err error) {} func Mode(input Float64Data) (mode []float64, err error) {} func NormBoxMullerRvs(loc float64, scale float64, size int) []float64 {} func NormCdf(x float64, loc float64, scale float64) float64 {} func NormEntropy(loc float64, scale float64) float64 {} func NormFit(data []float64) [2]float64{} func NormInterval(alpha float64, loc float64, scale float64 ) [2]float64 {} func NormIsf(p float64, loc float64, scale float64) (x float64) {} func NormLogCdf(x float64, loc float64, scale float64) float64 {} func NormLogPdf(x float64, loc float64, scale float64) float64 {} func NormLogSf(x float64, loc float64, scale float64) float64 {} func NormMean(loc float64, scale float64) float64 {} func NormMedian(loc float64, scale float64) float64 {} func NormMoment(n int, loc float64, scale float64) float64 {} func NormPdf(x float64, loc float64, scale float64) float64 {} func NormPpf(p float64, loc float64, scale float64) (x float64) {} func NormPpfRvs(loc float64, scale float64, size int) []float64 {} func NormSf(x float64, loc float64, scale float64) float64 {} func NormStats(loc float64, scale float64, moments string) []float64 {} func NormStd(loc float64, scale float64) float64 {} func NormVar(loc float64, scale float64) float64 {} func Pearson(data1, data2 Float64Data) (float64, error) {} func Percentile(input Float64Data, percent float64) (percentile float64, err error) {} func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error) {} func PopulationVariance(input Float64Data) (pvar float64, err error) {} func Sample(input Float64Data, takenum int, replacement bool) ([]float64, error) {} func SampleVariance(input Float64Data) (svar float64, err error) {} func Sigmoid(input Float64Data) ([]float64, error) {} func SoftMax(input Float64Data) ([]float64, error) {} func StableSample(input Float64Data, takenum int) ([]float64, error) {} func StandardDeviation(input Float64Data) (sdev float64, err error) {} func StandardDeviationPopulation(input Float64Data) (sdev float64, err error) {} func StandardDeviationSample(input Float64Data) (sdev float64, err error) {} func StdDevP(input Float64Data) (sdev float64, err error) {} func StdDevS(input Float64Data) (sdev float64, err error) {} func Sum(input Float64Data) (sum float64, err error) {} func Trimean(input Float64Data) (float64, error) {} func VarP(input Float64Data) (sdev float64, err error) {} func VarS(input Float64Data) (sdev float64, err error) {} func Variance(input Float64Data) (sdev float64, err error) {} func ProbGeom(a int, b int, p float64) (prob float64, err error) {} func ExpGeom(p float64) (exp float64, err error) {} func VarGeom(p float64) (exp float64, err error) {} type Coordinate struct { X, Y float64 } type Series []Coordinate func ExponentialRegression(s Series) (regressions Series, err error) {} func LinearRegression(s Series) (regressions Series, err error) {} func LogarithmicRegression(s Series) (regressions Series, err error) {} type Outliers struct { Mild Float64Data Extreme Float64Data } type Quartiles struct { Q1 float64 Q2 float64 Q3 float64 } func Quartile(input Float64Data) (Quartiles, error) {} func QuartileOutliers(input Float64Data) (Outliers, error) {} ``` ## Contributing Pull request are always welcome no matter how big or small. I've included a [Makefile](https://github.com/montanaflynn/stats/blob/master/Makefile) that has a lot of helper targets for common actions such as linting, testing, code coverage reporting and more. 1. Fork the repo and clone your fork 2. Create new branch (`git checkout -b some-thing`) 3. Make the desired changes 4. Ensure tests pass (`go test -cover` or `make test`) 5. Run lint and fix problems (`go vet .` or `make lint`) 6. Commit changes (`git commit -am 'Did something'`) 7. Push branch (`git push origin some-thing`) 8. Submit pull request To make things as seamless as possible please also consider the following steps: - Update `examples/main.go` with a simple example of the new feature - Update `README.md` documentation section with any new exported API - Keep 100% code coverage (you can check with `make coverage`) - Squash commits into single units of work with `git rebase -i new-feature` ## Releasing This is not required by contributors and mostly here as a reminder to myself as the maintainer of this repo. To release a new version we should update the [CHANGELOG.md](/CHANGELOG.md) and [DOCUMENTATION.md](/DOCUMENTATION.md). First install the tools used to generate the markdown files and release: ``` go install github.com/davecheney/godoc2md@latest go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest brew tap git-chglog/git-chglog brew install gnu-sed hub git-chglog ``` Then you can run these `make` directives: ``` # Generate DOCUMENTATION.md make docs ``` Then we can create a [CHANGELOG.md](/CHANGELOG.md) a new git tag and a github release: ``` make release TAG=v0.x.x ``` To authenticate `hub` for the release you will need to create a personal access token and use it as the password when it's requested. ## MIT License Copyright (c) 2014-2023 Montana Flynn (https://montanaflynn.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORpublicS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [action-url]: https://github.com/montanaflynn/stats/actions [action-svg]: https://img.shields.io/github/actions/workflow/status/montanaflynn/stats/go.yml [codecov-url]: https://app.codecov.io/gh/montanaflynn/stats [codecov-svg]: https://img.shields.io/codecov/c/github/montanaflynn/stats?token=wnw8dActnH [goreport-url]: https://goreportcard.com/report/github.com/montanaflynn/stats [goreport-svg]: https://goreportcard.com/badge/github.com/montanaflynn/stats [godoc-url]: https://godoc.org/github.com/montanaflynn/stats [godoc-svg]: https://godoc.org/github.com/montanaflynn/stats?status.svg [pkggodev-url]: https://pkg.go.dev/github.com/montanaflynn/stats [pkggodev-svg]: https://gistcdn.githack.com/montanaflynn/b02f1d78d8c0de8435895d7e7cd0d473/raw/17f2a5a69f1323ecd42c00e0683655da96d9ecc8/badge.svg [license-url]: https://github.com/montanaflynn/stats/blob/master/LICENSE [license-svg]: https://img.shields.io/badge/license-MIT-blue.svg
{ "source": "yandex/perforator", "title": "vendor/github.com/montanaflynn/stats/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/montanaflynn/stats/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 11268 }
# aec [![GoDoc](https://godoc.org/github.com/morikuni/aec?status.svg)](https://godoc.org/github.com/morikuni/aec) Go wrapper for ANSI escape code. ## Install ```bash go get github.com/morikuni/aec ``` ## Features ANSI escape codes depend on terminal environment. Some of these features may not work. Check supported Font-Style/Font-Color features with [checkansi](./checkansi). [Wikipedia](https://en.wikipedia.org/wiki/ANSI_escape_code) for more detail. ### Cursor - `Up(n)` - `Down(n)` - `Right(n)` - `Left(n)` - `NextLine(n)` - `PreviousLine(n)` - `Column(col)` - `Position(row, col)` - `Save` - `Restore` - `Hide` - `Show` - `Report` ### Erase - `EraseDisplay(mode)` - `EraseLine(mode)` ### Scroll - `ScrollUp(n)` - `ScrollDown(n)` ### Font Style - `Bold` - `Faint` - `Italic` - `Underline` - `BlinkSlow` - `BlinkRapid` - `Inverse` - `Conceal` - `CrossOut` - `Frame` - `Encircle` - `Overline` ### Font Color Foreground color. - `DefaultF` - `BlackF` - `RedF` - `GreenF` - `YellowF` - `BlueF` - `MagentaF` - `CyanF` - `WhiteF` - `LightBlackF` - `LightRedF` - `LightGreenF` - `LightYellowF` - `LightBlueF` - `LightMagentaF` - `LightCyanF` - `LightWhiteF` - `Color3BitF(color)` - `Color8BitF(color)` - `FullColorF(r, g, b)` Background color. - `DefaultB` - `BlackB` - `RedB` - `GreenB` - `YellowB` - `BlueB` - `MagentaB` - `CyanB` - `WhiteB` - `LightBlackB` - `LightRedB` - `LightGreenB` - `LightYellowB` - `LightBlueB` - `LightMagentaB` - `LightCyanB` - `LightWhiteB` - `Color3BitB(color)` - `Color8BitB(color)` - `FullColorB(r, g, b)` ### Color Converter 24bit RGB color to ANSI color. - `NewRGB3Bit(r, g, b)` - `NewRGB8Bit(r, g, b)` ### Builder To mix these features. ```go custom := aec.EmptyBuilder.Right(2).RGB8BitF(128, 255, 64).RedB().ANSI custom.Apply("Hello World") ``` ## Usage 1. Create ANSI by `aec.XXX().With(aec.YYY())` or `aec.EmptyBuilder.XXX().YYY().ANSI` 2. Print ANSI by `fmt.Print(ansi, "some string", aec.Reset)` or `fmt.Print(ansi.Apply("some string"))` `aec.Reset` should be added when using font style or font color features. ## Example Simple progressbar. ![sample](./sample.gif) ```go package main import ( "fmt" "strings" "time" "github.com/morikuni/aec" ) func main() { const n = 20 builder := aec.EmptyBuilder up2 := aec.Up(2) col := aec.Column(n + 2) bar := aec.Color8BitF(aec.NewRGB8Bit(64, 255, 64)) label := builder.LightRedF().Underline().With(col).Right(1).ANSI // for up2 fmt.Println() fmt.Println() for i := 0; i <= n; i++ { fmt.Print(up2) fmt.Println(label.Apply(fmt.Sprint(i, "/", n))) fmt.Print("[") fmt.Print(bar.Apply(strings.Repeat("=", i))) fmt.Println(col.Apply("]")) time.Sleep(100 * time.Millisecond) } } ``` ## License [MIT](./LICENSE)
{ "source": "yandex/perforator", "title": "vendor/github.com/morikuni/aec/README.md", "url": "https://github.com/yandex/perforator/blob/main/vendor/github.com/morikuni/aec/README.md", "date": "2025-01-29T14:20:43", "stars": 2926, "description": "Perforator is a cluster-wide continuous profiling tool designed for large data centers", "file_size": 2757 }