pax_global_header00006660000000000000000000000064145267677310014534gustar00rootroot0000000000000052 comment=99a5a9d0e906fb9edd84b5b37e573ce26beaa45b golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/000077500000000000000000000000001452676773100252425ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/.github/000077500000000000000000000000001452676773100266025ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/.github/workflows/000077500000000000000000000000001452676773100306375ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/.github/workflows/go.yml000066400000000000000000000005341452676773100317710ustar00rootroot00000000000000name: Go on: [push] jobs: test: name: Test runs-on: ubuntu-latest steps: - name: Set up Go 1.19 uses: actions/setup-go@v1 with: go-version: 1.19 id: go - name: Check out code into the Go module directory uses: actions/checkout@v1 - name: Test run: go test -mod=vendor -short ./... release.yml000066400000000000000000000017111452676773100327230ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/.github/workflowsname: Create a release on: push: tags: - "*" permissions: contents: write jobs: create_a_release: name: create a release runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - run: git fetch --force --tags - uses: actions/setup-go@v3 with: go-version: ">=1.19.4" cache: true - uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser version: latest args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} - run: echo "${HOME}/.humanlog/bin" >> $GITHUB_PATH - run: curl https://humanlog.io/install_apictl.sh | bash - run: ./script/create_version_artifacts.sh env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} HMAC_KEY_ID: ${{ secrets.HMAC_KEY_ID }} HMAC_PRIVATE_KEY: ${{ secrets.HMAC_PRIVATE_KEY }} golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/.gitignore000066400000000000000000000000161452676773100272270ustar00rootroot00000000000000*.ignore dist golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/LICENSE.md000066400000000000000000000261351452676773100266550ustar00rootroot00000000000000 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. golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/README.md000066400000000000000000000053121452676773100265220ustar00rootroot00000000000000# humanlog Read logs from `stdin` and prints them back to `stdout`, but prettier. # Using it ## On macOS ```bash brew tap humanlogio/homebrew-tap brew install humanlog ``` ## On linux (and macOS) ```bash curl -L "https://humanlog.io/install.sh" | sh ``` ## Otherwise [Grab a release](https://github.com/humanlogio/humanlog/releases)! # Example If you emit logs in JSON or in [`logfmt`](https://brandur.org/logfmt), you will enjoy pretty logs when those entries are encountered by `humanlog`. Unrecognized lines are left unchanged. ``` $ humanlog < /var/log/logfile.log ``` ![2__fish___users_antoine_gocode_src_github_com_humanlogio_humanlog__fish_](https://cloud.githubusercontent.com/assets/1189716/4328545/f2330bb4-3f86-11e4-8242-4f49f6ae9efc.png) # Usage ``` NAME: humanlog - reads structured logs from stdin, makes them pretty on stdout! USAGE: humanlog [global options] command [command options] [arguments...] VERSION: 0.7.2+48f11b1 AUTHOR: Antoine Grondin COMMANDS: version Interact with humanlog versions help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --config value specify a config file to use, otherwise uses the default one --skip value keys to skip when parsing a log entry --keep value keys to keep when parsing a log entry --sort-longest sort by longest key after having sorted lexicographically --skip-unchanged skip keys that have the same value than the previous entry --truncate truncates values that are longer than --truncate-length --truncate-length value truncate values that are longer than this length (default: 15) --color value specify color mode: auto, on/force, off (default: "auto") --light-bg use black as the base foreground color (for terminals with light backgrounds) --time-format value output time format, see https://golang.org/pkg/time/ for details (default: "Jan _2 15:04:05") --ignore-interrupts, -i ignore interrupts --message-fields value, -m value Custom JSON fields to search for the log message. (i.e. mssge, data.body.message) [$HUMANLOG_MESSAGE_FIELDS] --time-fields value, -t value Custom JSON fields to search for the log time. (i.e. logtime, data.body.datetime) [$HUMANLOG_TIME_FIELDS] --level-fields value, -l value Custom JSON fields to search for the log level. (i.e. somelevel, data.level) [$HUMANLOG_LEVEL_FIELDS] --help, -h show help --version, -v print the version ``` [l2met]: https://github.com/ryandotsmith/l2met golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/cmd/000077500000000000000000000000001452676773100260055ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/cmd/humanlog/000077500000000000000000000000001452676773100276175ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/cmd/humanlog/log.go000066400000000000000000000015331452676773100307310ustar00rootroot00000000000000package main import ( "log" "os" ) type loglevel int const ( debuglvl loglevel = iota infolvl warnlvl errorlvl ) var logLevel = func() loglevel { switch os.Getenv("HUMANLOG_LOG_LEVEL") { case "debug": return debuglvl case "info": return infolvl case "warn": return warnlvl case "error": return errorlvl default: return errorlvl } }() func logdebug(format string, args ...interface{}) { if logLevel <= debuglvl { log.Printf("[debug] "+format, args...) } } func loginfo(format string, args ...interface{}) { if logLevel <= infolvl { log.Printf("[info] "+format, args...) } } func logwarn(format string, args ...interface{}) { if logLevel <= warnlvl { log.Printf("[warn] "+format, args...) } } func logerror(format string, args ...interface{}) { if logLevel <= errorlvl { log.Printf("[error] "+format, args...) } } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/cmd/humanlog/main.go000066400000000000000000000213561452676773100311010ustar00rootroot00000000000000package main import ( "context" "fmt" "log" "os" "os/signal" "runtime" "strconv" "strings" "github.com/aybabtme/rgbterm" "github.com/blang/semver" types "github.com/humanlogio/api/go/types/v1" "github.com/humanlogio/humanlog" "github.com/humanlogio/humanlog/internal/pkg/config" "github.com/humanlogio/humanlog/internal/pkg/sink/stdiosink" "github.com/humanlogio/humanlog/internal/pkg/state" "github.com/mattn/go-colorable" "github.com/urfave/cli" ) var ( versionMajor = "0" versionMinor = "0" versionPatch = "0" versionPrerelease = "devel" versionBuild = "" version = func() *types.Version { var prerelease []string if versionPrerelease != "" { prerelease = append(prerelease, versionPrerelease) } return &types.Version{ Major: int32(mustatoi(versionMajor)), Minor: int32(mustatoi(versionMinor)), Patch: int32(mustatoi(versionPatch)), Prereleases: prerelease, Build: versionBuild, } }() semverVersion = func() semver.Version { v, err := version.AsSemver() if err != nil { panic(err) } return v }() ) func fatalf(c *cli.Context, format string, args ...interface{}) { log.Printf(format, args...) cli.ShowAppHelp(c) os.Exit(1) } func main() { app := newApp() prefix := rgbterm.FgString(app.Name+"> ", 99, 99, 99) log.SetOutput(colorable.NewColorableStderr()) log.SetFlags(0) log.SetPrefix(prefix) err := app.Run(os.Args) if err != nil { log.Fatal(err) } } func newApp() *cli.App { configFlag := cli.StringFlag{ Name: "config", Usage: "specify a config file to use, otherwise uses the default one", } skip := cli.StringSlice{} keep := cli.StringSlice{} skipFlag := cli.StringSliceFlag{ Name: "skip", Usage: "keys to skip when parsing a log entry", Value: &skip, } keepFlag := cli.StringSliceFlag{ Name: "keep", Usage: "keys to keep when parsing a log entry", Value: &keep, } sortLongest := cli.BoolTFlag{ Name: "sort-longest", Usage: "sort by longest key after having sorted lexicographically", } skipUnchanged := cli.BoolTFlag{ Name: "skip-unchanged", Usage: "skip keys that have the same value than the previous entry", } truncates := cli.BoolFlag{ Name: "truncate", Usage: "truncates values that are longer than --truncate-length", } truncateLength := cli.IntFlag{ Name: "truncate-length", Usage: "truncate values that are longer than this length", Value: *config.DefaultConfig.TruncateLength, } colorFlag := cli.StringFlag{ Name: "color", Usage: "specify color mode: auto, on/force, off", Value: stdiosink.DefaultStdioOpts.ColorFlag, } lightBg := cli.BoolFlag{ Name: "light-bg", Usage: "use black as the base foreground color (for terminals with light backgrounds)", } timeFormat := cli.StringFlag{ Name: "time-format", Usage: "output time format, see https://golang.org/pkg/time/ for details", Value: stdiosink.DefaultStdioOpts.TimeFormat, } ignoreInterrupts := cli.BoolFlag{ Name: "ignore-interrupts, i", Usage: "ignore interrupts", } messageFields := cli.StringSlice{} messageFieldsFlag := cli.StringSliceFlag{ Name: "message-fields, m", Usage: "Custom JSON fields to search for the log message. (i.e. mssge, data.body.message)", EnvVar: "HUMANLOG_MESSAGE_FIELDS", Value: &messageFields, } timeFields := cli.StringSlice{} timeFieldsFlag := cli.StringSliceFlag{ Name: "time-fields, t", Usage: "Custom JSON fields to search for the log time. (i.e. logtime, data.body.datetime)", EnvVar: "HUMANLOG_TIME_FIELDS", Value: &timeFields, } levelFields := cli.StringSlice{} levelFieldsFlag := cli.StringSliceFlag{ Name: "level-fields, l", Usage: "Custom JSON fields to search for the log level. (i.e. somelevel, data.level)", EnvVar: "HUMANLOG_LEVEL_FIELDS", Value: &levelFields, } app := cli.NewApp() app.Author = "Antoine Grondin" app.Email = "antoinegrondin@gmail.com" app.Name = "humanlog" app.Version = semverVersion.String() app.Usage = "reads structured logs from stdin, makes them pretty on stdout!" var ( ctx context.Context cancel context.CancelFunc cfg *config.Config statefile *state.State promptedToUpdate *semver.Version updateRes <-chan *checkForUpdateRes ) app.Before = func(c *cli.Context) error { ctx, cancel = signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) // read config if c.IsSet(configFlag.Name) { configFilepath := c.String(configFlag.Name) cfgFromFlag, err := config.ReadConfigFile(configFilepath, &config.DefaultConfig) if err != nil { return fmt.Errorf("reading --config file %q: %v", configFilepath, err) } cfg = cfgFromFlag } else { configFilepath, err := config.GetDefaultConfigFilepath() if err != nil { return fmt.Errorf("looking up config file path: %v", err) } cfgFromDir, err := config.ReadConfigFile(configFilepath, &config.DefaultConfig) if err != nil { return fmt.Errorf("reading default config file: %v", err) } cfg = cfgFromDir } stateFilepath, err := state.GetDefaultStateFilepath() if err != nil { return fmt.Errorf("looking up state file path: %v", err) } // read state statefile, err = state.ReadStateFile(stateFilepath, &state.DefaultState) if err != nil { return fmt.Errorf("reading default config file: %v", err) } if shouldCheckForUpdate(c, cfg, statefile) { if statefile.LatestKnownVersion != nil && statefile.LatestKnownVersion.GT(semverVersion) { promptedToUpdate = statefile.LatestKnownVersion if shouldPromptAboutUpdate() { promptToUpdate(semverVersion, *statefile.LatestKnownVersion) } } req := &checkForUpdateReq{ arch: runtime.GOARCH, os: runtime.GOOS, current: version, } updateRes = asyncCheckForUpdate(ctx, req, cfg, statefile) } return nil } app.After = func(c *cli.Context) error { cancel() select { case res, ok := <-updateRes: if !ok { return nil } if res.hasUpdate { alreadyPromptedForSameUpdate := promptedToUpdate != nil && promptedToUpdate.GTE(res.sem) if !alreadyPromptedForSameUpdate { if shouldPromptAboutUpdate() { promptToUpdate(semverVersion, res.sem) } } } default: } return nil } var ( getCtx = func(*cli.Context) context.Context { return ctx } getCfg = func(*cli.Context) *config.Config { return cfg } getState = func(*cli.Context) *state.State { return statefile } ) app.Commands = append(app.Commands, versionCmd(getCtx, getCfg, getState)) app.Flags = []cli.Flag{configFlag, skipFlag, keepFlag, sortLongest, skipUnchanged, truncates, truncateLength, colorFlag, lightBg, timeFormat, ignoreInterrupts, messageFieldsFlag, timeFieldsFlag, levelFieldsFlag} app.Action = func(c *cli.Context) error { // flags overwrite config file if c.IsSet(sortLongest.Name) { cfg.SortLongest = ptr(c.BoolT(sortLongest.Name)) } if c.IsSet(skipUnchanged.Name) { cfg.SkipUnchanged = ptr(c.BoolT(skipUnchanged.Name)) } if c.IsSet(truncates.Name) { cfg.Truncates = ptr(c.BoolT(truncates.Name)) } if c.IsSet(truncateLength.Name) { cfg.TruncateLength = ptr(c.Int(truncateLength.Name)) } if c.IsSet(lightBg.Name) { cfg.LightBg = ptr(c.Bool(lightBg.Name)) } if c.IsSet(timeFormat.Name) { cfg.TimeFormat = ptr(c.String(timeFormat.Name)) } if c.IsSet(colorFlag.Name) { cfg.ColorMode = ptr(c.String(colorFlag.Name)) } if c.IsSet(skipFlag.Name) { cfg.Skip = ptr([]string(skip)) } if c.IsSet(keepFlag.Name) { cfg.Keep = ptr([]string(keep)) } if c.IsSet(strings.Split(messageFieldsFlag.Name, ",")[0]) { cfg.MessageFields = ptr([]string(messageFields)) } if c.IsSet(strings.Split(timeFieldsFlag.Name, ",")[0]) { cfg.TimeFields = ptr([]string(timeFields)) } if c.IsSet(strings.Split(levelFieldsFlag.Name, ",")[0]) { cfg.LevelFields = ptr([]string(levelFields)) } if c.IsSet(strings.Split(ignoreInterrupts.Name, ",")[0]) { cfg.Interrupt = ptr(c.Bool(strings.Split(ignoreInterrupts.Name, ",")[0])) } // apply the config if *cfg.Interrupt { signal.Ignore(os.Interrupt) } if len(*cfg.Skip) > 0 && len(*cfg.Keep) > 0 { fatalf(c, "can only use one of %q and %q", skipFlag.Name, keepFlag.Name) } sinkOpts, errs := stdiosink.StdioOptsFrom(*cfg) if len(errs) > 0 { for _, err := range errs { log.Printf("config error: %v", err) } } sink := stdiosink.NewStdio(colorable.NewColorableStdout(), sinkOpts) handlerOpts := humanlog.HandlerOptionsFrom(*cfg) log.Print("reading stdin...") if err := humanlog.Scan(ctx, os.Stdin, sink, handlerOpts); err != nil { log.Fatalf("scanning caught an error: %v", err) } return nil } return app } func ptr[T any](v T) *T { return &v } func mustatoi(a string) int { i, err := strconv.Atoi(a) if err != nil { panic(err) } return i } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/cmd/humanlog/versions.go000066400000000000000000000146001452676773100320170ustar00rootroot00000000000000package main import ( "context" "errors" "fmt" "log" "net/http" "os" "runtime" "time" "github.com/blang/semver" "github.com/bufbuild/connect-go" "github.com/fatih/color" cliupdatepb "github.com/humanlogio/api/go/svc/cliupdate/v1" "github.com/humanlogio/api/go/svc/cliupdate/v1/cliupdatev1connect" types "github.com/humanlogio/api/go/types/v1" "github.com/humanlogio/humanlog/internal/pkg/config" "github.com/humanlogio/humanlog/internal/pkg/selfupdate" "github.com/humanlogio/humanlog/internal/pkg/state" "github.com/mattn/go-isatty" "github.com/urfave/cli" ) func isTerminal(f *os.File) bool { return isatty.IsTerminal(f.Fd()) || isatty.IsCygwinTerminal(f.Fd()) } func shouldCheckForUpdate(cctx *cli.Context, cfg *config.Config, state *state.State) bool { if cctx.Args().First() == versionCmdName { return false // check is done already } if cfg.SkipCheckForUpdates != nil && *cfg.SkipCheckForUpdates { return false } return true } func shouldPromptAboutUpdate() bool { if !isTerminal(os.Stderr) || !isTerminal(os.Stdout) { // not in interactive mode return false } return true } var httpClient = &http.Client{ Transport: &http.Transport{}, } func reqMeta(st *state.State) *types.ReqMeta { req := new(types.ReqMeta) if st == nil { return req } if st.AccountID != nil { req.AccountId = *st.AccountID } if st.MachineID != nil { req.MachineId = *st.MachineID } return req } func updateFromResMeta(st *state.State, res *types.ResMeta, latestKnownVersion *semver.Version, latestKnownVersionUpdatedAt *time.Time) error { changed := false if st.AccountID == nil || res.AccountId != *st.AccountID { st.AccountID = &res.AccountId changed = true } if st.MachineID == nil || res.MachineId != *st.MachineID { st.MachineID = &res.MachineId changed = true } if st.LatestKnownVersion == nil && latestKnownVersion != nil { st.LatestKnownVersion = latestKnownVersion changed = true } else if st.LatestKnownVersion != nil && latestKnownVersion != nil && !st.LatestKnownVersion.EQ(*latestKnownVersion) { st.LatestKnownVersion = latestKnownVersion changed = true } if st.LastestKnownVersionUpdatedAt == nil && latestKnownVersionUpdatedAt != nil { st.LastestKnownVersionUpdatedAt = latestKnownVersionUpdatedAt changed = true } else if st.LastestKnownVersionUpdatedAt != nil && latestKnownVersionUpdatedAt != nil && !st.LastestKnownVersionUpdatedAt.Equal(*latestKnownVersionUpdatedAt) { st.LastestKnownVersionUpdatedAt = latestKnownVersionUpdatedAt changed = true } if !changed { return nil } return st.WriteBack() } const versionCmdName = "version" func versionCmd( getCtx func(cctx *cli.Context) context.Context, getCfg func(cctx *cli.Context) *config.Config, getState func(cctx *cli.Context) *state.State, ) cli.Command { return cli.Command{ Name: versionCmdName, Usage: "Interact with humanlog versions", Subcommands: cli.Commands{ { Name: "check", Usage: "checks whether a newer version is available", Action: func(cctx *cli.Context) error { ctx := getCtx(cctx) cfg := getCfg(cctx) state := getState(cctx) nextVersion, nextArtifact, hasUpdate, err := checkForUpdate(ctx, cfg, state) if err != nil { return err } if !hasUpdate { log.Printf("you're already running the latest version: v%v", semverVersion.String()) return nil } nextSV, err := nextVersion.AsSemver() if err != nil { return fmt.Errorf("invalid semver received: %w", err) } promptToUpdate(semverVersion, nextSV) log.Printf("- url: %s", nextArtifact.Url) log.Printf("- sha256: %s", nextArtifact.Sha256) log.Printf("- sig: %s", nextArtifact.Signature) return nil }, }, { Name: "update", Usage: "self-update to the latest version", Action: func(cctx *cli.Context) error { ctx := getCtx(cctx) cfg := getCfg(cctx) state := getState(cctx) _, _, hasUpdate, err := checkForUpdate(ctx, cfg, state) if err != nil { return err } if !hasUpdate { log.Printf("you're already running the latest version: v%v", semverVersion.String()) return nil } return selfupdate.UpgradeInPlace(ctx, os.Stdout, os.Stderr, os.Stdin) }, }, }, } } const apiURL = "https://api.humanlog.io" type checkForUpdateReq struct { arch string os string current *types.Version } type checkForUpdateRes struct { pb *types.Version sem semver.Version hasUpdate bool } func checkForUpdate(ctx context.Context, cfg *config.Config, state *state.State) (v *types.Version, a *types.VersionArtifact, hasUpdate bool, err error) { currentSV, err := version.AsSemver() if err != nil { return nil, nil, false, err } updateClient := cliupdatev1connect.NewUpdateServiceClient(httpClient, apiURL) res, err := updateClient.GetNextUpdate(ctx, connect.NewRequest(&cliupdatepb.GetNextUpdateRequest{ ProjectName: "humanlog", CurrentVersion: version, MachineArchitecture: runtime.GOARCH, MachineOperatingSystem: runtime.GOOS, Meta: reqMeta(state), })) if err != nil { return nil, nil, false, err } msg := res.Msg lastCheckAt := time.Now() nextSV, err := msg.NextVersion.AsSemver() if err != nil { return nil, nil, false, err } if err := updateFromResMeta(state, msg.Meta, &nextSV, &lastCheckAt); err != nil { logwarn("failed to persist internal state: %v", err) } return msg.NextVersion, msg.NextArtifact, currentSV.LT(nextSV), nil } func asyncCheckForUpdate(ctx context.Context, req *checkForUpdateReq, cfg *config.Config, state *state.State) <-chan *checkForUpdateRes { out := make(chan *checkForUpdateRes, 1) go func() { defer close(out) nextVersion, _, hasUpdate, err := checkForUpdate(ctx, cfg, state) if err != nil { if errors.Is(errors.Unwrap(err), context.Canceled) { return } // TODO: log to diagnostic file? logwarn("failed to check for update: %v", err) return } nexVersion, err := nextVersion.AsSemver() if err != nil { logwarn("next version is not a valid semver: %v", err) return } out <- &checkForUpdateRes{ pb: nextVersion, sem: nexVersion, hasUpdate: hasUpdate, } }() return out } func promptToUpdate(from, to semver.Version) { log.Print( color.YellowString("Update available %s -> %s.", from, to), ) log.Print( color.YellowString("Run `%s` to upgrade.", color.New(color.Bold).Sprint("humanlog version update")), ) } docker_compose_handler.go000066400000000000000000000023641452676773100322100ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1package humanlog import ( "regexp" "github.com/humanlogio/humanlog/internal/pkg/model" ) // dcLogsPrefixRe parses out a prefix like 'web_1 | ' from docker-compose // The regex exists of five parts: // 1. An optional color terminal escape sequence // 2. The name of the service // 3. Any number of spaces, and a pipe symbol // 4. An optional color reset escape sequence // 5. The rest of the line var dcLogsPrefixRe = regexp.MustCompile("^(?:\x1b\\[\\d+m)?(?P[a-zA-Z0-9._-]+)\\s+\\|(?:\x1b\\[0m)? (?P.*)$") type handler interface { TryHandle([]byte, *model.Structured) bool } func tryDockerComposePrefix(d []byte, ev *model.Structured, nextHandler handler) bool { matches := dcLogsPrefixRe.FindSubmatch(d) if matches != nil { if nextHandler.TryHandle(matches[2], ev) { ev.KVs = append(ev.KVs, model.KV{ Key: "service", Value: string(matches[1]), }) return true } // The Zap Development handler is only built for `JSONHandler`s so // short-circuit calls for LogFmtHandlers switch h := nextHandler.(type) { case *JSONHandler: if tryZapDevDCPrefix(matches[2], ev, h) { ev.KVs = append(ev.KVs, model.KV{ Key: "service", Value: string(matches[1]), }) return true } } } return false } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/e2e_test.go000066400000000000000000000061151452676773100273060ustar00rootroot00000000000000package humanlog import ( "bytes" "context" "encoding/json" "io/ioutil" "os" "path/filepath" "testing" "github.com/humanlogio/humanlog/internal/pkg/config" "github.com/humanlogio/humanlog/internal/pkg/sink/stdiosink" ) func TestHarness(t *testing.T) { ctx := context.Background() root := "test/cases" des, err := os.ReadDir(root) if err != nil { t.Fatal(err) } for _, de := range des { t.Log(de.Name()) if !de.IsDir() { continue } testCase := de.Name() t.Run(testCase, func(t *testing.T) { input, err := ioutil.ReadFile(filepath.Join(root, de.Name(), "input")) if err != nil { t.Fatalf("reading input: %v", err) } want, err := ioutil.ReadFile(filepath.Join(root, de.Name(), "want")) if err != nil { t.Fatalf("reading expected output: %v", err) } cfgjson, err := ioutil.ReadFile(filepath.Join(root, de.Name(), "config.json")) if err != nil { t.Fatalf("reading config: %v", err) } var cfg config.Config if err := json.Unmarshal(cfgjson, &cfg); err != nil { t.Fatalf("unmarshaling config: %v", err) } gotw := bytes.NewBuffer(nil) sinkOpts, errs := stdiosink.StdioOptsFrom(cfg) if len(errs) > 1 { t.Fatalf("errs=%v", errs) } s := stdiosink.NewStdio(gotw, sinkOpts) err = Scan(ctx, bytes.NewReader(input), s, HandlerOptionsFrom(cfg)) if err != nil { t.Fatalf("scanning input: %v", err) } minl := len(want) got := gotw.Bytes() if len(want) < len(got) { t.Errorf("want len %d got %d", len(want), len(got)) } if len(want) > len(got) { t.Errorf("want len %d got %d", len(want), len(got)) minl = len(got) } ranges := newByteRanges() for i, w := range want[:minl] { g := got[i] if w != g { ranges.track(i) } } mismatches := len(ranges.ranges) if mismatches == 0 { return } t.Errorf("total of %d ranges mismatch", mismatches) if len(ranges.ranges) > 10 { mismatches = 10 t.Errorf("only showing first %d mismatches", mismatches) } for _, br := range ranges.ranges[:mismatches] { t.Errorf("- mismatch from byte %d to %d", br.start, br.end) wantPart := want[br.start:br.end] gotPart := got[br.start:br.end] t.Errorf("want %q", wantPart) t.Errorf("got %q", gotPart) } dir, err := ioutil.TempDir(os.TempDir(), "humanlog-tests-*") if err != nil { t.Fatal(err) } gotf, err := ioutil.TempFile(dir, de.Name()) if err != nil { t.Fatal(err) } if _, err := gotf.Write(got); err != nil { t.Fatal(err) } if err := gotf.Close(); err != nil { t.Fatal(err) } t.Logf("wrote output to %q", gotf.Name()) }) } } type byteranges struct { ranges []*byterange } func newByteRanges() *byteranges { return &byteranges{} } func (br *byteranges) track(idx int) { if len(br.ranges) == 0 { br.ranges = append(br.ranges, &byterange{start: idx, end: idx + 1}) return } lastRange := br.ranges[len(br.ranges)-1] if lastRange.end == idx { lastRange.end = idx + 1 } else { br.ranges = append(br.ranges, &byterange{start: idx, end: idx + 1}) } } type byterange struct { start int end int } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/go.mod000066400000000000000000000016211452676773100263500ustar00rootroot00000000000000module github.com/humanlogio/humanlog go 1.19 require ( github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 github.com/blang/semver v3.5.1+incompatible github.com/bufbuild/connect-go v1.4.1 github.com/cli/safeexec v1.0.1 github.com/fatih/color v1.13.0 github.com/go-logfmt/logfmt v0.5.1 github.com/humanlogio/api/go v0.0.0-20230114081617-9054c2994bcc github.com/kr/logfmt v0.0.0-20210122060352-19f9bcb100e6 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.16 github.com/stretchr/testify v1.8.1 github.com/urfave/cli v1.22.10 ) require ( github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect golang.org/x/sys v0.1.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/go.sum000066400000000000000000000134531452676773100264030ustar00rootroot00000000000000github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bufbuild/connect-go v1.4.1 h1:6usL3JGjKhxQpvDlizP7u8VfjAr1JkckcAUbrdcbgNY= github.com/bufbuild/connect-go v1.4.1/go.mod h1:9iNvh/NOsfhNBUH5CtvXeVUskQO1xsrEviH7ZArwZ3I= github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00= github.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/humanlogio/api/go v0.0.0-20230114081617-9054c2994bcc h1:gYloPWoTui1LUo/n2FqcdyAosbCupP3N3vn9EJYickM= github.com/humanlogio/api/go v0.0.0-20230114081617-9054c2994bcc/go.mod h1:DkpFdPohT0dBEJvo9lYEHJZ7qdGNQpsw89an+GXqMUU= github.com/kr/logfmt v0.0.0-20210122060352-19f9bcb100e6 h1:ZK1mH67KVyVW/zOLu0xLva+f6xJ8vt+LGrkQq5FJYLY= github.com/kr/logfmt v0.0.0-20210122060352-19f9bcb100e6/go.mod h1:JIiJcj9TX57tEvCXjm6eaHd2ce4pZZf9wzYuThq45u8= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/goreleaser.yaml000066400000000000000000000026251452676773100302630ustar00rootroot00000000000000project_name: humanlog before: hooks: - go mod tidy - go generate ./... builds: - main: ./cmd/humanlog/ binary: humanlog env: - CGO_ENABLED=0 ldflags: - -s -w -X main.versionMajor={{.Major}} -X main.versionMinor={{.Minor}} -X main.versionPatch={{.Patch}} -X main.versionPrerelease={{.Prerelease}} -X main.versionBuild={{.ShortCommit}} goos: - windows - darwin - linux goarch: - amd64 - arm64 release: github: owner: humanlogio name: humanlog archives: - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" format_overrides: - goos: windows format: zip brews: - tap: owner: humanlogio name: homebrew-tap nfpms: - maintainer: "antoinegrondin@gmail.com" formats: - deb checksum: name_template: "checksums.txt" # signs: # - cmd: cosign # stdin: "{{ .Env.COSIGN_PWD }}" # args: # [ # "sign-blob", # "--key=env://COSIGN_PRIVATE_KEY", # "--output-signature=${signature}", # "${artifact}", # ] # artifacts: all snapshot: name_template: "{{ incpatch .Version }}-next" changelog: sort: asc filters: exclude: - "^docs:" - "^test:" # modelines, feel free to remove those if you don't want/use them: # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/handler.go000066400000000000000000000031661452676773100272140ustar00rootroot00000000000000package humanlog import ( "github.com/humanlogio/humanlog/internal/pkg/config" "github.com/kr/logfmt" ) // Handler can recognize it's log lines, parse them and prettify them. type Handler interface { CanHandle(line []byte) bool Prettify(skipUnchanged bool) []byte logfmt.Handler } var DefaultOptions = func() *HandlerOptions { opts := &HandlerOptions{ TimeFields: []string{"time", "ts", "@timestamp", "timestamp", "Timestamp"}, MessageFields: []string{"message", "msg", "Body"}, LevelFields: []string{"level", "lvl", "loglevel", "severity", "SeverityText"}, } return opts } type HandlerOptions struct { TimeFields []string MessageFields []string LevelFields []string } var _ = HandlerOptionsFrom(config.DefaultConfig) // ensure it's valid func HandlerOptionsFrom(cfg config.Config) *HandlerOptions { opts := DefaultOptions() if cfg.TimeFields != nil { opts.TimeFields = appendUnique(opts.TimeFields, *cfg.TimeFields) } if cfg.MessageFields != nil { opts.MessageFields = appendUnique(opts.MessageFields, *cfg.MessageFields) } if cfg.LevelFields != nil { opts.LevelFields = appendUnique(opts.LevelFields, *cfg.LevelFields) } return opts } func appendUnique(a []string, b []string) []string { // init with `len(b)` because usually `a` will be // nil at first, but `b` wont be seen := make(map[string]struct{}, len(b)) out := make([]string, 0, len(b)) for _, aa := range a { if _, ok := seen[aa]; ok { continue } seen[aa] = struct{}{} out = append(out, aa) } for _, bb := range b { if _, ok := seen[bb]; ok { continue } seen[bb] = struct{}{} out = append(out, bb) } return out } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/000077500000000000000000000000001452676773100270565ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/000077500000000000000000000000001452676773100276375ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/config/000077500000000000000000000000001452676773100311045ustar00rootroot00000000000000config.go000066400000000000000000000147011452676773100326240ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/configpackage config import ( "encoding/json" "errors" "fmt" "os" "path/filepath" "strings" "time" ) var DefaultConfig = Config{ Version: 1, Skip: ptr([]string{}), Keep: ptr([]string{}), TimeFields: ptr([]string{"time", "ts", "@timestamp", "timestamp", "Timestamp"}), MessageFields: ptr([]string{"message", "msg", "Body"}), LevelFields: ptr([]string{"level", "lvl", "loglevel", "severity", "SeverityText"}), SortLongest: ptr(true), SkipUnchanged: ptr(true), Truncates: ptr(true), LightBg: ptr(false), ColorMode: ptr("auto"), TruncateLength: ptr(15), TimeFormat: ptr(time.Stamp), Interrupt: ptr(false), SkipCheckForUpdates: ptr(false), Palette: nil, } func GetDefaultConfigFilepath() (string, error) { home, err := os.UserHomeDir() if err != nil { return "", fmt.Errorf("$HOME not set, can't determine a config file path") } configDirpath := filepath.Join(home, ".config", "humanlog") configFilepath := filepath.Join(configDirpath, "config.json") dfi, err := os.Stat(configDirpath) if err != nil && !errors.Is(err, os.ErrNotExist) { return "", fmt.Errorf("config dir %q can't be read: %v", configDirpath, err) } if errors.Is(err, os.ErrNotExist) { if err := os.MkdirAll(configDirpath, 0700); err != nil { return "", fmt.Errorf("config dir %q can't be created: %v", configDirpath, err) } } else if !dfi.IsDir() { return "", fmt.Errorf("config dir %q isn't a directory", configDirpath) } ffi, err := os.Stat(configFilepath) if err != nil && !errors.Is(err, os.ErrNotExist) { return "", fmt.Errorf("can't stat config file: %v", err) } if errors.Is(err, os.ErrNotExist) { // do nothing } else if !ffi.Mode().IsRegular() { return "", fmt.Errorf("config file %q isn't a regular file", configFilepath) } return configFilepath, nil } func ReadConfigFile(path string, dflt *Config) (*Config, error) { configFile, err := os.Open(path) if err != nil { if !errors.Is(err, os.ErrNotExist) { return nil, fmt.Errorf("opening config file %q: %v", path, err) } return dflt, nil } defer configFile.Close() var cfg Config if err := json.NewDecoder(configFile).Decode(&cfg); err != nil { return nil, fmt.Errorf("decoding config file: %v", err) } return cfg.populateEmpty(dflt), nil } type Config struct { Version int `json:"version"` Skip *[]string `json:"skip"` Keep *[]string `json:"keep"` TimeFields *[]string `json:"time-fields"` MessageFields *[]string `json:"message-fields"` LevelFields *[]string `json:"level-fields"` SortLongest *bool `json:"sort-longest"` SkipUnchanged *bool `json:"skip-unchanged"` Truncates *bool `json:"truncates"` LightBg *bool `json:"light-bg"` ColorMode *string `json:"color-mode"` TruncateLength *int `json:"truncate-length"` TimeFormat *string `json:"time-format"` Palette *TextPalette `json:"palette"` Interrupt *bool `json:"interrupt"` SkipCheckForUpdates *bool `json:"skip_check_updates"` } func (cfg Config) populateEmpty(other *Config) *Config { out := *(&cfg) if out.Skip == nil && out.Keep == nil { // skip and keep are mutually exclusive, so these are // either both set by default, or not at all out.Skip = other.Skip out.Keep = other.Keep } if other.TimeFields != nil { if out.TimeFields == nil { out.TimeFields = ptr(make([]string, 0, len(*other.TimeFields))) } *out.TimeFields = append(*out.TimeFields, *other.TimeFields...) } if out.MessageFields == nil && other.MessageFields != nil { if out.MessageFields == nil { out.MessageFields = ptr(make([]string, 0, len(*other.MessageFields))) } *out.MessageFields = append(*out.MessageFields, *other.MessageFields...) } if out.LevelFields == nil && other.LevelFields != nil { if out.LevelFields == nil { out.LevelFields = ptr(make([]string, 0, len(*other.LevelFields))) } *out.LevelFields = append(*out.LevelFields, *other.LevelFields...) } if out.SortLongest == nil && other.SortLongest != nil { out.SortLongest = other.SortLongest } if out.SkipUnchanged == nil && other.SkipUnchanged != nil { out.SkipUnchanged = other.SkipUnchanged } if out.Truncates == nil && other.Truncates != nil { out.Truncates = other.Truncates } if out.LightBg == nil && other.LightBg != nil { out.LightBg = other.LightBg } if out.ColorMode == nil && other.ColorMode != nil { out.ColorMode = other.ColorMode } if out.TruncateLength == nil && other.TruncateLength != nil { out.TruncateLength = other.TruncateLength } if out.TimeFormat == nil && other.TimeFormat != nil { out.TimeFormat = other.TimeFormat } if out.Palette == nil && other.Palette != nil { out.Palette = other.Palette } if out.Interrupt == nil && other.Interrupt != nil { out.Interrupt = other.Interrupt } if out.SkipCheckForUpdates == nil && other.SkipCheckForUpdates != nil { out.SkipCheckForUpdates = other.SkipCheckForUpdates } return &out } type TextPalette struct { KeyColor []string `json:"key"` ValColor []string `json:"val"` TimeLightBgColor []string `json:"time_light_bg"` TimeDarkBgColor []string `json:"time_dark_bg"` MsgLightBgColor []string `json:"msg_light_bg"` MsgAbsentLightBgColor []string `json:"msg_absent_light_bg"` MsgDarkBgColor []string `json:"msg_dark_bg"` MsgAbsentDarkBgColor []string `json:"msg_absent_dark_bg"` DebugLevelColor []string `json:"debug_level"` InfoLevelColor []string `json:"info_level"` WarnLevelColor []string `json:"warn_level"` ErrorLevelColor []string `json:"error_level"` PanicLevelColor []string `json:"panic_level"` FatalLevelColor []string `json:"fatal_level"` UnknownLevelColor []string `json:"unknown_level"` } type ColorMode int const ( ColorModeOff ColorMode = iota ColorModeOn ColorModeAuto ) func GrokColorMode(colorMode string) (ColorMode, error) { switch strings.ToLower(colorMode) { case "on", "always", "force", "true", "yes", "1": return ColorModeOn, nil case "off", "never", "false", "no", "0": return ColorModeOff, nil case "auto", "tty", "maybe", "": return ColorModeAuto, nil default: return ColorModeAuto, fmt.Errorf("'%s' is not a color mode (try 'on', 'off' or 'auto')", colorMode) } } func ptr[T any](v T) *T { return &v } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/model/000077500000000000000000000000001452676773100307375ustar00rootroot00000000000000types.go000066400000000000000000000003441452676773100323540ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/modelpackage model import "time" type KV struct { Key string Value string } type Structured struct { Time time.Time Level string Msg string KVs []KV } type Event struct { Raw []byte Structured *Structured } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/selfupdate/000077500000000000000000000000001452676773100317735ustar00rootroot00000000000000update.go000066400000000000000000000036201452676773100335260ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/selfupdate// fork from https://github.com/superfly/flyctl/blob/master/internal/update/update.go package selfupdate import ( "context" "io" "os" "os/exec" "path/filepath" "runtime" "strings" "github.com/cli/safeexec" ) func UpgradeInPlace(ctx context.Context, stdout, stderr io.Writer, stdin io.Reader) error { if runtime.GOOS == "windows" { if err := renameCurrentBinaries(); err != nil { return err } } shellToUse, ok := os.LookupEnv("SHELL") switchToUse := "-c" if !ok { if runtime.GOOS == "windows" { shellToUse = "powershell.exe" switchToUse = "-Command" } else { shellToUse = "/bin/bash" } } command := updateCommand() cmd := exec.Command(shellToUse, switchToUse, command) cmd.Stdout = stdout cmd.Stderr = stderr cmd.Stdin = stdin return cmd.Run() } func isUnderHomebrew() bool { binary, err := os.Executable() if err != nil { return false } brewExe, err := safeexec.LookPath("brew") if err != nil { return false } brewPrefixBytes, err := exec.Command(brewExe, "--prefix").Output() if err != nil { return false } brewBinPrefix := filepath.Join(strings.TrimSpace(string(brewPrefixBytes)), "bin") + string(filepath.Separator) return strings.HasPrefix(binary, brewBinPrefix) } func updateCommand() string { if isUnderHomebrew() { return "brew upgrade humanlog" } if runtime.GOOS == "windows" { return "iwr https://humanlog.io/install.ps1 -useb | iex" } else { return `curl -L "https://humanlog.io/install.sh" | sh` } } // can't replace binary on windows, need to move func renameCurrentBinaries() error { binaries, err := currentWindowsBinaries() if err != nil { return err } for _, p := range binaries { if err := os.Rename(p, p+".old"); err != nil { return err } } return nil } func currentWindowsBinaries() ([]string, error) { binaryPath, err := os.Executable() if err != nil { return nil, err } return []string{binaryPath}, nil } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sink/000077500000000000000000000000001452676773100306035ustar00rootroot00000000000000bufsink/000077500000000000000000000000001452676773100321655ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sinksized.go000066400000000000000000000014001452676773100336250ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sink/bufsinkpackage bufsink import ( "context" "github.com/humanlogio/humanlog/internal/pkg/model" "github.com/humanlogio/humanlog/internal/pkg/sink" ) type SizedBuffer struct { Buffered []model.Event flush sink.BatchSink } var _ sink.Sink = (*SizedBuffer)(nil) func NewSizedBufferedSink(size int, flush sink.BatchSink) *SizedBuffer { return &SizedBuffer{ Buffered: make([]model.Event, 0, size), flush: flush, } } func (sn *SizedBuffer) Receive(ctx context.Context, ev *model.Event) error { sn.Buffered = append(sn.Buffered, *ev) if len(sn.Buffered) == cap(sn.Buffered) { if err := sn.flush.ReceiveBatch(ctx, sn.Buffered); err != nil { sn.Buffered = sn.Buffered[:len(sn.Buffered)-1] return err } sn.Buffered = sn.Buffered[:0] } return nil } sink.go000066400000000000000000000004021452676773100320130ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sinkpackage sink import ( "context" "github.com/humanlogio/humanlog/internal/pkg/model" ) type Sink interface { Receive(ctx context.Context, ev *model.Event) error } type BatchSink interface { ReceiveBatch(ctx context.Context, evs []model.Event) error } stdiosink/000077500000000000000000000000001452676773100325335ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sinkcolors.go000066400000000000000000000124371452676773100343720ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sink/stdiosinkpackage stdiosink import ( "fmt" "github.com/fatih/color" "github.com/humanlogio/humanlog/internal/pkg/config" ) var DefaultPalette = Palette{ KeyColor: color.New(color.FgGreen), ValColor: color.New(color.FgHiWhite), TimeLightBgColor: color.New(color.FgBlack), TimeDarkBgColor: color.New(color.FgWhite), MsgLightBgColor: color.New(color.FgBlack), MsgAbsentLightBgColor: color.New(color.FgHiBlack), MsgDarkBgColor: color.New(color.FgHiWhite), MsgAbsentDarkBgColor: color.New(color.FgWhite), DebugLevelColor: color.New(color.FgMagenta), InfoLevelColor: color.New(color.FgCyan), WarnLevelColor: color.New(color.FgYellow), ErrorLevelColor: color.New(color.FgRed), PanicLevelColor: color.New(color.BgRed), FatalLevelColor: color.New(color.BgHiRed, color.FgHiWhite), UnknownLevelColor: color.New(color.FgMagenta), } type Palette struct { KeyColor *color.Color ValColor *color.Color TimeLightBgColor *color.Color TimeDarkBgColor *color.Color MsgLightBgColor *color.Color MsgAbsentLightBgColor *color.Color MsgDarkBgColor *color.Color MsgAbsentDarkBgColor *color.Color DebugLevelColor *color.Color InfoLevelColor *color.Color WarnLevelColor *color.Color ErrorLevelColor *color.Color PanicLevelColor *color.Color FatalLevelColor *color.Color UnknownLevelColor *color.Color } func PaletteFrom(pl config.TextPalette) (*Palette, error) { var err error out := &Palette{} out.KeyColor, err = attributesToColor(pl.KeyColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "key", err) } out.ValColor, err = attributesToColor(pl.ValColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "val", err) } out.TimeLightBgColor, err = attributesToColor(pl.TimeLightBgColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "time_light_bg", err) } out.TimeDarkBgColor, err = attributesToColor(pl.TimeDarkBgColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "time_dark_bg", err) } out.MsgLightBgColor, err = attributesToColor(pl.MsgLightBgColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "msg_light_bg", err) } out.MsgAbsentLightBgColor, err = attributesToColor(pl.MsgAbsentLightBgColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "msg_absent_light_bg", err) } out.MsgDarkBgColor, err = attributesToColor(pl.MsgDarkBgColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "msg_dark_bg", err) } out.MsgAbsentDarkBgColor, err = attributesToColor(pl.MsgAbsentDarkBgColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "msg_absent_dark_bg", err) } out.DebugLevelColor, err = attributesToColor(pl.DebugLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "debug_level", err) } out.InfoLevelColor, err = attributesToColor(pl.InfoLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "info_level", err) } out.WarnLevelColor, err = attributesToColor(pl.WarnLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "warn_level", err) } out.ErrorLevelColor, err = attributesToColor(pl.ErrorLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "error_level", err) } out.PanicLevelColor, err = attributesToColor(pl.PanicLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "panic_level", err) } out.FatalLevelColor, err = attributesToColor(pl.FatalLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "fatal_level", err) } out.UnknownLevelColor, err = attributesToColor(pl.UnknownLevelColor) if err != nil { return nil, fmt.Errorf("in palette key %q, %v", "unknown_level", err) } return out, err } func attributesToColor(names []string) (*color.Color, error) { attrs := make([]color.Attribute, 0, len(names)) for _, name := range names { attr, ok := colorAttributeIndex[name] if !ok { return nil, fmt.Errorf("color %q isn't supported", name) } attrs = append(attrs, attr) } return color.New(attrs...), nil } var colorAttributeIndex = map[string]color.Attribute{ "fg_black": color.FgBlack, "fg_red": color.FgRed, "fg_green": color.FgGreen, "fg_yellow": color.FgYellow, "fg_blue": color.FgBlue, "fg_magenta": color.FgMagenta, "fg_cyan": color.FgCyan, "fg_white": color.FgWhite, "fg_hi_black": color.FgHiBlack, "fg_hi_red": color.FgHiRed, "fg_hi_green": color.FgHiGreen, "fg_hi_yellow": color.FgHiYellow, "fg_hi_blue": color.FgHiBlue, "fg_hi_magenta": color.FgHiMagenta, "fg_hi_cyan": color.FgHiCyan, "fg_hi_white": color.FgHiWhite, "bg_black": color.BgBlack, "bg_red": color.BgRed, "bg_green": color.BgGreen, "bg_yellow": color.BgYellow, "bg_blue": color.BgBlue, "bg_magenta": color.BgMagenta, "bg_cyan": color.BgCyan, "bg_white": color.BgWhite, "bg_hi_black": color.BgHiBlack, "bg_hi_red": color.BgHiRed, "bg_hi_green": color.BgHiGreen, "bg_hi_yellow": color.BgHiYellow, "bg_hi_blue": color.BgHiBlue, "bg_hi_magenta": color.BgHiMagenta, "bg_hi_cyan": color.BgHiCyan, "bg_hi_white": color.BgHiWhite, } stdio.go000066400000000000000000000140521452676773100342060ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/sink/stdiosinkpackage stdiosink import ( "bytes" "context" "fmt" "io" "sort" "strings" "text/tabwriter" "time" "github.com/fatih/color" "github.com/humanlogio/humanlog/internal/pkg/config" "github.com/humanlogio/humanlog/internal/pkg/model" "github.com/humanlogio/humanlog/internal/pkg/sink" ) var ( eol = [...]byte{'\n'} ) type Stdio struct { w io.Writer opts StdioOpts lastRaw bool lastLevel string lastKVs map[string]string } type StdioOpts struct { Keep map[string]struct{} Skip map[string]struct{} SkipUnchanged bool SortLongest bool TimeFormat string TruncateLength int Truncates bool ColorFlag string LightBg bool Palette Palette } var DefaultStdioOpts = StdioOpts{ SkipUnchanged: true, SortLongest: true, TimeFormat: time.Stamp, TruncateLength: 15, Truncates: true, ColorFlag: "auto", LightBg: false, Palette: DefaultPalette, } func StdioOptsFrom(cfg config.Config) (StdioOpts, []error) { var errs []error opts := DefaultStdioOpts if cfg.Skip != nil { opts.Skip = sliceToSet(cfg.Skip) } if cfg.Keep != nil { opts.Keep = sliceToSet(cfg.Keep) } if cfg.SortLongest != nil { opts.SortLongest = *cfg.SortLongest } if cfg.SkipUnchanged != nil { opts.SkipUnchanged = *cfg.SkipUnchanged } if cfg.Truncates != nil { opts.Truncates = *cfg.Truncates } if cfg.LightBg != nil { opts.LightBg = *cfg.LightBg } if cfg.TruncateLength != nil { opts.TruncateLength = *cfg.TruncateLength } if cfg.TimeFormat != nil { opts.TimeFormat = *cfg.TimeFormat } if cfg.ColorMode != nil { colorMode, err := config.GrokColorMode(*cfg.ColorMode) if err != nil { errs = append(errs, fmt.Errorf("invalid --color=%q: %v", *cfg.ColorMode, err)) } switch colorMode { case config.ColorModeOff: color.NoColor = true case config.ColorModeOn: color.NoColor = false default: // 'Auto' default is applied as a global variable initializer function, so nothing // to do here. } } if cfg.Palette != nil { pl, err := PaletteFrom(*cfg.Palette) if err != nil { errs = append(errs, fmt.Errorf("invalid palette, using default one: %v", err)) } else { opts.Palette = *pl } } return opts, errs } var _ sink.Sink = (*Stdio)(nil) func NewStdio(w io.Writer, opts StdioOpts) *Stdio { return &Stdio{ w: w, opts: opts, } } func (std *Stdio) Receive(ctx context.Context, ev *model.Event) error { if ev.Structured == nil { std.lastRaw = true std.lastLevel = "" std.lastKVs = nil if _, err := std.w.Write(ev.Raw); err != nil { return err } if _, err := std.w.Write(eol[:]); err != nil { return err } return nil } data := ev.Structured buf := bytes.NewBuffer(nil) out := tabwriter.NewWriter(buf, 0, 1, 0, '\t', 0) var ( msgColor *color.Color msgAbsentColor *color.Color ) if std.opts.LightBg { msgColor = std.opts.Palette.MsgLightBgColor msgAbsentColor = std.opts.Palette.MsgAbsentLightBgColor } else { msgColor = std.opts.Palette.MsgDarkBgColor msgAbsentColor = std.opts.Palette.MsgAbsentDarkBgColor } var msg string if data.Msg == "" { msg = msgAbsentColor.Sprint("") } else { msg = msgColor.Sprint(data.Msg) } lvl := strings.ToUpper(data.Level)[:imin(4, len(data.Level))] var level string switch strings.ToLower(data.Level) { case "debug": level = std.opts.Palette.DebugLevelColor.Sprint(lvl) case "info": level = std.opts.Palette.InfoLevelColor.Sprint(lvl) case "warn", "warning": level = std.opts.Palette.WarnLevelColor.Sprint(lvl) case "error": level = std.opts.Palette.ErrorLevelColor.Sprint(lvl) case "fatal", "panic": level = std.opts.Palette.FatalLevelColor.Sprint(lvl) default: level = std.opts.Palette.UnknownLevelColor.Sprint(lvl) } var timeColor *color.Color if std.opts.LightBg { timeColor = std.opts.Palette.TimeLightBgColor } else { timeColor = std.opts.Palette.TimeDarkBgColor } _, _ = fmt.Fprintf(out, "%s |%s| %s\t %s", timeColor.Sprint(data.Time.Format(std.opts.TimeFormat)), level, msg, strings.Join(std.joinKVs(data, "="), "\t "), ) if err := out.Flush(); err != nil { return err } buf.Write(eol[:]) if _, err := buf.WriteTo(std.w); err != nil { return err } kvs := make(map[string]string, len(data.KVs)) for _, kv := range data.KVs { kvs[kv.Key] = kv.Value } std.lastRaw = false std.lastLevel = ev.Structured.Level std.lastKVs = kvs return nil } func (std *Stdio) joinKVs(data *model.Structured, sep string) []string { wasSameLevel := std.lastLevel == data.Level skipUnchanged := !std.lastRaw && std.opts.SkipUnchanged && wasSameLevel kv := make([]string, 0, len(data.KVs)) for _, pair := range data.KVs { k, v := pair.Key, pair.Value if !std.opts.shouldShowKey(k) { continue } if skipUnchanged { if lastV, ok := std.lastKVs[k]; ok && lastV == v && !std.opts.shouldShowUnchanged(k) { continue } } kstr := std.opts.Palette.KeyColor.Sprint(k) var vstr string if std.opts.Truncates && len(v) > std.opts.TruncateLength { vstr = v[:std.opts.TruncateLength] + "..." } else { vstr = v } vstr = std.opts.Palette.ValColor.Sprint(vstr) kv = append(kv, kstr+sep+vstr) } sort.Strings(kv) if std.opts.SortLongest { sort.Stable(byLongest(kv)) } return kv } func (opts *StdioOpts) shouldShowKey(key string) bool { if len(opts.Keep) != 0 { if _, keep := opts.Keep[key]; keep { return true } } if len(opts.Skip) != 0 { if _, skip := opts.Skip[key]; skip { return false } } return true } func (opts *StdioOpts) shouldShowUnchanged(key string) bool { if len(opts.Keep) != 0 { if _, keep := opts.Keep[key]; keep { return true } } return false } type byLongest []string func (s byLongest) Len() int { return len(s) } func (s byLongest) Less(i, j int) bool { return len(s[i]) < len(s[j]) } func (s byLongest) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func imin(a, b int) int { if a < b { return a } return b } func sliceToSet(arr *[]string) map[string]struct{} { if arr == nil { return nil } out := make(map[string]struct{}) for _, key := range *arr { out[key] = struct{}{} } return out } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/state/000077500000000000000000000000001452676773100307575ustar00rootroot00000000000000state.go000066400000000000000000000073371452676773100323610ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/internal/pkg/statepackage state import ( "encoding/json" "errors" "fmt" "os" "path/filepath" "time" "github.com/blang/semver" ) var DefaultState = State{ Version: 1, } func GetDefaultStateFilepath() (string, error) { home, err := os.UserHomeDir() if err != nil { return "", fmt.Errorf("$HOME not set, can't determine a state file path") } stateDirpath := filepath.Join(home, ".state", "humanlog") stateFilepath := filepath.Join(stateDirpath, "state.json") dfi, err := os.Stat(stateDirpath) if err != nil && !errors.Is(err, os.ErrNotExist) { return "", fmt.Errorf("state dir %q can't be read: %v", stateDirpath, err) } if errors.Is(err, os.ErrNotExist) { if err := os.MkdirAll(stateDirpath, 0700); err != nil { return "", fmt.Errorf("state dir %q can't be created: %v", stateDirpath, err) } } else if !dfi.IsDir() { return "", fmt.Errorf("state dir %q isn't a directory", stateDirpath) } ffi, err := os.Stat(stateFilepath) if err != nil && !errors.Is(err, os.ErrNotExist) { return "", fmt.Errorf("can't stat state file: %v", err) } if errors.Is(err, os.ErrNotExist) { // do nothing } else if !ffi.Mode().IsRegular() { return "", fmt.Errorf("state file %q isn't a regular file", stateFilepath) } return stateFilepath, nil } func ReadStateFile(path string, dflt *State) (*State, error) { stateFile, err := os.Open(path) if err != nil { if !errors.Is(err, os.ErrNotExist) { return nil, fmt.Errorf("opening state file %q: %v", path, err) } cfg := (State{path: path}).populateEmpty(dflt) return cfg, WriteStateFile(path, cfg) } defer stateFile.Close() var cfg State if err := json.NewDecoder(stateFile).Decode(&cfg); err != nil { return nil, fmt.Errorf("decoding state file: %v", err) } cfg.path = path return cfg.populateEmpty(dflt), nil } func WriteStateFile(path string, state *State) error { content, err := json.MarshalIndent(state, "", "\t") if err != nil { return fmt.Errorf("marshaling state file: %v", err) } newf, err := os.CreateTemp(filepath.Dir(path), "humanlog_statefile") if err != nil { return fmt.Errorf("creating temporary file for statefile: %w", err) } success := false defer func() { if !success { _ = os.Remove(newf.Name()) } }() if _, err := newf.Write(content); err != nil { return fmt.Errorf("writing to temporary statefile: %w", err) } if err := newf.Close(); err != nil { return fmt.Errorf("closing temporary statefile: %w", err) } if err := os.Chmod(newf.Name(), 0600); err != nil { return fmt.Errorf("setting permissions on temporary statefile: %w", err) } if err := os.Rename(newf.Name(), path); err != nil { return fmt.Errorf("replacing statefile at %q with %q: %w", path, newf.Name(), err) } success = true return nil } type State struct { Version int `json:"version"` AccountID *int64 `json:"account_id"` MachineID *int64 `json:"machine_id"` LatestKnownVersion *semver.Version `json:"latest_known_version,omitempty"` LastestKnownVersionUpdatedAt *time.Time `json:"latest_known_version_updated_at"` // unexported path string } func (cfg *State) WriteBack() error { return WriteStateFile(cfg.path, cfg) } func (cfg State) populateEmpty(other *State) *State { ptr := &cfg out := *ptr if out.AccountID == nil && other.AccountID != nil { out.AccountID = other.AccountID } if out.MachineID == nil && other.MachineID != nil { out.MachineID = other.MachineID } if out.LatestKnownVersion == nil && other.LatestKnownVersion != nil { out.LatestKnownVersion = other.LatestKnownVersion } if out.LastestKnownVersionUpdatedAt == nil && other.LastestKnownVersionUpdatedAt != nil { out.LastestKnownVersionUpdatedAt = other.LastestKnownVersionUpdatedAt } return &out } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/json_handler.go000066400000000000000000000103451452676773100302420ustar00rootroot00000000000000package humanlog import ( "encoding/json" "fmt" "math" "strings" "time" "github.com/humanlogio/humanlog/internal/pkg/model" ) // JSONHandler can handle logs emitted by logrus.TextFormatter loggers. type JSONHandler struct { Opts *HandlerOptions Level string Time time.Time Message string Fields map[string]string } // searchJSON searches a document for a key using the found func to determine if the value is accepted. // kvs is the deserialized json document. // fieldList is a list of field names that should be searched. Sub-documents can be searched by using the dot (.). For example, to search {"data"{"message": ""}} the item would be data.message func searchJSON(kvs map[string]interface{}, fieldList []string, found func(key string, value interface{}) bool) bool { for _, field := range fieldList { splits := strings.SplitN(field, ".", 2) if len(splits) > 1 { name, fieldKey := splits[0], splits[1] val, ok := kvs[name] if !ok { // the key does not exist in the document continue } if m, ok := val.(map[string]interface{}); ok { // its value is JSON and was unmarshaled to map[string]interface{} so search the sub document return searchJSON(m, []string{fieldKey}, found) } } else { // this is not a sub-document search, so search the root for k, v := range kvs { if field == k && found(k, v) { return true } } } } return false } func checkEachUntilFound(fieldList []string, found func(string) bool) bool { for _, field := range fieldList { if found(field) { return true } } return false } func (h *JSONHandler) clear() { h.Level = "" h.Time = time.Time{} h.Message = "" h.Fields = make(map[string]string) } // TryHandle tells if this line was handled by this handler. func (h *JSONHandler) TryHandle(d []byte, out *model.Structured) bool { h.clear() if !h.UnmarshalJSON(d) { return false } out.Time = h.Time out.Msg = h.Message out.Level = h.Level for k, v := range h.Fields { out.KVs = append(out.KVs, model.KV{Key: k, Value: v}) } return true } func deleteJSONKey(key string, jsonData map[string]interface{}) { if _, ok := jsonData[key]; ok { // found the key at the root delete(jsonData, key) return } splits := strings.SplitN(key, ".", 2) if len(splits) < 2 { // invalid selector return } k, v := splits[0], splits[1] ifce, ok := jsonData[k] if !ok { return // the key doesn't exist } if m, ok := ifce.(map[string]interface{}); ok { deleteJSONKey(v, m) } } // UnmarshalJSON sets the fields of the handler. func (h *JSONHandler) UnmarshalJSON(data []byte) bool { raw := make(map[string]interface{}) err := json.Unmarshal(data, &raw) if err != nil { return false } searchJSON(raw, h.Opts.TimeFields, func(field string, value interface{}) bool { var ok bool h.Time, ok = tryParseTime(value) if ok { deleteJSONKey(field, raw) } return ok }) searchJSON(raw, h.Opts.MessageFields, func(field string, value interface{}) bool { var ok bool h.Message, ok = value.(string) if ok { deleteJSONKey(field, raw) } return ok }) searchJSON(raw, h.Opts.LevelFields, func(field string, value interface{}) bool { if strLvl, ok := value.(string); ok { h.Level = strLvl deleteJSONKey(field, raw) } else if flLvl, ok := value.(float64); ok { h.Level = convertBunyanLogLevel(flLvl) deleteJSONKey(field, raw) } else { h.Level = "???" } return true }) if h.Fields == nil { h.Fields = make(map[string]string) } for key, val := range raw { switch v := val.(type) { case float64: if v-math.Floor(v) < 0.000001 && v < 1e9 { // looks like an integer that's not too large h.Fields[key] = fmt.Sprintf("%d", int(v)) } else { h.Fields[key] = fmt.Sprintf("%g", v) } case string: h.Fields[key] = fmt.Sprintf("%q", v) default: h.Fields[key] = fmt.Sprintf("%v", v) } } return true } // convertBunyanLogLevel returns a human readable log level given a numerical bunyan level // https://github.com/trentm/node-bunyan#levels func convertBunyanLogLevel(level float64) string { switch level { case 10: return "trace" case 20: return "debug" case 30: return "info" case 40: return "warn" case 50: return "error" case 60: return "fatal" default: return "???" } } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/json_handler_test.go000066400000000000000000000075171452676773100313100ustar00rootroot00000000000000package humanlog_test import ( "fmt" "testing" "time" "github.com/humanlogio/humanlog" "github.com/humanlogio/humanlog/internal/pkg/model" ) func TestJSONHandler_UnmarshalJSON_ParsesFields(t *testing.T) { msg := `The service is running on port 8080.` level := `info` timeFormat := time.RFC3339Nano tm, err := time.Parse(timeFormat, "2012-11-01T22:08:41+00:00") if err != nil { t.Fatalf("failed to parse time: %v", err) } raw := []byte(fmt.Sprintf(`{ "message": %q, "level": %q, "time": %q }`, msg, level, tm)) opts := humanlog.DefaultOptions() h := humanlog.JSONHandler{Opts: opts} ev := new(model.Structured) if !h.TryHandle(raw, ev) { t.Fatalf("failed to parse log level") } if h.Level != level { t.Fatalf("not equal: expected %q, got %q", level, h.Level) } if h.Message != msg { t.Fatalf("not equal: expected %q, got %q", msg, h.Message) } if !h.Time.Equal(tm) { t.Fatalf("not equal: expected %q, got %q", tm, h.Time) } } func TestJSONHandler_UnmarshalJSON_ParsesCustomFields(t *testing.T) { msg := `The service is running on port 8080.` level := `info` timeFormat := time.RFC3339Nano tm, err := time.Parse(timeFormat, "2012-11-01T22:08:41+00:00") if err != nil { t.Fatalf("failed to parse time: %v", err) } raw := []byte(fmt.Sprintf(`{ "mymessage": %q, "mylevel": %q, "mytime": %q }`, msg, level, tm)) opts := humanlog.DefaultOptions() opts.LevelFields = []string{"mylevel"} opts.MessageFields = []string{"mymessage"} opts.TimeFields = []string{"mytime"} h := humanlog.JSONHandler{Opts: opts} ev := new(model.Structured) if !h.TryHandle(raw, ev) { t.Fatalf("failed to parse log level") } if h.Level != level { t.Fatalf("not equal: expected %q, got %q", level, h.Level) } if h.Message != msg { t.Fatalf("not equal: expected %q, got %q", msg, h.Message) } if !h.Time.Equal(tm) { t.Fatalf("not equal: expected %q, got %q", tm, h.Time) } } func TestJSONHandler_UnmarshalJSON_ParsesCustomNestedFields(t *testing.T) { msg := `The service is running on port 8080.` level := `info` timeFormat := time.RFC3339Nano tm, err := time.Parse(timeFormat, "2012-11-01T22:08:41+00:00") if err != nil { t.Fatalf("failed to parse time: %v", err) } raw := []byte(fmt.Sprintf(`{ "data": { "message": %q, "level": %q, "time": %q }}`, msg, level, tm)) opts := humanlog.DefaultOptions() opts.LevelFields = []string{"data.level"} opts.MessageFields = []string{"data.message"} opts.TimeFields = []string{"data.time"} h := humanlog.JSONHandler{Opts: opts} ev := new(model.Structured) if !h.TryHandle(raw, ev) { t.Fatalf("failed to handle log") } if h.Level != level { t.Fatalf("not equal: expected %q, got %q", level, h.Level) } if h.Message != msg { t.Fatalf("not equal: expected %q, got %q", msg, h.Message) } if !h.Time.Equal(tm) { t.Fatalf("not equal: expected %q, got %q", tm, h.Time) } } func TestJSONHandler_UnmarshalJSON_ParsesCustomMultiNestedFields(t *testing.T) { msg := `The service is running on port 8080.` level := `info` timeFormat := time.RFC3339Nano tm, err := time.Parse(timeFormat, "2012-11-01T22:08:41+00:00") if err != nil { t.Fatalf("failed to parse time: %v", err) } raw := []byte(fmt.Sprintf(`{ "data": { "l2": { "message": %q, "level": %q, "time": %q } } }`, msg, level, tm)) opts := humanlog.DefaultOptions() opts.LevelFields = []string{"data.l2.level"} opts.MessageFields = []string{"data.l2.message"} opts.TimeFields = []string{"data.l2.time"} h := humanlog.JSONHandler{Opts: opts} ev := new(model.Structured) if !h.TryHandle(raw, ev) { t.Fatalf("failed to handle log") } if h.Level != level { t.Fatalf("not equal: expected %q, got %q", level, h.Level) } if h.Message != msg { t.Fatalf("not equal: expected %q, got %q", msg, h.Message) } if !h.Time.Equal(tm) { t.Fatalf("not equal: expected %q, got %q", tm, h.Time) } } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/logfmt_handler.go000066400000000000000000000047421452676773100305650ustar00rootroot00000000000000package humanlog import ( "bytes" "strconv" "time" "github.com/go-logfmt/logfmt" "github.com/humanlogio/humanlog/internal/pkg/model" ) // LogfmtHandler can handle logs emmited by logrus.TextFormatter loggers. type LogfmtHandler struct { Opts *HandlerOptions Level string Time time.Time Message string Fields map[string]string } func (h *LogfmtHandler) clear() { h.Level = "" h.Time = time.Time{} h.Message = "" h.Fields = make(map[string]string) } // CanHandle tells if this line can be handled by this handler. func (h *LogfmtHandler) TryHandle(d []byte, out *model.Structured) bool { if !bytes.ContainsRune(d, '=') { return false } h.clear() if !h.UnmarshalLogfmt(d) { return false } out.Time = h.Time out.Msg = h.Message out.Level = h.Level for k, v := range h.Fields { out.KVs = append(out.KVs, model.KV{Key: k, Value: v}) } return true } // HandleLogfmt sets the fields of the handler. func (h *LogfmtHandler) UnmarshalLogfmt(data []byte) bool { if h.Fields == nil { h.Fields = make(map[string]string) } dec := logfmt.NewDecoder(bytes.NewReader(data)) for dec.ScanRecord() { next_kv: for dec.ScanKeyval() { key := dec.Key() val := dec.Value() if h.Time.IsZero() { foundTime := checkEachUntilFound(h.Opts.TimeFields, func(field string) bool { time, ok := tryParseTime(string(val)) if ok { h.Time = time } return ok }) if foundTime { continue next_kv } } if len(h.Message) == 0 { foundMessage := checkEachUntilFound(h.Opts.MessageFields, func(field string) bool { if !bytes.Equal(key, []byte(field)) { return false } h.Message = string(val) return true }) if foundMessage { continue next_kv } } if len(h.Level) == 0 { foundLevel := checkEachUntilFound(h.Opts.LevelFields, func(field string) bool { if !bytes.Equal(key, []byte(field)) { return false } h.Level = string(val) return true }) if foundLevel { continue next_kv } } h.Fields[string(key)] = string(val) } } return dec.Err() == nil } func (h *LogfmtHandler) setLevel(val []byte) { h.Level = string(val) } func (h *LogfmtHandler) setMessage(val []byte) { h.Message = string(val) } func (h *LogfmtHandler) setTime(val []byte) (parsed bool) { valStr := string(val) if valFloat, err := strconv.ParseFloat(valStr, 64); err == nil { h.Time, parsed = tryParseTime(valFloat) } else { h.Time, parsed = tryParseTime(string(val)) } return } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/logs.txt000066400000000000000000000126201452676773100267500ustar00rootroot00000000000000{"data":{"short":"service-startup","message":"The login-api service is running on port 8085."},"datacontenttype":"application/json","id":"01FCV6S4M6S8H3VKAQD9SWFWFP","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:50.246861-05:00","type":"simple-log"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6S9YK70GJ5Q6YT0PYKQDA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6S9YJXD2SYG3HTGWXHX0G","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:55.699075-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SDKRW3XZDA1FAGZ3QVSH","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SDKRHB1RR1Q87Q1SKT5P","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:59.448566-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SE597EY6RJ762V59PZQA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SE596ZMASA1D79M16KVV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.009615-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SEKCC9RG364AJ60J75KW","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SEKCNSQJJ2NDEPQ2TGMP","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.46025-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SF3DXGB8G1DVX19KQZYT","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SF3DJZSXTT1RNR6F1QAV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.973455-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SKY9MM7D795258XPQGC9","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SKY9M1D725HTV0ZXKF1V","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:05.929423-05:00","type":"incoming_http_request"} {"data":{"event":"Shutdown"},"datacontenttype":"application/json","id":"01FCV6SR6JZH7JZ6RFDFN9Q99Y","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:10.290034-05:00","type":"service-shutdown"}golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/scanner.go000066400000000000000000000031331452676773100272220ustar00rootroot00000000000000package humanlog import ( "bufio" "bytes" "context" "io" "time" "github.com/humanlogio/humanlog/internal/pkg/model" "github.com/humanlogio/humanlog/internal/pkg/sink" ) // Scan reads JSON-structured lines from src and prettify them onto dst. If // the lines aren't JSON-structured, it will simply write them out with no // prettification. func Scan(ctx context.Context, src io.Reader, sink sink.Sink, opts *HandlerOptions) error { in := bufio.NewScanner(src) in.Buffer(make([]byte, 1024*1024), 1024*1024) in.Split(bufio.ScanLines) var line uint64 logfmtEntry := LogfmtHandler{Opts: opts} jsonEntry := JSONHandler{Opts: opts} ev := new(model.Event) data := new(model.Structured) ev.Structured = data for in.Scan() { line++ lineData := in.Bytes() if ev.Structured == nil { ev.Structured = data } data.Time = time.Time{} data.Msg = "" data.Level = "" data.KVs = data.KVs[:0] ev.Raw = lineData // remove that pesky syslog crap lineData = bytes.TrimPrefix(lineData, []byte("@cee: ")) switch { case jsonEntry.TryHandle(lineData, data): case logfmtEntry.TryHandle(lineData, data): case tryDockerComposePrefix(lineData, data, &jsonEntry): case tryDockerComposePrefix(lineData, data, &logfmtEntry): case tryZapDevPrefix(lineData, data, &jsonEntry): default: ev.Structured = nil } if err := sink.Receive(ctx, ev); err != nil { return err } select { case <-ctx.Done(): return nil default: } } select { case <-ctx.Done(): return nil default: } switch err := in.Err(); err { case nil, io.EOF: return nil default: return err } } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/scanner_test.go000066400000000000000000000012411452676773100302570ustar00rootroot00000000000000package humanlog import ( "context" "strings" "testing" "github.com/humanlogio/humanlog/internal/pkg/model" "github.com/humanlogio/humanlog/internal/pkg/sink/bufsink" "github.com/stretchr/testify/require" ) func TestScannerLongLine(t *testing.T) { data := `{"msg":"` + strings.Repeat("a", 1023*1024) + `"}` ctx := context.Background() src := strings.NewReader(data) want := []model.Event{ {Raw: []byte(data), Structured: &model.Structured{Msg: strings.Repeat("a", 1023*1024)}}, } sink := bufsink.NewSizedBufferedSink(100, nil) err := Scan(ctx, src, sink, DefaultOptions()) require.NoError(t, err, "got %#v", err) require.Equal(t, want, sink.Buffered) } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/script/000077500000000000000000000000001452676773100265465ustar00rootroot00000000000000create_version_artifacts.sh000077500000000000000000000045701452676773100341040ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/script#!/usr/bin/env bash set -euo pipefail root=$(git rev-parse --show-toplevel) function list_archives() { jq < dist/artifacts.json -r '.[] | select(.type == "Archive") | .name, .path, .goos, .goarch' } function handle_archive() { while read -r filename; read -r path; read -r goos; read -r goarch; do local url=$(get_archive_url ${filename}) if [ -z "${url}" ]; then echo "no archive for ${filename}"; continue; fi local sig=$(get_signature ${path}) apictl create version-artifact \ --project ${project} \ --major $(get_version_major) \ --minor $(get_version_minor) \ --patch $(get_version_patch) \ --sha256 $(get_sha256sum ${path}) \ --url ${url} \ --os ${goos} \ --arch ${goarch} \ --sig ${sig} done } function get_archive_url() { local filename=${1} gh api graphql -F owner=${owner} -F name=${project} -F tag="v${tag}" -F filename=${filename} -f query=' query($name: String!, $owner: String!, $tag: String!, $filename: String!) { repository(name: $name, owner: $owner) { release(tagName: $tag) { releaseAssets(first: 1, name: $filename) { nodes { downloadUrl } } } } }' --jq '.data.repository.release.releaseAssets.nodes[0].downloadUrl' } function get_sha256sum() { local filename=${1} shasum -a 256 ${filename} | cut -d " " -f 1 } function get_signature() { local filename=${1} cat ${filename}.sig } function get_version_major() { major=`echo ${tag} | cut -d. -f1` echo "${major}" } function get_version_minor() { minor=`echo ${tag} | cut -d. -f2` echo "${minor}" } function get_version_patch() { patch=`echo ${tag} | cut -d. -f3` echo "${patch}" } function get_version() { jq < dist/metadata.json -r '.version' } function get_project_name() { jq < dist/metadata.json -r '.project_name' } function main() { owner=humanlogio project=$(get_project_name) tag=$(get_version) list_archives | handle_archive apictl create published-version \ --project ${project} \ --channel latest \ --version $(get_version) } main golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/000077500000000000000000000000001452676773100262215ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/000077500000000000000000000000001452676773100273175ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00001-json/000077500000000000000000000000001452676773100307265ustar00rootroot00000000000000config.json000066400000000000000000000007631452676773100330150ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00001-json{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000136501452676773100317360ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00001-json{"data":{"short":"service-startup","message":"The login-api service is running on port 8085."},"datacontenttype":"application/json","id":"01FCV6S4M6S8H3VKAQD9SWFWFP","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:50.246861-05:00","type":"simple-log"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6S9YK70GJ5Q6YT0PYKQDA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6S9YJXD2SYG3HTGWXHX0G","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:55.699075-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SDKRW3XZDA1FAGZ3QVSH","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SDKRHB1RR1Q87Q1SKT5P","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:59.448566-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SE597EY6RJ762V59PZQA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SE596ZMASA1D79M16KVV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.009615-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SEKCC9RG364AJ60J75KW","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SEKCNSQJJ2NDEPQ2TGMP","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.46025-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SF3DXGB8G1DVX19KQZYT","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SF3DJZSXTT1RNR6F1QAV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.973455-05:00","type":"incoming_http_request"} {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SKY9MM7D795258XPQGC9","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SKY9M1D725HTV0ZXKF1V","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:05.929423-05:00","type":"incoming_http_request"} {"data":{"event":"Shutdown"},"datacontenttype":"application/json","id":"01FCV6SR6JZH7JZ6RFDFN9Q99Y","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:10.290034-05:00","type":"service-shutdown"} {"time":"2021-08-11T13:15:10.290034-05:00","message":"hello"} {"time":"2021-08-11T13:15:10.290034-05:00","msg":"hello"} {"ts":"2021-08-11T13:15:10.290034-05:00","msg":"hello"} {"timestamp":"2021-08-11T13:15:10.290034-05:00","msg":"hello"} {"@timestamp":"2021-08-11T13:15:10.290034-05:00","msg":"hello"} {"level":"fatal"} {"lvl":"fatal"} {"loglevel":"fatal"} {"severity":"fatal"} {"level":"fatal"} {"level":"debug"} {"level":"info"} {"level":"warn"} {"level":"warning"} {"level":"error"} {"level":"panic"} {"level":"some unknown level"}want000066400000000000000000000040721452676773100315460ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00001-jsonAug 11 13:14:50 || specversion="1.0" type="simple-log" invloglevel="Info" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data=map[message:The login-api service is running on port 8085. short:service-startup] Aug 11 13:14:55 || invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G" data=map[message:incoming HTTP request was served short:http access] Aug 11 13:14:59 || id="01FCV6SDKRW3XZDA1FAGZ3QVSH" invapptracingrequestid="01FCV6SDKRHB1RR1Q87Q1SKT5P" Aug 11 13:15:00 || id="01FCV6SE597EY6RJ762V59PZQA" invapptracingrequestid="01FCV6SE596ZMASA1D79M16KVV" Aug 11 13:15:00 || id="01FCV6SEKCC9RG364AJ60J75KW" invapptracingrequestid="01FCV6SEKCNSQJJ2NDEPQ2TGMP" Aug 11 13:15:00 || id="01FCV6SF3DXGB8G1DVX19KQZYT" invapptracingrequestid="01FCV6SF3DJZSXTT1RNR6F1QAV" Aug 11 13:15:05 || id="01FCV6SKY9MM7D795258XPQGC9" invapptracingrequestid="01FCV6SKY9M1D725HTV0ZXKF1V" Aug 11 13:15:10 || type="service-shutdown" data=map[event:Shutdown] id="01FCV6SR6JZH7JZ6RFDFN9Q99Y" Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |DEBU| Jan 1 00:00:00 |INFO| Jan 1 00:00:00 |WARN| Jan 1 00:00:00 |WARN| Jan 1 00:00:00 |ERRO| Jan 1 00:00:00 |PANI| Jan 1 00:00:00 |SOME| golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00002-logfmt/000077500000000000000000000000001452676773100312465ustar00rootroot00000000000000config.json000066400000000000000000000006731452676773100333350ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00002-logfmt{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000012611452676773100322510ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00002-logfmtmsg="i like turtle" key=value1 key=value1 msg="i like turtle" key2=42 key=value2 msg="i like turtle" key2=43 time="2022/09/11 16:31:21" do_all_electric_sheeps="dream" time="2022/09/11 16:31:21.198136" do_all_electric_sheeps="dream" time="2021-08-11T13:15:10.290034-05:00" message="hello" time="2021-08-11T13:15:10.290034-05:00" msg="hello" ts="2021-08-11T13:15:10.290034-05:00" msg="hello" timestamp="2021-08-11T13:15:10.290034-05:00" msg="hello" @timestamp="2021-08-11T13:15:10.290034-05:00" msg="hello" level="fatal" lvl="fatal" loglevel="fatal" severity="fatal" level="fatal" level="debug" level="info" level="warn" level="warning" level="error" level="panic" level="some unknown level"want000066400000000000000000000013551452676773100320670ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00002-logfmtJan 1 00:00:00 || i like turtle key=value1 Jan 1 00:00:00 || i like turtle key2=42 Jan 1 00:00:00 || i like turtle key2=43 key=value2 Sep 11 16:31:21 || do_all_electric_sheeps=dream Sep 11 16:31:21 || Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Aug 11 13:15:10 || hello Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |FATA| Jan 1 00:00:00 |DEBU| Jan 1 00:00:00 |INFO| Jan 1 00:00:00 |WARN| Jan 1 00:00:00 |WARN| Jan 1 00:00:00 |ERRO| Jan 1 00:00:00 |PANI| Jan 1 00:00:00 |SOME| golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00003-zap/000077500000000000000000000000001452676773100305515ustar00rootroot00000000000000config.json000066400000000000000000000006731452676773100326400ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00003-zap{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000016211452676773100315540ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00003-zap2021-02-05T12:41:48.053-0700 DEBUG zapper/zapper.go:18 some message 1 {"rand_index": 1} 2021-02-05T12:41:49.059-0700 ERROR zapper/zapper.go:18 some message 2 {"rand_index": 3} 2021-02-05T15:45:04.425-0700 FATAL zapper/zapper.go:18 some message 5 {"rand_index": 11} 2021-02-05T12:41:50.064-0700 INFO zapper/zapper.go:18 some message 3 {"rand_index": 5} 2021-02-05T12:41:51.069-0700 WARN zapper/zapper.go:18 some message 4 {"rand_index": 7} 2021-02-06T22:55:22.004Z DEBUG zapper/zapper.go:17 some message 1 {"rand_index": 1} 2021-02-06T22:55:22.008Z ERROR zapper/zapper.go:17 some message 2 {"rand_index": 2} 2021-02-06T22:55:22.009Z FATAL zapper/zapper.go:17 some message 5 {"rand_index": 1} 2021-02-06T22:55:22.009Z INFO zapper/zapper.go:17 some message 3 {"rand_index": 2} 2021-02-06T22:55:22.009Z WARN zapper/zapper.go:17 some message 4 {"rand_index": 4}want000066400000000000000000000014511452676773100313670ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00003-zapFeb 5 12:41:48 |DEBU| some message 1 rand_index=1 caller=zapper/zapper.go:18 Feb 5 12:41:49 |ERRO| some message 2 rand_index=3 caller=zapper/zapper.go:18 Feb 5 15:45:04 |FATA| some message 5 rand_index=11 caller=zapper/zapper.go:18 Feb 5 12:41:50 |INFO| some message 3 rand_index=5 caller=zapper/zapper.go:18 Feb 5 12:41:51 |WARN| some message 4 rand_index=7 caller=zapper/zapper.go:18 2021-02-06T22:55:22.004Z DEBUG zapper/zapper.go:17 some message 1 {"rand_index": 1} 2021-02-06T22:55:22.008Z ERROR zapper/zapper.go:17 some message 2 {"rand_index": 2} 2021-02-06T22:55:22.009Z FATAL zapper/zapper.go:17 some message 5 {"rand_index": 1} 2021-02-06T22:55:22.009Z INFO zapper/zapper.go:17 some message 3 {"rand_index": 2} 2021-02-06T22:55:22.009Z WARN zapper/zapper.go:17 some message 4 {"rand_index": 4} golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00004-mixed/000077500000000000000000000000001452676773100310665ustar00rootroot00000000000000config.json000066400000000000000000000006731452676773100331550ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00004-mixed{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000013571452676773100320770ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00004-mixedtime=2022-08-10T03:03:24.259999353Z level=INFO msg="Started Worker" Namespace=runtime TaskQueue=runtimed time=2022-08-10T03:05:19.289159884Z level=ERROR msg="processing job" error="worker error from receive: twirp error internal: failed to do request: Post \"http://localhost:18081/twirp/aqueduct.api.v1.JobQueueService/Receive\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)" time=2022-08-10T03:06:20.422461071Z level=DEBUG msg="inbound request" twirp_svc=ManagementsAPI twirp_method=GetEnableStatus twirp_req=*managements.GetEnableStatusRequest {"level":"info","ts":"2022-08-10T03:03:18.312Z","msg":"temporal-sys-tq-scanner-workflow workflow successfully started","service":"worker","logging-call-at":"scanner.go:202"} want000066400000000000000000000011511452676773100317010ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00004-mixedAug 10 03:03:24 |INFO| Started Worker Namespace=runtime TaskQueue=runtimed Aug 10 03:05:19 |ERRO| processing job error=worker error from receive: twirp error internal: failed to do request: Post "http://localhost:18081/twirp/aqueduct.api.v1.JobQueueService/Receive": context deadline exceeded (Client.Timeout exceeded while awaiting headers) Aug 10 03:06:20 |DEBU| inbound request twirp_svc=ManagementsAPI twirp_method=GetEnableStatus twirp_req=*managements.GetEnableStatusRequest Aug 10 03:03:18 |INFO| temporal-sys-tq-scanner-workflow workflow successfully started service="worker" logging-call-at="scanner.go:202" golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00005-otel/000077500000000000000000000000001452676773100307245ustar00rootroot00000000000000config.json000066400000000000000000000003331452676773100330040ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00005-otel{ "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000037521452676773100317360ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00005-otelTimestamp=2023-01-24T10:37:28.767905777Z SeverityText=INFO Body="starting consumerLoop..." deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry Timestamp=2023-01-24T10:37:29.3307514Z SeverityText=INFO Body="starting pooling" deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry Timestamp=2023-01-24T10:37:29.330831204Z SeverityText=INFO Body="looking for unassigned owner resource count" deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry pool_size=0 Timestamp=2023-01-24T10:37:29.330854306Z SeverityText=INFO Body="looking for unassigned owner resource count" deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry pool_size=0 Timestamp=2023-01-24T10:37:29.330985113Z SeverityText=INFO Body="server starting" deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry server.addr=[::]:2206 Timestamp=2023-01-24T10:37:29.332562199Z SeverityText=INFO Body="pool is full, nothing to do" deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry pool_size=0 Timestamp=2023-01-24T10:37:29.332597001Z SeverityText=INFO Body="pool is full, nothing to do" deployment.environment=development sdk.name=sdk-telemetry sdk.version=1.24.0 service.instance.id=cf7r9p8j3ee3onr3dsk0 service.name=unknown_service:acme telemetry.sdk.name=opentelemetry pool_size=0want000066400000000000000000000011251452676773100315400ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/00005-otelJan 24 10:37:28 |INFO| starting consumerLoop... sdk.version=1.24.0 sdk.name=sdk-telemetry telemetry.sdk.name=opentelemetry service.name=unknown_service:acme deployment.environment=development service.instance.id=cf7r9p8j3ee3onr3dsk0 Jan 24 10:37:29 |INFO| starting pooling Jan 24 10:37:29 |INFO| looking for unassigned owner resource count pool_size=0 Jan 24 10:37:29 |INFO| looking for unassigned owner resource count Jan 24 10:37:29 |INFO| server starting server.addr=[::]:2206 Jan 24 10:37:29 |INFO| pool is full, nothing to do pool_size=0 Jan 24 10:37:29 |INFO| pool is full, nothing to do 10000-behavior-base/000077500000000000000000000000001452676773100324055ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/casesconfig.json000066400000000000000000000006731452676773100345530ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/10000-behavior-base{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000001741452676773100334710ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/10000-behavior-base{"k2":"lonnnnnnnnnnnnnnnnnnng","k1":"short"} {"repeated":"first time"} {"repeated":"first time"} {"repeated":"second time"} want000066400000000000000000000003051452676773100332770ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/10000-behavior-baseJan 1 00:00:00 || k1="short" k2="lonnnnnnnnnnnnnnnnnnng" Jan 1 00:00:00 || repeated="first time" Jan 1 00:00:00 || Jan 1 00:00:00 || repeated="second time" 10001-behavior-truncates/000077500000000000000000000000001452676773100335045ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/casesconfig.json000066400000000000000000000006721452676773100356510ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/10001-behavior-truncates{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": true, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000002771452676773100345740ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/10001-behavior-truncates{"k2":"lonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnng","k1":"short"} {"repeated":"first time"} {"repeated":"first time"} {"repeated":"second time"} want000066400000000000000000000002771452676773100344060ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/10001-behavior-truncatesJan 1 00:00:00 || k1="short" k2="lonnnnnnnnnnnn... Jan 1 00:00:00 || repeated="first time" Jan 1 00:00:00 || Jan 1 00:00:00 || repeated="second time" 20001-strip-docker-compose/000077500000000000000000000000001452676773100337515ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/casesconfig.json000066400000000000000000000006731452676773100361170ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/20001-strip-docker-compose{ "skip": null, "keep": null, "time-fields": [ "time", "ts", "@timestamp", "timestamp" ], "message-fields": [ "message", "msg" ], "level-fields": [ "level", "lvl", "loglevel", "severity" ], "sort-longest": true, "skip-unchanged": true, "truncates": false, "light-bg": false, "color-mode": "off", "truncate-length": 15, "time-format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000127201452676773100350350ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/20001-strip-docker-composeweb_1 | {"data":{"short":"service-startup","message":"The login-api service is running on port 8085."},"datacontenttype":"application/json","id":"01FCV6S4M6S8H3VKAQD9SWFWFP","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:50.246861-05:00","type":"simple-log"} web_1 | {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6S9YK70GJ5Q6YT0PYKQDA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6S9YJXD2SYG3HTGWXHX0G","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:55.699075-05:00","type":"incoming_http_request"} web_1 | {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SDKRW3XZDA1FAGZ3QVSH","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SDKRHB1RR1Q87Q1SKT5P","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:59.448566-05:00","type":"incoming_http_request"} web_1 | {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SE597EY6RJ762V59PZQA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SE596ZMASA1D79M16KVV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.009615-05:00","type":"incoming_http_request"} web_1 | {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SEKCC9RG364AJ60J75KW","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SEKCNSQJJ2NDEPQ2TGMP","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.46025-05:00","type":"incoming_http_request"} web_1 | {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SF3DXGB8G1DVX19KQZYT","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SF3DJZSXTT1RNR6F1QAV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.973455-05:00","type":"incoming_http_request"} web_1 | {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SKY9MM7D795258XPQGC9","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SKY9M1D725HTV0ZXKF1V","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:05.929423-05:00","type":"incoming_http_request"} web_1 | {"data":{"event":"Shutdown"},"datacontenttype":"application/json","id":"01FCV6SR6JZH7JZ6RFDFN9Q99Y","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:10.290034-05:00","type":"service-shutdown"}want000066400000000000000000000030721452676773100346470ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/20001-strip-docker-composeAug 11 13:14:50 || service=web_1 specversion="1.0" type="simple-log" invloglevel="Info" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data=map[message:The login-api service is running on port 8085. short:service-startup] Aug 11 13:14:55 || invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G" data=map[message:incoming HTTP request was served short:http access] Aug 11 13:14:59 || id="01FCV6SDKRW3XZDA1FAGZ3QVSH" invapptracingrequestid="01FCV6SDKRHB1RR1Q87Q1SKT5P" Aug 11 13:15:00 || id="01FCV6SE597EY6RJ762V59PZQA" invapptracingrequestid="01FCV6SE596ZMASA1D79M16KVV" Aug 11 13:15:00 || id="01FCV6SEKCC9RG364AJ60J75KW" invapptracingrequestid="01FCV6SEKCNSQJJ2NDEPQ2TGMP" Aug 11 13:15:00 || id="01FCV6SF3DXGB8G1DVX19KQZYT" invapptracingrequestid="01FCV6SF3DJZSXTT1RNR6F1QAV" Aug 11 13:15:05 || id="01FCV6SKY9MM7D795258XPQGC9" invapptracingrequestid="01FCV6SKY9M1D725HTV0ZXKF1V" Aug 11 13:15:10 || type="service-shutdown" data=map[event:Shutdown] id="01FCV6SR6JZH7JZ6RFDFN9Q99Y" 20001-strip-syslog/000077500000000000000000000000001452676773100323575ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/casesconfig.json000066400000000000000000000007571452676773100345300ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/20001-strip-syslog{ "skip": null, "keep": null, "time_fields": [ "time", "ts", "@timestamp", "timestamp" ], "message_fields": [ "message", "msg" ], "level_fields": [ "level", "lvl", "loglevel", "severity" ], "sort_longest": true, "skip_unchanged": true, "truncates": false, "light_bg": false, "color_mode": 2, "truncate_length": 15, "time_format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000127001452676773100334410ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/20001-strip-syslog@cee: {"data":{"short":"service-startup","message":"The login-api service is running on port 8085."},"datacontenttype":"application/json","id":"01FCV6S4M6S8H3VKAQD9SWFWFP","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:50.246861-05:00","type":"simple-log"} @cee: {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6S9YK70GJ5Q6YT0PYKQDA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6S9YJXD2SYG3HTGWXHX0G","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:55.699075-05:00","type":"incoming_http_request"} @cee: {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SDKRW3XZDA1FAGZ3QVSH","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SDKRHB1RR1Q87Q1SKT5P","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:14:59.448566-05:00","type":"incoming_http_request"} @cee: {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SE597EY6RJ762V59PZQA","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SE596ZMASA1D79M16KVV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.009615-05:00","type":"incoming_http_request"} @cee: {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SEKCC9RG364AJ60J75KW","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SEKCNSQJJ2NDEPQ2TGMP","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.46025-05:00","type":"incoming_http_request"} @cee: {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SF3DXGB8G1DVX19KQZYT","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SF3DJZSXTT1RNR6F1QAV","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:00.973455-05:00","type":"incoming_http_request"} @cee: {"data":{"short":"http access","message":"incoming HTTP request was served"},"datacontenttype":"application/json","id":"01FCV6SKY9MM7D795258XPQGC9","invapptracingcallingservice":"unset","invapptracingrequestid":"01FCV6SKY9M1D725HTV0ZXKF1V","invapptracingtequestsource":"unset","invloglevel":"Info","invwebbytes":0,"invwebbytesin":0,"invwebbytesout":0,"invwebcached":false,"invwebdesthost":"","invwebdestip":"::ffff:0.0.0.0","invwebduration":0,"invwebhttpcontenttype":"","invwebhttpmethod":"","invwebhttpuseragent":"","invwebhttpuseragentlength":0,"invwebsrcip":"::ffff:0.0.0.0","invwebstatus":0,"invweburipath":"","invweburiquery":"","invweburl":"","invweburllength":0,"source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:05.929423-05:00","type":"incoming_http_request"} @cee: {"data":{"event":"Shutdown"},"datacontenttype":"application/json","id":"01FCV6SR6JZH7JZ6RFDFN9Q99Y","invloglevel":"Info","source":"irn:libraries:github.com/InVisionApp/invlogger","specversion":"1.0","time":"2021-08-11T13:15:10.290034-05:00","type":"service-shutdown"}want000066400000000000000000000030541452676773100332550ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/20001-strip-syslogAug 11 13:14:50 || specversion="1.0" type="simple-log" invloglevel="Info" id="01FCV6S4M6S8H3VKAQD9SWFWFP" datacontenttype="application/json" source="irn:libraries:github.com/InVisionApp/invlogger" data=map[message:The login-api service is running on port 8085. short:service-startup] Aug 11 13:14:55 || invweburl="" invwebbytes=0 invwebstatus=0 invwebbytesin=0 invwebbytesout=0 invwebduration=0 invweburipath="" invwebdesthost="" invweburiquery="" invweburllength=0 invwebcached=false invwebhttpmethod="" invwebhttpuseragent="" invwebhttpcontenttype="" invwebhttpuseragentlength=0 invwebsrcip="::ffff:0.0.0.0" type="incoming_http_request" invwebdestip="::ffff:0.0.0.0" id="01FCV6S9YK70GJ5Q6YT0PYKQDA" invapptracingtequestsource="unset" invapptracingcallingservice="unset" invapptracingrequestid="01FCV6S9YJXD2SYG3HTGWXHX0G" data=map[message:incoming HTTP request was served short:http access] Aug 11 13:14:59 || id="01FCV6SDKRW3XZDA1FAGZ3QVSH" invapptracingrequestid="01FCV6SDKRHB1RR1Q87Q1SKT5P" Aug 11 13:15:00 || id="01FCV6SE597EY6RJ762V59PZQA" invapptracingrequestid="01FCV6SE596ZMASA1D79M16KVV" Aug 11 13:15:00 || id="01FCV6SEKCC9RG364AJ60J75KW" invapptracingrequestid="01FCV6SEKCNSQJJ2NDEPQ2TGMP" Aug 11 13:15:00 || id="01FCV6SF3DXGB8G1DVX19KQZYT" invapptracingrequestid="01FCV6SF3DJZSXTT1RNR6F1QAV" Aug 11 13:15:05 || id="01FCV6SKY9MM7D795258XPQGC9" invapptracingrequestid="01FCV6SKY9M1D725HTV0ZXKF1V" Aug 11 13:15:10 || type="service-shutdown" data=map[event:Shutdown] id="01FCV6SR6JZH7JZ6RFDFN9Q99Y" 90000-misc-unchanged/000077500000000000000000000000001452676773100325735ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/casesconfig.json000066400000000000000000000007571452676773100347440ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/90000-misc-unchanged{ "skip": null, "keep": null, "time_fields": [ "time", "ts", "@timestamp", "timestamp" ], "message_fields": [ "message", "msg" ], "level_fields": [ "level", "lvl", "loglevel", "severity" ], "sort_longest": true, "skip_unchanged": true, "truncates": false, "light_bg": false, "color_mode": 2, "truncate_length": 15, "time_format": "Jan _2 15:04:05", "palette": null } input000066400000000000000000000015241452676773100336570ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/90000-misc-unchanged2022/09/11 16:31:21 main.go:63: creating otel trace grpc client 2022/09/11 16:31:21 main.go:67: creating otel trace exporter 2022/09/11 16:31:21 main.go:73: creating otel trace provider 2022/09/11 16:31:21 main.go:94: connecting to mysql 2022/09/11 16:31:21 main.go:101: creating listener 2022/09/11 16:31:21 main.go:107: listening on "127.0.0.1:8080" 2022/09/11 16:31:21 main.go:122: starting service 2022/09/11 16:37:52.198136 main.go:63: creating otel trace grpc client 2022/09/11 16:37:52.198325 main.go:67: creating otel trace exporter 2022/09/11 16:37:52.198588 main.go:73: creating otel trace provider 2022/09/11 16:37:52.198726 main.go:94: connecting to mysql 2022/09/11 16:37:52.198756 main.go:101: creating listener 2022/09/11 16:37:52.198930 main.go:107: listening on "127.0.0.1:8080" 2022/09/11 16:37:52.198984 main.go:122: starting servicewant000066400000000000000000000015251452676773100334720ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/test/cases/90000-misc-unchanged2022/09/11 16:31:21 main.go:63: creating otel trace grpc client 2022/09/11 16:31:21 main.go:67: creating otel trace exporter 2022/09/11 16:31:21 main.go:73: creating otel trace provider 2022/09/11 16:31:21 main.go:94: connecting to mysql 2022/09/11 16:31:21 main.go:101: creating listener 2022/09/11 16:31:21 main.go:107: listening on "127.0.0.1:8080" 2022/09/11 16:31:21 main.go:122: starting service 2022/09/11 16:37:52.198136 main.go:63: creating otel trace grpc client 2022/09/11 16:37:52.198325 main.go:67: creating otel trace exporter 2022/09/11 16:37:52.198588 main.go:73: creating otel trace provider 2022/09/11 16:37:52.198726 main.go:94: connecting to mysql 2022/09/11 16:37:52.198756 main.go:101: creating listener 2022/09/11 16:37:52.198930 main.go:107: listening on "127.0.0.1:8080" 2022/09/11 16:37:52.198984 main.go:122: starting service golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/time_parse.go000066400000000000000000000025171452676773100277260ustar00rootroot00000000000000package humanlog import ( "time" ) var formats = []string{ "2006-01-02 15:04:05.999999999 -0700 MST", "2006-01-02 15:04:05", "2006-01-02T15:04:05-0700", time.RFC3339, time.RFC3339Nano, time.RFC822, time.RFC822Z, time.RFC850, time.RFC1123, time.RFC1123Z, time.UnixDate, time.RubyDate, time.ANSIC, time.Kitchen, time.Stamp, time.StampMilli, time.StampMicro, time.StampNano, "2006/01/02 15:04:05", "2006/01/02 15:04:05.999999999", } func parseTimeFloat64(value float64) time.Time { v := int64(value) switch { case v > 1e18: case v > 1e15: v *= 1e3 case v > 1e12: v *= 1e6 default: return time.Unix(v, 0) } return time.Unix(v/1e9, v%1e9) } // tries to parse time using a couple of formats before giving up func tryParseTime(value interface{}) (time.Time, bool) { var t time.Time var err error switch value.(type) { case string: for _, layout := range formats { t, err = time.Parse(layout, value.(string)) if err == nil { return t, true } } case float32: return parseTimeFloat64(float64(value.(float32))), true case float64: return parseTimeFloat64(value.(float64)), true case int: return parseTimeFloat64(float64(value.(int))), true case int32: return parseTimeFloat64(float64(value.(int32))), true case int64: return parseTimeFloat64(float64(value.(int64))), true } return t, false } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/time_parse_test.go000066400000000000000000000015011452676773100307550ustar00rootroot00000000000000package humanlog import ( "testing" ) func TestTimeParseFloat64(t *testing.T) { t.Run("nanoseconds", func(t *testing.T) { golden := float64(1540369190466951764) tm := parseTimeFloat64(golden) if int64(golden) != tm.UnixNano() { t.Fatal(tm.UnixNano()) } }) t.Run("microseconds", func(t *testing.T) { golden := float64(1540369190466951) tm := parseTimeFloat64(golden) if int64(golden)*1e3 != tm.UnixNano() { t.Fatal(tm.UnixNano()) } }) t.Run("milliseconds", func(t *testing.T) { golden := float64(1540369190466) tm := parseTimeFloat64(golden) if int64(golden)*1e6 != tm.UnixNano() { t.Fatal(tm.UnixNano()) } }) t.Run("seconds", func(t *testing.T) { golden := float64(1540369190) tm := parseTimeFloat64(golden) if int64(golden)*1e9 != tm.UnixNano() { t.Fatal(tm.UnixNano()) } }) } golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/000077500000000000000000000000001452676773100265375ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/000077500000000000000000000000001452676773100305765ustar00rootroot00000000000000humanlogio/000077500000000000000000000000001452676773100326615ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.comapi/000077500000000000000000000000001452676773100334325ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogiogo/000077500000000000000000000000001452676773100340375ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/apisvc/000077500000000000000000000000001452676773100346325ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/gocliupdate/000077500000000000000000000000001452676773100366045ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/svcv1/000077500000000000000000000000001452676773100371325ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/svc/cliupdatecliupdatev1connect/000077500000000000000000000000001452676773100427255ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/svc/cliupdate/v1service.connect.go000066400000000000000000000075421452676773100463540ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/svc/cliupdate/v1/cliupdatev1connect// Code generated by protoc-gen-connect-go. DO NOT EDIT. // // Source: svc/cliupdate/v1/service.proto package cliupdatev1connect import ( context "context" errors "errors" connect_go "github.com/bufbuild/connect-go" v1 "github.com/humanlogio/api/go/svc/cliupdate/v1" http "net/http" strings "strings" ) // This is a compile-time assertion to ensure that this generated file and the connect package are // compatible. If you get a compiler error that this constant is not defined, this code was // generated with a version of connect newer than the one compiled into your binary. You can fix the // problem by either regenerating this code with an older version of connect or updating the connect // version compiled into your binary. const _ = connect_go.IsAtLeastVersion0_1_0 const ( // UpdateServiceName is the fully-qualified name of the UpdateService service. UpdateServiceName = "svc.cliupdate.v1.UpdateService" ) // UpdateServiceClient is a client for the svc.cliupdate.v1.UpdateService service. type UpdateServiceClient interface { GetNextUpdate(context.Context, *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) } // NewUpdateServiceClient constructs a client for the svc.cliupdate.v1.UpdateService service. By // default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, // and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the // connect.WithGRPC() or connect.WithGRPCWeb() options. // // The URL supplied here should be the base URL for the Connect or gRPC server (for example, // http://api.acme.com or https://acme.com/grpc). func NewUpdateServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) UpdateServiceClient { baseURL = strings.TrimRight(baseURL, "/") return &updateServiceClient{ getNextUpdate: connect_go.NewClient[v1.GetNextUpdateRequest, v1.GetNextUpdateResponse]( httpClient, baseURL+"/svc.cliupdate.v1.UpdateService/GetNextUpdate", opts..., ), } } // updateServiceClient implements UpdateServiceClient. type updateServiceClient struct { getNextUpdate *connect_go.Client[v1.GetNextUpdateRequest, v1.GetNextUpdateResponse] } // GetNextUpdate calls svc.cliupdate.v1.UpdateService.GetNextUpdate. func (c *updateServiceClient) GetNextUpdate(ctx context.Context, req *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) { return c.getNextUpdate.CallUnary(ctx, req) } // UpdateServiceHandler is an implementation of the svc.cliupdate.v1.UpdateService service. type UpdateServiceHandler interface { GetNextUpdate(context.Context, *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) } // NewUpdateServiceHandler builds an HTTP handler from the service implementation. It returns the // path on which to mount the handler and the handler itself. // // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewUpdateServiceHandler(svc UpdateServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { mux := http.NewServeMux() mux.Handle("/svc.cliupdate.v1.UpdateService/GetNextUpdate", connect_go.NewUnaryHandler( "/svc.cliupdate.v1.UpdateService/GetNextUpdate", svc.GetNextUpdate, opts..., )) return "/svc.cliupdate.v1.UpdateService/", mux } // UnimplementedUpdateServiceHandler returns CodeUnimplemented from all methods. type UnimplementedUpdateServiceHandler struct{} func (UnimplementedUpdateServiceHandler) GetNextUpdate(context.Context, *connect_go.Request[v1.GetNextUpdateRequest]) (*connect_go.Response[v1.GetNextUpdateResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("svc.cliupdate.v1.UpdateService.GetNextUpdate is not implemented")) } service.pb.go000066400000000000000000000331021452676773100415200ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/svc/cliupdate/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: svc/cliupdate/v1/service.proto package cliupdatev1 import ( v1 "github.com/humanlogio/api/go/types/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type GetNextUpdateRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields ProjectName string `protobuf:"bytes,1,opt,name=project_name,json=projectName,proto3" json:"project_name,omitempty"` CurrentVersion *v1.Version `protobuf:"bytes,2,opt,name=current_version,json=currentVersion,proto3" json:"current_version,omitempty"` MachineArchitecture string `protobuf:"bytes,3,opt,name=machine_architecture,json=machineArchitecture,proto3" json:"machine_architecture,omitempty"` MachineOperatingSystem string `protobuf:"bytes,4,opt,name=machine_operating_system,json=machineOperatingSystem,proto3" json:"machine_operating_system,omitempty"` Meta *v1.ReqMeta `protobuf:"bytes,1000,opt,name=meta,proto3" json:"meta,omitempty"` } func (x *GetNextUpdateRequest) Reset() { *x = GetNextUpdateRequest{} if protoimpl.UnsafeEnabled { mi := &file_svc_cliupdate_v1_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetNextUpdateRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetNextUpdateRequest) ProtoMessage() {} func (x *GetNextUpdateRequest) ProtoReflect() protoreflect.Message { mi := &file_svc_cliupdate_v1_service_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GetNextUpdateRequest.ProtoReflect.Descriptor instead. func (*GetNextUpdateRequest) Descriptor() ([]byte, []int) { return file_svc_cliupdate_v1_service_proto_rawDescGZIP(), []int{0} } func (x *GetNextUpdateRequest) GetProjectName() string { if x != nil { return x.ProjectName } return "" } func (x *GetNextUpdateRequest) GetCurrentVersion() *v1.Version { if x != nil { return x.CurrentVersion } return nil } func (x *GetNextUpdateRequest) GetMachineArchitecture() string { if x != nil { return x.MachineArchitecture } return "" } func (x *GetNextUpdateRequest) GetMachineOperatingSystem() string { if x != nil { return x.MachineOperatingSystem } return "" } func (x *GetNextUpdateRequest) GetMeta() *v1.ReqMeta { if x != nil { return x.Meta } return nil } type GetNextUpdateResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields NextVersion *v1.Version `protobuf:"bytes,1,opt,name=next_version,json=nextVersion,proto3" json:"next_version,omitempty"` NextArtifact *v1.VersionArtifact `protobuf:"bytes,2,opt,name=next_artifact,json=nextArtifact,proto3" json:"next_artifact,omitempty"` Meta *v1.ResMeta `protobuf:"bytes,1000,opt,name=meta,proto3" json:"meta,omitempty"` } func (x *GetNextUpdateResponse) Reset() { *x = GetNextUpdateResponse{} if protoimpl.UnsafeEnabled { mi := &file_svc_cliupdate_v1_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *GetNextUpdateResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*GetNextUpdateResponse) ProtoMessage() {} func (x *GetNextUpdateResponse) ProtoReflect() protoreflect.Message { mi := &file_svc_cliupdate_v1_service_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use GetNextUpdateResponse.ProtoReflect.Descriptor instead. func (*GetNextUpdateResponse) Descriptor() ([]byte, []int) { return file_svc_cliupdate_v1_service_proto_rawDescGZIP(), []int{1} } func (x *GetNextUpdateResponse) GetNextVersion() *v1.Version { if x != nil { return x.NextVersion } return nil } func (x *GetNextUpdateResponse) GetNextArtifact() *v1.VersionArtifact { if x != nil { return x.NextArtifact } return nil } func (x *GetNextUpdateResponse) GetMeta() *v1.ResMeta { if x != nil { return x.Meta } return nil } var File_svc_cliupdate_v1_service_proto protoreflect.FileDescriptor var file_svc_cliupdate_v1_service_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x73, 0x76, 0x63, 0x2f, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x73, 0x76, 0x63, 0x2e, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x41, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0xb5, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0c, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x52, 0x0c, 0x6e, 0x65, 0x78, 0x74, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x32, 0x73, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x26, 0x2e, 0x73, 0x76, 0x63, 0x2e, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x76, 0x63, 0x2e, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xc1, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x76, 0x63, 0x2e, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x76, 0x63, 0x2f, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x43, 0x58, 0xaa, 0x02, 0x10, 0x53, 0x76, 0x63, 0x2e, 0x43, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x53, 0x76, 0x63, 0x5c, 0x43, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x53, 0x76, 0x63, 0x5c, 0x43, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x53, 0x76, 0x63, 0x3a, 0x3a, 0x43, 0x6c, 0x69, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_svc_cliupdate_v1_service_proto_rawDescOnce sync.Once file_svc_cliupdate_v1_service_proto_rawDescData = file_svc_cliupdate_v1_service_proto_rawDesc ) func file_svc_cliupdate_v1_service_proto_rawDescGZIP() []byte { file_svc_cliupdate_v1_service_proto_rawDescOnce.Do(func() { file_svc_cliupdate_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_svc_cliupdate_v1_service_proto_rawDescData) }) return file_svc_cliupdate_v1_service_proto_rawDescData } var file_svc_cliupdate_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_svc_cliupdate_v1_service_proto_goTypes = []interface{}{ (*GetNextUpdateRequest)(nil), // 0: svc.cliupdate.v1.GetNextUpdateRequest (*GetNextUpdateResponse)(nil), // 1: svc.cliupdate.v1.GetNextUpdateResponse (*v1.Version)(nil), // 2: types.v1.Version (*v1.ReqMeta)(nil), // 3: types.v1.ReqMeta (*v1.VersionArtifact)(nil), // 4: types.v1.VersionArtifact (*v1.ResMeta)(nil), // 5: types.v1.ResMeta } var file_svc_cliupdate_v1_service_proto_depIdxs = []int32{ 2, // 0: svc.cliupdate.v1.GetNextUpdateRequest.current_version:type_name -> types.v1.Version 3, // 1: svc.cliupdate.v1.GetNextUpdateRequest.meta:type_name -> types.v1.ReqMeta 2, // 2: svc.cliupdate.v1.GetNextUpdateResponse.next_version:type_name -> types.v1.Version 4, // 3: svc.cliupdate.v1.GetNextUpdateResponse.next_artifact:type_name -> types.v1.VersionArtifact 5, // 4: svc.cliupdate.v1.GetNextUpdateResponse.meta:type_name -> types.v1.ResMeta 0, // 5: svc.cliupdate.v1.UpdateService.GetNextUpdate:input_type -> svc.cliupdate.v1.GetNextUpdateRequest 1, // 6: svc.cliupdate.v1.UpdateService.GetNextUpdate:output_type -> svc.cliupdate.v1.GetNextUpdateResponse 6, // [6:7] is the sub-list for method output_type 5, // [5:6] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name } func init() { file_svc_cliupdate_v1_service_proto_init() } func file_svc_cliupdate_v1_service_proto_init() { if File_svc_cliupdate_v1_service_proto != nil { return } if !protoimpl.UnsafeEnabled { file_svc_cliupdate_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetNextUpdateRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_svc_cliupdate_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetNextUpdateResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_svc_cliupdate_v1_service_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, GoTypes: file_svc_cliupdate_v1_service_proto_goTypes, DependencyIndexes: file_svc_cliupdate_v1_service_proto_depIdxs, MessageInfos: file_svc_cliupdate_v1_service_proto_msgTypes, }.Build() File_svc_cliupdate_v1_service_proto = out.File file_svc_cliupdate_v1_service_proto_rawDesc = nil file_svc_cliupdate_v1_service_proto_goTypes = nil file_svc_cliupdate_v1_service_proto_depIdxs = nil } types/000077500000000000000000000000001452676773100352035ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/gov1/000077500000000000000000000000001452676773100355315ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/typesaccount.pb.go000066400000000000000000000123361452676773100401210ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/account.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Account struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_account_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Account) String() string { return protoimpl.X.MessageStringOf(x) } func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { mi := &file_types_v1_account_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { return file_types_v1_account_proto_rawDescGZIP(), []int{0} } func (x *Account) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *Account) GetName() string { if x != nil { return x.Name } return "" } var File_types_v1_account_proto protoreflect.FileDescriptor var file_types_v1_account_proto_rawDesc = []byte{ 0x0a, 0x16, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x2d, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x8c, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_account_proto_rawDescOnce sync.Once file_types_v1_account_proto_rawDescData = file_types_v1_account_proto_rawDesc ) func file_types_v1_account_proto_rawDescGZIP() []byte { file_types_v1_account_proto_rawDescOnce.Do(func() { file_types_v1_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_account_proto_rawDescData) }) return file_types_v1_account_proto_rawDescData } var file_types_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_v1_account_proto_goTypes = []interface{}{ (*Account)(nil), // 0: types.v1.Account } var file_types_v1_account_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_account_proto_init() } func file_types_v1_account_proto_init() { if File_types_v1_account_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_account_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_account_proto_goTypes, DependencyIndexes: file_types_v1_account_proto_depIdxs, MessageInfos: file_types_v1_account_proto_msgTypes, }.Build() File_types_v1_account_proto = out.File file_types_v1_account_proto_rawDesc = nil file_types_v1_account_proto_goTypes = nil file_types_v1_account_proto_depIdxs = nil } cursor.pb.go000066400000000000000000000117141452676773100400010ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/cursor.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Cursor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Opaque []byte `protobuf:"bytes,1,opt,name=opaque,proto3" json:"opaque,omitempty"` } func (x *Cursor) Reset() { *x = Cursor{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_cursor_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Cursor) String() string { return protoimpl.X.MessageStringOf(x) } func (*Cursor) ProtoMessage() {} func (x *Cursor) ProtoReflect() protoreflect.Message { mi := &file_types_v1_cursor_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Cursor.ProtoReflect.Descriptor instead. func (*Cursor) Descriptor() ([]byte, []int) { return file_types_v1_cursor_proto_rawDescGZIP(), []int{0} } func (x *Cursor) GetOpaque() []byte { if x != nil { return x.Opaque } return nil } var File_types_v1_cursor_proto protoreflect.FileDescriptor var file_types_v1_cursor_proto_rawDesc = []byte{ 0x0a, 0x15, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x20, 0x0a, 0x06, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x42, 0x8b, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_cursor_proto_rawDescOnce sync.Once file_types_v1_cursor_proto_rawDescData = file_types_v1_cursor_proto_rawDesc ) func file_types_v1_cursor_proto_rawDescGZIP() []byte { file_types_v1_cursor_proto_rawDescOnce.Do(func() { file_types_v1_cursor_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_cursor_proto_rawDescData) }) return file_types_v1_cursor_proto_rawDescData } var file_types_v1_cursor_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_v1_cursor_proto_goTypes = []interface{}{ (*Cursor)(nil), // 0: types.v1.Cursor } var file_types_v1_cursor_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_cursor_proto_init() } func file_types_v1_cursor_proto_init() { if File_types_v1_cursor_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_cursor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Cursor); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_cursor_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_cursor_proto_goTypes, DependencyIndexes: file_types_v1_cursor_proto_depIdxs, MessageInfos: file_types_v1_cursor_proto_msgTypes, }.Build() File_types_v1_cursor_proto = out.File file_types_v1_cursor_proto_rawDesc = nil file_types_v1_cursor_proto_goTypes = nil file_types_v1_cursor_proto_depIdxs = nil } machine.pb.go000066400000000000000000000142201452676773100400630ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/machine.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Machine struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` OperatingSystem string `protobuf:"bytes,3,opt,name=operating_system,json=operatingSystem,proto3" json:"operating_system,omitempty"` Architecture string `protobuf:"bytes,4,opt,name=architecture,proto3" json:"architecture,omitempty"` } func (x *Machine) Reset() { *x = Machine{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_machine_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Machine) String() string { return protoimpl.X.MessageStringOf(x) } func (*Machine) ProtoMessage() {} func (x *Machine) ProtoReflect() protoreflect.Message { mi := &file_types_v1_machine_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Machine.ProtoReflect.Descriptor instead. func (*Machine) Descriptor() ([]byte, []int) { return file_types_v1_machine_proto_rawDescGZIP(), []int{0} } func (x *Machine) GetId() int64 { if x != nil { return x.Id } return 0 } func (x *Machine) GetName() string { if x != nil { return x.Name } return "" } func (x *Machine) GetOperatingSystem() string { if x != nil { return x.OperatingSystem } return "" } func (x *Machine) GetArchitecture() string { if x != nil { return x.Architecture } return "" } var File_types_v1_machine_proto protoreflect.FileDescriptor var file_types_v1_machine_proto_rawDesc = []byte{ 0x0a, 0x16, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x7c, 0x0a, 0x07, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x42, 0x8c, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_machine_proto_rawDescOnce sync.Once file_types_v1_machine_proto_rawDescData = file_types_v1_machine_proto_rawDesc ) func file_types_v1_machine_proto_rawDescGZIP() []byte { file_types_v1_machine_proto_rawDescOnce.Do(func() { file_types_v1_machine_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_machine_proto_rawDescData) }) return file_types_v1_machine_proto_rawDescData } var file_types_v1_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_v1_machine_proto_goTypes = []interface{}{ (*Machine)(nil), // 0: types.v1.Machine } var file_types_v1_machine_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_machine_proto_init() } func file_types_v1_machine_proto_init() { if File_types_v1_machine_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_machine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Machine); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_machine_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_machine_proto_goTypes, DependencyIndexes: file_types_v1_machine_proto_depIdxs, MessageInfos: file_types_v1_machine_proto_msgTypes, }.Build() File_types_v1_machine_proto = out.File file_types_v1_machine_proto_rawDesc = nil file_types_v1_machine_proto_goTypes = nil file_types_v1_machine_proto_depIdxs = nil } meta.pb.go000066400000000000000000000166011452676773100374120ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/meta.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ReqMeta struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` MachineId int64 `protobuf:"varint,2,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` } func (x *ReqMeta) Reset() { *x = ReqMeta{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_meta_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ReqMeta) String() string { return protoimpl.X.MessageStringOf(x) } func (*ReqMeta) ProtoMessage() {} func (x *ReqMeta) ProtoReflect() protoreflect.Message { mi := &file_types_v1_meta_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ReqMeta.ProtoReflect.Descriptor instead. func (*ReqMeta) Descriptor() ([]byte, []int) { return file_types_v1_meta_proto_rawDescGZIP(), []int{0} } func (x *ReqMeta) GetAccountId() int64 { if x != nil { return x.AccountId } return 0 } func (x *ReqMeta) GetMachineId() int64 { if x != nil { return x.MachineId } return 0 } type ResMeta struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` MachineId int64 `protobuf:"varint,2,opt,name=machine_id,json=machineId,proto3" json:"machine_id,omitempty"` } func (x *ResMeta) Reset() { *x = ResMeta{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_meta_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ResMeta) String() string { return protoimpl.X.MessageStringOf(x) } func (*ResMeta) ProtoMessage() {} func (x *ResMeta) ProtoReflect() protoreflect.Message { mi := &file_types_v1_meta_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ResMeta.ProtoReflect.Descriptor instead. func (*ResMeta) Descriptor() ([]byte, []int) { return file_types_v1_meta_proto_rawDescGZIP(), []int{1} } func (x *ResMeta) GetAccountId() int64 { if x != nil { return x.AccountId } return 0 } func (x *ResMeta) GetMachineId() int64 { if x != nil { return x.MachineId } return 0 } var File_types_v1_meta_proto protoreflect.FileDescriptor var file_types_v1_meta_proto_rawDesc = []byte{ 0x0a, 0x13, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x47, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x42, 0x89, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_meta_proto_rawDescOnce sync.Once file_types_v1_meta_proto_rawDescData = file_types_v1_meta_proto_rawDesc ) func file_types_v1_meta_proto_rawDescGZIP() []byte { file_types_v1_meta_proto_rawDescOnce.Do(func() { file_types_v1_meta_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_meta_proto_rawDescData) }) return file_types_v1_meta_proto_rawDescData } var file_types_v1_meta_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_types_v1_meta_proto_goTypes = []interface{}{ (*ReqMeta)(nil), // 0: types.v1.ReqMeta (*ResMeta)(nil), // 1: types.v1.ResMeta } var file_types_v1_meta_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_meta_proto_init() } func file_types_v1_meta_proto_init() { if File_types_v1_meta_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_meta_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReqMeta); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_types_v1_meta_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResMeta); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_meta_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_meta_proto_goTypes, DependencyIndexes: file_types_v1_meta_proto_depIdxs, MessageInfos: file_types_v1_meta_proto_msgTypes, }.Build() File_types_v1_meta_proto = out.File file_types_v1_meta_proto_rawDesc = nil file_types_v1_meta_proto_goTypes = nil file_types_v1_meta_proto_depIdxs = nil } release_channel.pb.go000066400000000000000000000134171452676773100415760ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/release_channel.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type ReleaseChannel struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"` } func (x *ReleaseChannel) Reset() { *x = ReleaseChannel{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_release_channel_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ReleaseChannel) String() string { return protoimpl.X.MessageStringOf(x) } func (*ReleaseChannel) ProtoMessage() {} func (x *ReleaseChannel) ProtoReflect() protoreflect.Message { mi := &file_types_v1_release_channel_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ReleaseChannel.ProtoReflect.Descriptor instead. func (*ReleaseChannel) Descriptor() ([]byte, []int) { return file_types_v1_release_channel_proto_rawDescGZIP(), []int{0} } func (x *ReleaseChannel) GetName() string { if x != nil { return x.Name } return "" } func (x *ReleaseChannel) GetPriority() int32 { if x != nil { return x.Priority } return 0 } var File_types_v1_release_channel_proto protoreflect.FileDescriptor var file_types_v1_release_channel_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x40, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x42, 0x93, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x13, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_release_channel_proto_rawDescOnce sync.Once file_types_v1_release_channel_proto_rawDescData = file_types_v1_release_channel_proto_rawDesc ) func file_types_v1_release_channel_proto_rawDescGZIP() []byte { file_types_v1_release_channel_proto_rawDescOnce.Do(func() { file_types_v1_release_channel_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_release_channel_proto_rawDescData) }) return file_types_v1_release_channel_proto_rawDescData } var file_types_v1_release_channel_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_v1_release_channel_proto_goTypes = []interface{}{ (*ReleaseChannel)(nil), // 0: types.v1.ReleaseChannel } var file_types_v1_release_channel_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_release_channel_proto_init() } func file_types_v1_release_channel_proto_init() { if File_types_v1_release_channel_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_release_channel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReleaseChannel); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_release_channel_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_release_channel_proto_goTypes, DependencyIndexes: file_types_v1_release_channel_proto_depIdxs, MessageInfos: file_types_v1_release_channel_proto_msgTypes, }.Build() File_types_v1_release_channel_proto = out.File file_types_v1_release_channel_proto_rawDesc = nil file_types_v1_release_channel_proto_goTypes = nil file_types_v1_release_channel_proto_depIdxs = nil } version.go000066400000000000000000000010341452676773100375430ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1package typesv1 import ( "github.com/blang/semver" ) func (v Version) AsSemver() (semver.Version, error) { out := semver.Version{ Major: uint64(v.Major), Minor: uint64(v.Minor), Patch: uint64(v.Patch), } if len(v.Prereleases) > 0 { out.Pre = make([]semver.PRVersion, 0, len(v.Prereleases)) for _, pre := range v.Prereleases { pr, err := semver.NewPRVersion(pre) if err != nil { return out, err } out.Pre = append(out.Pre, pr) } } if v.Build != "" { out.Build = []string{v.Build} } return out, nil } version.pb.go000066400000000000000000000144651452676773100401570ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/version.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type Version struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"` Prereleases []string `protobuf:"bytes,4,rep,name=prereleases,proto3" json:"prereleases,omitempty"` Build string `protobuf:"bytes,5,opt,name=build,proto3" json:"build,omitempty"` } func (x *Version) Reset() { *x = Version{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_version_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Version) String() string { return protoimpl.X.MessageStringOf(x) } func (*Version) ProtoMessage() {} func (x *Version) ProtoReflect() protoreflect.Message { mi := &file_types_v1_version_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Version.ProtoReflect.Descriptor instead. func (*Version) Descriptor() ([]byte, []int) { return file_types_v1_version_proto_rawDescGZIP(), []int{0} } func (x *Version) GetMajor() int32 { if x != nil { return x.Major } return 0 } func (x *Version) GetMinor() int32 { if x != nil { return x.Minor } return 0 } func (x *Version) GetPatch() int32 { if x != nil { return x.Patch } return 0 } func (x *Version) GetPrereleases() []string { if x != nil { return x.Prereleases } return nil } func (x *Version) GetBuild() string { if x != nil { return x.Build } return "" } var File_types_v1_version_proto protoreflect.FileDescriptor var file_types_v1_version_proto_rawDesc = []byte{ 0x0a, 0x16, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x83, 0x01, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x42, 0x8c, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_version_proto_rawDescOnce sync.Once file_types_v1_version_proto_rawDescData = file_types_v1_version_proto_rawDesc ) func file_types_v1_version_proto_rawDescGZIP() []byte { file_types_v1_version_proto_rawDescOnce.Do(func() { file_types_v1_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_version_proto_rawDescData) }) return file_types_v1_version_proto_rawDescData } var file_types_v1_version_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_v1_version_proto_goTypes = []interface{}{ (*Version)(nil), // 0: types.v1.Version } var file_types_v1_version_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_version_proto_init() } func file_types_v1_version_proto_init() { if File_types_v1_version_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Version); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_version_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_version_proto_goTypes, DependencyIndexes: file_types_v1_version_proto_depIdxs, MessageInfos: file_types_v1_version_proto_msgTypes, }.Build() File_types_v1_version_proto = out.File file_types_v1_version_proto_rawDesc = nil file_types_v1_version_proto_goTypes = nil file_types_v1_version_proto_depIdxs = nil } version_artifact.pb.go000066400000000000000000000161331452676773100420260ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1/vendor/github.com/humanlogio/api/go/types/v1// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 // protoc (unknown) // source: types/v1/version_artifact.proto package typesv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) type VersionArtifact struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` Sha256 string `protobuf:"bytes,2,opt,name=sha256,proto3" json:"sha256,omitempty"` Signature string `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` Architecture string `protobuf:"bytes,4,opt,name=architecture,proto3" json:"architecture,omitempty"` OperatingSystem string `protobuf:"bytes,5,opt,name=operating_system,json=operatingSystem,proto3" json:"operating_system,omitempty"` } func (x *VersionArtifact) Reset() { *x = VersionArtifact{} if protoimpl.UnsafeEnabled { mi := &file_types_v1_version_artifact_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *VersionArtifact) String() string { return protoimpl.X.MessageStringOf(x) } func (*VersionArtifact) ProtoMessage() {} func (x *VersionArtifact) ProtoReflect() protoreflect.Message { mi := &file_types_v1_version_artifact_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use VersionArtifact.ProtoReflect.Descriptor instead. func (*VersionArtifact) Descriptor() ([]byte, []int) { return file_types_v1_version_artifact_proto_rawDescGZIP(), []int{0} } func (x *VersionArtifact) GetUrl() string { if x != nil { return x.Url } return "" } func (x *VersionArtifact) GetSha256() string { if x != nil { return x.Sha256 } return "" } func (x *VersionArtifact) GetSignature() string { if x != nil { return x.Signature } return "" } func (x *VersionArtifact) GetArchitecture() string { if x != nil { return x.Architecture } return "" } func (x *VersionArtifact) GetOperatingSystem() string { if x != nil { return x.OperatingSystem } return "" } var File_types_v1_version_artifact_proto protoreflect.FileDescriptor var file_types_v1_version_artifact_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0xa8, 0x01, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x42, 0x94, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x6c, 0x6f, 0x67, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_types_v1_version_artifact_proto_rawDescOnce sync.Once file_types_v1_version_artifact_proto_rawDescData = file_types_v1_version_artifact_proto_rawDesc ) func file_types_v1_version_artifact_proto_rawDescGZIP() []byte { file_types_v1_version_artifact_proto_rawDescOnce.Do(func() { file_types_v1_version_artifact_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_v1_version_artifact_proto_rawDescData) }) return file_types_v1_version_artifact_proto_rawDescData } var file_types_v1_version_artifact_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_v1_version_artifact_proto_goTypes = []interface{}{ (*VersionArtifact)(nil), // 0: types.v1.VersionArtifact } var file_types_v1_version_artifact_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name } func init() { file_types_v1_version_artifact_proto_init() } func file_types_v1_version_artifact_proto_init() { if File_types_v1_version_artifact_proto != nil { return } if !protoimpl.UnsafeEnabled { file_types_v1_version_artifact_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VersionArtifact); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_v1_version_artifact_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, GoTypes: file_types_v1_version_artifact_proto_goTypes, DependencyIndexes: file_types_v1_version_artifact_proto_depIdxs, MessageInfos: file_types_v1_version_artifact_proto_msgTypes, }.Build() File_types_v1_version_artifact_proto = out.File file_types_v1_version_artifact_proto_rawDesc = nil file_types_v1_version_artifact_proto_goTypes = nil file_types_v1_version_artifact_proto_depIdxs = nil } zap_development_handler.go000066400000000000000000000047601452676773100324120ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1package humanlog import ( "regexp" "strings" "time" "github.com/humanlogio/humanlog/internal/pkg/model" ) // Zap Development logs are made up of the following separated by whitespace // 1. timestamp in ISO-8601 (??) // 2. Log Level (one of DEBUG ERROR INFO WARN FATAL) // 3. Caller Location in the source // 4. The main logged message // 5. a JSON object containing the structured k/v pairs // 6. optional context lines - but since they are on a separate line the main // scanner loop will never capture them var zapDevLogsPrefixRe = regexp.MustCompile("^(?P\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}-\\d{4})\\s+(?P\\w{4,5})\\s+(?P\\S+)\\s+(?P[^{]+?)\\s+(?P{.+})$") // Zap Development Logs when run in Docker-Compose are nearly identical to before // Fields are tab separated instead of whitespace // Timestamp is now in ... // Everything else remains the same var zapDevDCLogsPrefixRe = regexp.MustCompile("^(?P\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z)\t(?P\\w{4,5})\t(?P\\S+)\t(?P[^{]+?)\t(?P{.+})$") // This is not obviously an RFC-compliant format and is not a constant in the // time package which is worrisome but this pattern does work. const someRFC = "2006-01-02T15:04:05.000-0700" func tryZapDevPrefix(d []byte, ev *model.Structured, handler *JSONHandler) bool { if matches := zapDevLogsPrefixRe.FindSubmatch(d); matches != nil { if handler.TryHandle(matches[5], ev) { t, err := time.Parse(someRFC, string(matches[1])) if err != nil { return false } ev.Time = t ev.Level = strings.ToLower(string(matches[2])) ev.Msg = string(matches[4]) ev.KVs = append(ev.KVs, model.KV{ Key: "caller", Value: string(matches[3]), }) return true } } return false } // This is not obviously an RFC-compliant format and is not a constant in the // time package which is worrisome but this pattern does work. const someOtherRFC = "2006-01-02T15:04:05.000Z" func tryZapDevDCPrefix(d []byte, ev *model.Structured, handler *JSONHandler) bool { if matches := zapDevDCLogsPrefixRe.FindSubmatch(d); matches != nil { if handler.TryHandle(matches[5], ev) { t, err := time.Parse(someOtherRFC, string(matches[1])) if err != nil { return false } ev.Time = t ev.Level = strings.ToLower(string(matches[2])) ev.Msg = string(matches[4]) ev.KVs = append( ev.KVs, model.KV{Key: "caller", Value: string(matches[3])}, ) return true } } return false } zap_development_handler_test.go000066400000000000000000000275331452676773100334540ustar00rootroot00000000000000golang-github-humanlogio-humanlog-0.7.6+really0.7.5+git20231011.deb0543+ds1package humanlog import ( "testing" "time" "github.com/humanlogio/humanlog/internal/pkg/model" ) var logLinesByLevel = map[string][]byte{ "DEBUG": []byte(`2021-02-05T12:41:48.053-0700 DEBUG zapper/zapper.go:18 some message 1 {"rand_index": 1}`), "ERROR": []byte(`2021-02-05T12:41:49.059-0700 ERROR zapper/zapper.go:18 some message 2 {"rand_index": 3}`), "FATAL": []byte(`2021-02-05T15:45:04.425-0700 FATAL zapper/zapper.go:18 some message 5 {"rand_index": 11}`), "INFO": []byte(`2021-02-05T12:41:50.064-0700 INFO zapper/zapper.go:18 some message 3 {"rand_index": 5}`), "WARN": []byte(`2021-02-05T12:41:51.069-0700 WARN zapper/zapper.go:18 some message 4 {"rand_index": 7}`), } func Test_zapDevLogsPrefixRe(t *testing.T) { tests := []struct { name string logLine []byte wantTS string wantLevel string wantLocation string wantMessage string wantJSON string }{ { name: "debug message", logLine: logLinesByLevel["DEBUG"], wantTS: "2021-02-05T12:41:48.053-0700", wantLevel: "DEBUG", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 1", wantJSON: `{"rand_index": 1}`, }, { name: "error message", logLine: logLinesByLevel["ERROR"], wantTS: "2021-02-05T12:41:49.059-0700", wantLevel: "ERROR", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 2", wantJSON: `{"rand_index": 3}`, }, { name: "fatal message", logLine: logLinesByLevel["FATAL"], wantTS: "2021-02-05T15:45:04.425-0700", wantLevel: "FATAL", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 5", wantJSON: `{"rand_index": 11}`, }, { name: "info message", logLine: logLinesByLevel["INFO"], wantTS: "2021-02-05T12:41:50.064-0700", wantLevel: "INFO", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 3", wantJSON: `{"rand_index": 5}`, }, { name: "warning message", logLine: logLinesByLevel["WARN"], wantTS: "2021-02-05T12:41:51.069-0700", wantLevel: "WARN", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 4", wantJSON: `{"rand_index": 7}`, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { matches := zapDevLogsPrefixRe.FindSubmatch(test.logLine) if matches != nil { result := make(map[string]string) for i, name := range zapDevLogsPrefixRe.SubexpNames() { if i != 0 && name != "" { result[name] = string(matches[i]) } } if result["timestamp"] != test.wantTS { t.Errorf("want %q, got %q, want != got", test.wantTS, result["timestamp"]) } if result["level"] != test.wantLevel { t.Errorf("want %q, got %q, want != got", test.wantLevel, result["level"]) } if result["location"] != test.wantLocation { t.Errorf("want %q, got %q, want != got", test.wantLocation, result["location"]) } if result["message"] != test.wantMessage { t.Errorf("want %q, got %q, want != got", test.wantMessage, result["message"]) } if result["jsonbody"] != test.wantJSON { t.Errorf("want %q, got %q, want != got", test.wantJSON, result["jsonbody"]) } } else { t.Errorf("regular expression did not match log line") } }) } } func Test_tryZapDevPrefix(t *testing.T) { tests := []struct { name string logLine []byte wantMatch bool wantTime time.Time wantLevel string wantLocation string wantMessage string wantExtraContext string }{ { name: "no match", logLine: []byte("that's no good"), wantMatch: false, }, { name: "debug message", logLine: logLinesByLevel["DEBUG"], wantMatch: true, wantTime: time.Date(2021, 2, 5, 12, 41, 48, 53e6, time.FixedZone("", -7*3600)), wantLevel: "debug", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 1", }, { name: "error message with caller info", logLine: logLinesByLevel["ERROR"], wantMatch: true, wantTime: time.Date(2021, 2, 5, 12, 41, 49, 59e6, time.FixedZone("", -7*3600)), wantLevel: "error", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 2", }, { name: "fatal message with caller info and exit status", logLine: logLinesByLevel["FATAL"], wantMatch: true, wantTime: time.Date(2021, 2, 5, 15, 45, 4, 425e6, time.FixedZone("", -7*3600)), wantLevel: "fatal", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 5", }, { name: "info message", logLine: logLinesByLevel["INFO"], wantMatch: true, wantTime: time.Date(2021, 2, 5, 12, 41, 50, 64e6, time.FixedZone("", -7*3600)), wantLevel: "info", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 3", }, { name: "warning message with caller info", logLine: logLinesByLevel["WARN"], wantMatch: true, wantTime: time.Date(2021, 2, 5, 12, 41, 51, 69e6, time.FixedZone("", -7*3600)), wantLevel: "warn", wantLocation: "zapper/zapper.go:18", wantMessage: "some message 4", }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { ev := new(model.Structured) m := tryZapDevPrefix(test.logLine, ev, &JSONHandler{Opts: DefaultOptions()}) if m != test.wantMatch { t.Error("expected the prefix to match, it did not") } // Short circuit - if we want failure don't assert against the handler if !test.wantMatch { return } if !test.wantTime.Equal(ev.Time) { t.Errorf("want %v, got %v; want != got", test.wantTime, ev.Time) } if ev.Level != test.wantLevel { t.Errorf("want %q, got %q; want != got", test.wantLevel, ev.Level) } if ev.Msg != test.wantMessage { t.Errorf("want %q, got %q; want != got", test.wantMessage, ev.Msg) } if findFieldValue(ev, "caller") != test.wantLocation { t.Errorf("want %q, got %q; want != got", test.wantLocation, findFieldValue(ev, "caller")) } }) } } func findFieldValue(ev *model.Structured, field string) string { for _, kv := range ev.KVs { if kv.Key == field { return kv.Value } } return "" } var dcLogLinesByLevel = map[string][]byte{ "DEBUG": []byte("2021-02-06T22:55:22.004Z\tDEBUG\tzapper/zapper.go:17\tsome message 1\t{\"rand_index\": 1}"), "ERROR": []byte("2021-02-06T22:55:22.008Z\tERROR\tzapper/zapper.go:17\tsome message 2\t{\"rand_index\": 2}"), "FATAL": []byte("2021-02-06T22:55:22.009Z\tFATAL\tzapper/zapper.go:17\tsome message 5\t{\"rand_index\": 1}"), "INFO": []byte("2021-02-06T22:55:22.009Z\tINFO\tzapper/zapper.go:17\tsome message 3\t{\"rand_index\": 2}"), "WARN": []byte("2021-02-06T22:55:22.009Z\tWARN\tzapper/zapper.go:17\tsome message 4\t{\"rand_index\": 4}"), } func Test_zapDCDevLogsPrefixRe(t *testing.T) { tests := []struct { name string logLine []byte wantTS string wantLevel string wantLocation string wantMessage string wantJSON string }{ { name: "debug message", logLine: dcLogLinesByLevel["DEBUG"], wantTS: "2021-02-06T22:55:22.004Z", wantLevel: "DEBUG", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 1", wantJSON: `{"rand_index": 1}`, }, { name: "error message", logLine: dcLogLinesByLevel["ERROR"], wantTS: "2021-02-06T22:55:22.008Z", wantLevel: "ERROR", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 2", wantJSON: `{"rand_index": 2}`, }, { name: "fatal message", logLine: dcLogLinesByLevel["FATAL"], wantTS: "2021-02-06T22:55:22.009Z", wantLevel: "FATAL", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 5", wantJSON: `{"rand_index": 1}`, }, { name: "info message", logLine: dcLogLinesByLevel["INFO"], wantTS: "2021-02-06T22:55:22.009Z", wantLevel: "INFO", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 3", wantJSON: `{"rand_index": 2}`, }, { name: "warn message", logLine: dcLogLinesByLevel["WARN"], wantTS: "2021-02-06T22:55:22.009Z", wantLevel: "WARN", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 4", wantJSON: `{"rand_index": 4}`, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { matches := zapDevDCLogsPrefixRe.FindSubmatch(test.logLine) if matches != nil { result := make(map[string]string) for i, name := range zapDevLogsPrefixRe.SubexpNames() { if i != 0 && name != "" { result[name] = string(matches[i]) } } if result["timestamp"] != test.wantTS { t.Errorf("want %q, got %q, want != got", test.wantTS, result["timestamp"]) } if result["level"] != test.wantLevel { t.Errorf("want %q, got %q, want != got", test.wantLevel, result["level"]) } if result["location"] != test.wantLocation { t.Errorf("want %q, got %q, want != got", test.wantLocation, result["location"]) } if result["message"] != test.wantMessage { t.Errorf("want %q, got %q, want != got", test.wantMessage, result["message"]) } if result["jsonbody"] != test.wantJSON { t.Errorf("want %q, got %q, want != got", test.wantJSON, result["jsonbody"]) } } else { t.Errorf("regular expression did not match log line") } }) } } func Test_tryZapDevDCPrefix(t *testing.T) { tests := []struct { name string logLine []byte wantMatch bool wantTime time.Time wantLevel string wantLocation string wantMessage string wantExtraContext string }{ { name: "no match", logLine: []byte("that's no good"), wantMatch: false, }, { name: "debug message", logLine: dcLogLinesByLevel["DEBUG"], wantMatch: true, wantTime: time.Date(2021, 2, 6, 22, 55, 22, 4e6, time.UTC), wantLevel: "debug", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 1", }, { name: "error message with caller info", logLine: dcLogLinesByLevel["ERROR"], wantMatch: true, wantTime: time.Date(2021, 2, 6, 22, 55, 22, 8e6, time.UTC), wantLevel: "error", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 2", }, { name: "fatal message with caller info and exit status", logLine: dcLogLinesByLevel["FATAL"], wantMatch: true, wantTime: time.Date(2021, 2, 6, 22, 55, 22, 9e6, time.UTC), wantLevel: "fatal", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 5", }, { name: "info message", logLine: dcLogLinesByLevel["INFO"], wantMatch: true, wantTime: time.Date(2021, 2, 6, 22, 55, 22, 9e6, time.UTC), wantLevel: "info", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 3", }, { name: "warning message with caller info", logLine: dcLogLinesByLevel["WARN"], wantMatch: true, wantTime: time.Date(2021, 2, 6, 22, 55, 22, 9e6, time.UTC), wantLevel: "warn", wantLocation: "zapper/zapper.go:17", wantMessage: "some message 4", }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { ev := new(model.Structured) m := tryZapDevDCPrefix(test.logLine, ev, &JSONHandler{Opts: DefaultOptions()}) if m != test.wantMatch { t.Error("expected the prefix to match, it did not") } // Short circuit - if we want failure don't assert against the handler if !test.wantMatch { return } if !test.wantTime.Equal(ev.Time) { t.Errorf("want %v, got %v; want != got", test.wantTime, ev.Time) } if ev.Level != test.wantLevel { t.Errorf("want %q, got %q; want != got", test.wantLevel, ev.Level) } if ev.Msg != test.wantMessage { t.Errorf("want %q, got %q; want != got", test.wantMessage, ev.Msg) } if findFieldValue(ev, "caller") != test.wantLocation { t.Errorf("want %q, got %q; want != got", test.wantLocation, findFieldValue(ev, "caller")) } }) } }