├── vendor ├── github.com │ ├── tonistiigi │ │ └── go-csvvalue │ │ │ ├── codecov.yml │ │ │ ├── .yamllint.yml │ │ │ ├── .golangci.yml │ │ │ ├── LICENSE │ │ │ ├── Dockerfile │ │ │ ├── docker-bake.hcl │ │ │ └── readme.md │ ├── containerd │ │ └── typeurl │ │ │ └── v2 │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── types_gogo.go │ │ │ └── doc.go │ ├── yalp │ │ └── jsonpath │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ └── README.md │ ├── agext │ │ └── levenshtein │ │ │ ├── MAINTAINERS │ │ │ ├── NOTICE │ │ │ ├── test.sh │ │ │ ├── .travis.yml │ │ │ ├── .gitignore │ │ │ ├── DCO │ │ │ └── README.md │ ├── opencontainers │ │ ├── go-digest │ │ │ ├── .travis.yml │ │ │ ├── .mailmap │ │ │ ├── MAINTAINERS │ │ │ ├── .pullapprove.yml │ │ │ ├── digester.go │ │ │ ├── verifiers.go │ │ │ ├── doc.go │ │ │ └── CONTRIBUTING.md │ │ └── image-spec │ │ │ └── specs-go │ │ │ ├── versioned.go │ │ │ ├── version.go │ │ │ └── v1 │ │ │ ├── layout.go │ │ │ ├── index.go │ │ │ ├── manifest.go │ │ │ ├── annotations.go │ │ │ └── descriptor.go │ ├── moby │ │ ├── buildkit │ │ │ ├── frontend │ │ │ │ └── dockerfile │ │ │ │ │ ├── instructions │ │ │ │ │ ├── parse_parents.go │ │ │ │ │ ├── exclude_pattern_feature.go │ │ │ │ │ ├── errors_unix.go │ │ │ │ │ ├── support.go │ │ │ │ │ ├── errors_windows.go │ │ │ │ │ ├── commands_runsecurity.go │ │ │ │ │ └── commands_runnetwork.go │ │ │ │ │ ├── shell │ │ │ │ │ ├── equal_env_unix.go │ │ │ │ │ ├── equal_env_windows.go │ │ │ │ │ └── wordsTest │ │ │ │ │ ├── command │ │ │ │ │ └── command.go │ │ │ │ │ └── parser │ │ │ │ │ ├── errors.go │ │ │ │ │ └── split_command.go │ │ │ └── util │ │ │ │ ├── stack │ │ │ │ ├── stack.proto │ │ │ │ └── compress.go │ │ │ │ └── suggest │ │ │ │ └── error.go │ │ └── docker-image-spec │ │ │ └── specs-go │ │ │ └── v1 │ │ │ └── image.go │ ├── pkg │ │ └── errors │ │ │ ├── .travis.yml │ │ │ ├── .gitignore │ │ │ ├── appveyor.yml │ │ │ ├── Makefile │ │ │ ├── LICENSE │ │ │ ├── go113.go │ │ │ └── README.md │ ├── docker │ │ └── go-units │ │ │ ├── circle.yml │ │ │ ├── README.md │ │ │ ├── duration.go │ │ │ ├── MAINTAINERS │ │ │ └── CONTRIBUTING.md │ ├── gogo │ │ └── protobuf │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── proto │ │ │ ├── encode_gogo.go │ │ │ ├── properties_gogo.go │ │ │ ├── custom_gogo.go │ │ │ ├── Makefile │ │ │ ├── lib_gogo.go │ │ │ ├── duration_gogo.go │ │ │ ├── timestamp_gogo.go │ │ │ ├── text_gogo.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── pointer_reflect_gogo.go │ │ │ └── deprecated.go │ │ │ └── LICENSE │ └── planetscale │ │ └── vtprotobuf │ │ ├── LICENSE │ │ └── protohelpers │ │ └── protohelpers.go ├── google.golang.org │ └── protobuf │ │ ├── internal │ │ ├── editiondefaults │ │ │ ├── editions_defaults.binpb │ │ │ └── defaults.go │ │ ├── flags │ │ │ ├── proto_legacy_enable.go │ │ │ ├── proto_legacy_disable.go │ │ │ └── flags.go │ │ ├── impl │ │ │ ├── codec_map_go112.go │ │ │ ├── codec_unsafe.go │ │ │ ├── enum.go │ │ │ ├── codec_map_go111.go │ │ │ ├── weak.go │ │ │ └── legacy_file.go │ │ ├── errors │ │ │ ├── is_go113.go │ │ │ ├── is_go112.go │ │ │ └── errors.go │ │ ├── genid │ │ │ ├── doc.go │ │ │ ├── wrappers.go │ │ │ ├── map_entry.go │ │ │ ├── empty_gen.go │ │ │ ├── goname.go │ │ │ ├── field_mask_gen.go │ │ │ ├── source_context_gen.go │ │ │ ├── any_gen.go │ │ │ ├── duration_gen.go │ │ │ ├── timestamp_gen.go │ │ │ └── go_features_gen.go │ │ ├── pragma │ │ │ └── pragma.go │ │ ├── descopts │ │ │ └── options.go │ │ ├── set │ │ │ └── ints.go │ │ ├── encoding │ │ │ └── text │ │ │ │ └── doc.go │ │ ├── detrand │ │ │ └── rand.go │ │ ├── strs │ │ │ ├── strings_unsafe_go121.go │ │ │ └── strings_unsafe_go120.go │ │ ├── version │ │ │ └── version.go │ │ └── order │ │ │ ├── order.go │ │ │ └── range.go │ │ ├── encoding │ │ └── prototext │ │ │ └── doc.go │ │ ├── runtime │ │ ├── protoiface │ │ │ └── legacy.go │ │ └── protoimpl │ │ │ ├── impl.go │ │ │ └── version.go │ │ ├── proto │ │ ├── proto_reflect.go │ │ ├── proto_methods.go │ │ ├── reset.go │ │ ├── wrappers.go │ │ ├── proto.go │ │ ├── size_gen.go │ │ ├── checkinit.go │ │ └── equal.go │ │ ├── PATENTS │ │ ├── LICENSE │ │ └── reflect │ │ └── protoreflect │ │ ├── methods.go │ │ ├── value_unsafe_go121.go │ │ └── value_unsafe_go120.go └── modules.txt ├── package.json ├── .gitignore ├── examples ├── Dockerfile.2 ├── Dockerfile.3 └── Dockerfile.1 ├── .github ├── dependabot.yml └── workflows │ ├── go.yml │ └── goreleaser.yml ├── pkg └── dockerfile │ ├── json.go │ ├── analyze.go │ ├── types.go │ ├── expand.go │ └── parse.go ├── flagvar.go ├── .goreleaser.yaml ├── go.mod └── LICENSE /vendor/github.com/tonistiigi/go-csvvalue/codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/typeurl/v2/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | coverage.txt 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dockerfile-json", 3 | "version": "1.1.0" 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/yalp/jsonpath/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - "1.10" 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Dockerfile 2 | binaries/ 3 | release/ 4 | /dockerfile-json 5 | /dist 6 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Alex Bucataru (@AlexBucataru) 2 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.12.x 4 | - 1.13.x 5 | - master 6 | -------------------------------------------------------------------------------- /examples/Dockerfile.2: -------------------------------------------------------------------------------- 1 | FROM maven:alpine AS build 2 | # ... 3 | 4 | FROM build AS test 5 | # ... 6 | 7 | FROM openjdk:jre-alpine 8 | # ... 9 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/parse_parents.go: -------------------------------------------------------------------------------- 1 | //go:build dfparents 2 | 3 | package instructions 4 | 5 | func init() { 6 | parentsEnabled = true 7 | } 8 | -------------------------------------------------------------------------------- /examples/Dockerfile.3: -------------------------------------------------------------------------------- 1 | ARG ALPINE_TAG=3.10 2 | ARG APP_BASE=scratch 3 | 4 | FROM alpine:${ALPINE_TAG} AS build 5 | # ... 6 | 7 | FROM build 8 | # ... 9 | 10 | FROM ${APP_BASE} 11 | # ... 12 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - 1.13.x 7 | - tip 8 | 9 | script: 10 | - make check 11 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/exclude_pattern_feature.go: -------------------------------------------------------------------------------- 1 | //go:build dfexcludepatterns 2 | 3 | package instructions 4 | 5 | func init() { 6 | excludePatternsEnabled = true 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/NOTICE: -------------------------------------------------------------------------------- 1 | Alrux Go EXTensions (AGExt) - package levenshtein 2 | Copyright 2016 ALRUX Inc. 3 | 4 | This product includes software developed at ALRUX Inc. 5 | (http://www.alrux.com/). 6 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keilerkonzept/dockerfile-json/HEAD/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb -------------------------------------------------------------------------------- /vendor/github.com/tonistiigi/go-csvvalue/.yamllint.yml: -------------------------------------------------------------------------------- 1 | ignore: | 2 | /vendor 3 | 4 | extends: default 5 | 6 | yaml-files: 7 | - '*.yaml' 8 | - '*.yml' 9 | 10 | rules: 11 | truthy: disable 12 | line-length: disable 13 | document-start: disable 14 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/.mailmap: -------------------------------------------------------------------------------- 1 | Aaron Lehmann 2 | Derek McGowan 3 | Stephen J Day 4 | Haibing Zhou 5 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/test.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | 3 | if [[ "$1" == "goveralls" ]]; then 4 | echo "Testing with goveralls..." 5 | go get github.com/mattn/goveralls 6 | $HOME/gopath/bin/goveralls -service=travis-ci 7 | else 8 | echo "Testing with go test..." 9 | go test -v ./... 10 | fi 11 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/errors_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package instructions 4 | 5 | import "github.com/pkg/errors" 6 | 7 | func errNotJSON(command, _ string) error { 8 | return errors.Errorf("%s requires the arguments to be in JSON form", command) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Derek McGowan (@dmcgowan) 2 | Stephen Day (@stevvooe) 3 | Vincent Batts (@vbatts) 4 | Akihiro Suda (@AkihiroSuda) 5 | Sebastiaan van Stijn (@thaJeztah) 6 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | post: 3 | # install golint 4 | - go get golang.org/x/lint/golint 5 | 6 | test: 7 | pre: 8 | # run analysis before tests 9 | - go vet ./... 10 | - test -z "$(golint ./... | tee /dev/stderr)" 11 | - test -z "$(gofmt -s -l . | tee /dev/stderr)" 12 | -------------------------------------------------------------------------------- /examples/Dockerfile.1: -------------------------------------------------------------------------------- 1 | ARG ALPINE_TAG=3.10 2 | 3 | FROM alpine:${ALPINE_TAG} AS build 4 | RUN --network=host echo "Hello world" > abc 5 | 6 | FROM build AS test 7 | RUN --security=insecure echo "foo" > bar 8 | 9 | FROM scratch 10 | COPY --from=build --chown=nobody:nobody abc . 11 | RUN --mount=type=bind,source=./abc,target=/def 12 | CMD ["echo"] 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/encoding/prototext/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package prototext marshals and unmarshals protocol buffer messages as the 6 | // textproto format. 7 | package prototext 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build protolegacy 6 | // +build protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = true 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !protolegacy 6 | // +build !protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = false 11 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.12 6 | // +build go1.12 7 | 8 | package impl 9 | 10 | import "reflect" 11 | 12 | func mapRange(v reflect.Value) *reflect.MapIter { return v.MapRange() } 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go113.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.13 6 | // +build go1.13 7 | 8 | package errors 9 | 10 | import "errors" 11 | 12 | // Is is errors.Is. 13 | func Is(err, target error) bool { return errors.Is(err, target) } 14 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/util/stack/stack.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package stack; 4 | 5 | option go_package = "github.com/moby/buildkit/util/stack"; 6 | 7 | message Stack { 8 | repeated Frame frames = 1; 9 | repeated string cmdline = 2; 10 | int32 pid = 3; 11 | string version = 4; 12 | string revision = 5; 13 | } 14 | 15 | message Frame { 16 | string Name = 1; 17 | string File = 2; 18 | int32 Line = 3; 19 | } 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package protoiface 6 | 7 | type MessageV1 interface { 8 | Reset() 9 | String() string 10 | ProtoMessage() 11 | } 12 | 13 | type ExtensionRangeV1 struct { 14 | Start, End int32 // both inclusive 15 | } 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package editiondefaults contains the binary representation of the editions 6 | // defaults. 7 | package editiondefaults 8 | 9 | import _ "embed" 10 | 11 | //go:embed editions_defaults.binpb 12 | var Defaults []byte 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package genid contains constants for declarations in descriptor.proto 6 | // and the well-known types. 7 | package genid 8 | 9 | import "google.golang.org/protobuf/reflect/protoreflect" 10 | 11 | const GoogleProtobuf_package protoreflect.FullName = "google.protobuf" 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | import "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field name and number for messages in wrappers.proto. 10 | const ( 11 | WrapperValue_Value_field_name protoreflect.Name = "value" 12 | WrapperValue_Value_field_number protoreflect.FieldNumber = 1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | // When using unsafe pointers, we can just treat enum values as int32s. 8 | 9 | var ( 10 | coderEnumNoZero = coderInt32NoZero 11 | coderEnum = coderInt32 12 | coderEnumPtr = coderInt32Ptr 13 | coderEnumSlice = coderInt32Slice 14 | coderEnumPackedSlice = coderInt32PackedSlice 15 | ) 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gomod" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /vendor/github.com/tonistiigi/go-csvvalue/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | timeout: 10m 3 | 4 | linters: 5 | enable: 6 | - bodyclose 7 | - depguard 8 | - errname 9 | - forbidigo 10 | - gocritic 11 | - gofmt 12 | - goimports 13 | - gosec 14 | - gosimple 15 | - govet 16 | - importas 17 | - ineffassign 18 | - makezero 19 | - misspell 20 | - noctx 21 | - nolintlint 22 | - revive 23 | - staticcheck 24 | - typecheck 25 | - unused 26 | - whitespace 27 | disable-all: true 28 | 29 | issues: 30 | exclude-use-default: false 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. 14 | 15 | go-units is licensed under the Apache License, Version 2.0. 16 | See [LICENSE](LICENSE) for the full text of the license. 17 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/.pullapprove.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | requirements: 4 | signed_off_by: 5 | required: true 6 | 7 | always_pending: 8 | title_regex: '^WIP' 9 | explanation: 'Work in progress...' 10 | 11 | group_defaults: 12 | required: 2 13 | approve_by_comment: 14 | enabled: true 15 | approve_regex: '^LGTM' 16 | reject_regex: '^Rejected' 17 | reset_on_push: 18 | enabled: true 19 | author_approval: 20 | ignored: true 21 | conditions: 22 | branches: 23 | - master 24 | 25 | groups: 26 | go-digest: 27 | teams: 28 | - go-digest-maintainers 29 | -------------------------------------------------------------------------------- /pkg/dockerfile/json.go: -------------------------------------------------------------------------------- 1 | package dockerfile 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | func (c *Command) MarshalJSON() ([]byte, error) { 9 | rawJSON, err := json.Marshal(c.Command) 10 | if err != nil { 11 | return nil, fmt.Errorf("merge json fields: %v", err) 12 | } 13 | out := map[string]interface{}{ 14 | "Name": c.Name, 15 | "Mounts": c.Mounts, 16 | "NetworkMode": c.NetworkMode, 17 | "Security": c.Security, 18 | } 19 | if err := json.Unmarshal(rawJSON, &out); err != nil { 20 | return nil, fmt.Errorf("merge json fields: %v", err) 21 | } 22 | return json.Marshal(out) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/shell/equal_env_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | 3 | package shell 4 | 5 | // EqualEnvKeys compare two strings and returns true if they are equal. 6 | // On Unix this comparison is case-sensitive. 7 | // On Windows this comparison is case-insensitive. 8 | func EqualEnvKeys(from, to string) bool { 9 | return from == to 10 | } 11 | 12 | // NormalizeEnvKey returns the key in a normalized form that can be used 13 | // for comparison. On Unix this is a no-op. On Windows this converts the 14 | // key to uppercase. 15 | func NormalizeEnvKey(key string) string { 16 | return key 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_reflect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build protoreflect 7 | // +build protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = false 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoGo authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file, which 3 | # lists people. For example, employees are listed in CONTRIBUTORS, 4 | # but not in AUTHORS, because the employer holds the copyright. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | 11 | # Please keep the list sorted. 12 | 13 | Sendgrid, Inc 14 | Vastech SA (PTY) LTD 15 | Walter Schulze 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/map_entry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | import "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field names and numbers for synthetic map entry messages. 10 | const ( 11 | MapEntry_Key_field_name protoreflect.Name = "key" 12 | MapEntry_Value_field_name protoreflect.Name = "value" 13 | 14 | MapEntry_Key_field_number protoreflect.FieldNumber = 1 15 | MapEntry_Value_field_number protoreflect.FieldNumber = 2 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_methods.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build !protoreflect 7 | // +build !protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = true 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return m.ProtoMethods() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/shell/equal_env_windows.go: -------------------------------------------------------------------------------- 1 | package shell 2 | 3 | import "strings" 4 | 5 | // EqualEnvKeys compare two strings and returns true if they are equal. 6 | // On Unix this comparison is case-sensitive. 7 | // On Windows this comparison is case-insensitive. 8 | func EqualEnvKeys(from, to string) bool { 9 | return strings.EqualFold(from, to) 10 | } 11 | 12 | // NormalizeEnvKey returns the key in a normalized form that can be used 13 | // for comparison. On Unix this is a no-op. On Windows this converts the 14 | // key to uppercase. 15 | func NormalizeEnvKey(key string) string { 16 | return strings.ToUpper(key) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | matrix: 4 | fast_finish: true 5 | include: 6 | - go: 1.14.x 7 | env: TEST_METHOD=goveralls 8 | - go: 1.13.x 9 | - go: 1.12.x 10 | - go: 1.11.x 11 | - go: 1.10.x 12 | - go: tip 13 | - go: 1.9.x 14 | - go: 1.8.x 15 | - go: 1.7.x 16 | - go: 1.6.x 17 | - go: 1.5.x 18 | allow_failures: 19 | - go: tip 20 | - go: 1.11.x 21 | - go: 1.10.x 22 | - go: 1.9.x 23 | - go: 1.8.x 24 | - go: 1.7.x 25 | - go: 1.6.x 26 | - go: 1.5.x 27 | script: ./test.sh $TEST_METHOD 28 | notifications: 29 | email: 30 | on_success: never 31 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/empty_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_empty_proto = "google/protobuf/empty.proto" 14 | 15 | // Names for google.protobuf.Empty. 16 | const ( 17 | Empty_message_name protoreflect.Name = "Empty" 18 | Empty_message_fullname protoreflect.FullName = "google.protobuf.Empty" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/support.go: -------------------------------------------------------------------------------- 1 | package instructions 2 | 3 | import "strings" 4 | 5 | // handleJSONArgs parses command passed to CMD, ENTRYPOINT, RUN and SHELL instruction in Dockerfile 6 | // for exec form it returns untouched args slice 7 | // for shell form it returns concatenated args as the first element of a slice 8 | func handleJSONArgs(args []string, attributes map[string]bool) []string { 9 | if len(args) == 0 { 10 | return []string{} 11 | } 12 | 13 | if attributes != nil && attributes["json"] { 14 | return args 15 | } 16 | 17 | // literal string command, not an exec array 18 | return []string{strings.Join(args, " ")} 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a golang project 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go 3 | 4 | name: Go 5 | 6 | on: 7 | push: 8 | branches: ["master"] 9 | pull_request: 10 | branches: ["master"] 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - name: Set up Go 19 | uses: actions/setup-go@v5 20 | with: 21 | go-version: "1.23" 22 | 23 | - name: Build 24 | run: go build -tags=dfrunsecurity -v ./... 25 | 26 | - name: Test 27 | run: go test -tags=dfrunsecurity -v ./... 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/enum.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | import ( 8 | "reflect" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | type EnumInfo struct { 14 | GoReflectType reflect.Type // int32 kind 15 | Desc protoreflect.EnumDescriptor 16 | } 17 | 18 | func (t *EnumInfo) New(n protoreflect.EnumNumber) protoreflect.Enum { 19 | return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(protoreflect.Enum) 20 | } 21 | func (t *EnumInfo) Descriptor() protoreflect.EnumDescriptor { return t.Desc } 22 | -------------------------------------------------------------------------------- /.github/workflows/goreleaser.yml: -------------------------------------------------------------------------------- 1 | name: goreleaser 2 | 3 | on: 4 | push: 5 | tags: 6 | - "*" 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | goreleaser: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v4 17 | with: 18 | fetch-depth: 0 19 | - name: Set up Go 20 | uses: actions/setup-go@v5 21 | with: 22 | go-version: stable 23 | - name: Run GoReleaser 24 | uses: goreleaser/goreleaser-action@v6 25 | with: 26 | distribution: goreleaser 27 | # 'latest', 'nightly', or a semver 28 | version: "~> v2" 29 | args: release --clean 30 | env: 31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /pkg/dockerfile/analyze.go: -------------------------------------------------------------------------------- 1 | package dockerfile 2 | 3 | func (d *Dockerfile) analyzeStages() { 4 | seenStageNames := make(map[string]int) 5 | for i, stage := range d.Stages { 6 | stageIndex, stageIndexOK := seenStageNames[stage.BaseName] 7 | switch { 8 | case stageIndexOK: 9 | stage.From.Stage = &FromStage{ 10 | Named: &stage.BaseName, 11 | Index: stageIndex, 12 | } 13 | case stage.BaseName == "scratch": 14 | stage.From.Scratch = true 15 | stage.From.Image = nil 16 | default: 17 | stage.From.Image = &stage.BaseName 18 | } 19 | if stage.Stage.Name != "" { 20 | stage.Name = &stage.Stage.Name 21 | seenStageNames[stage.Stage.Name] = i 22 | } 23 | for i, command := range stage.Commands { 24 | stage.Commands[i].Name = command.Command.Name() 25 | } 26 | } 27 | return 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore docs files 2 | _gh_pages 3 | _site 4 | 5 | # Ignore temporary files 6 | README.html 7 | coverage.out 8 | .tmp 9 | 10 | # Numerous always-ignore extensions 11 | *.diff 12 | *.err 13 | *.log 14 | *.orig 15 | *.rej 16 | *.swo 17 | *.swp 18 | *.vi 19 | *.zip 20 | *~ 21 | 22 | # OS or Editor folders 23 | ._* 24 | .cache 25 | .DS_Store 26 | .idea 27 | .project 28 | .settings 29 | .tmproj 30 | *.esproj 31 | *.sublime-project 32 | *.sublime-workspace 33 | nbproject 34 | Thumbs.db 35 | 36 | # Komodo 37 | .komodotools 38 | *.komodoproject 39 | 40 | # SCSS-Lint 41 | scss-lint-report.xml 42 | 43 | # grunt-contrib-sass cache 44 | .sass-cache 45 | 46 | # Jekyll metadata 47 | docs/.jekyll-metadata 48 | 49 | # Folders to ignore 50 | .build 51 | .test 52 | bower_components 53 | node_modules 54 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/goname.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | // Go names of implementation-specific struct fields in generated messages. 8 | const ( 9 | State_goname = "state" 10 | 11 | SizeCache_goname = "sizeCache" 12 | SizeCacheA_goname = "XXX_sizecache" 13 | 14 | WeakFields_goname = "weakFields" 15 | WeakFieldsA_goname = "XXX_weak" 16 | 17 | UnknownFields_goname = "unknownFields" 18 | UnknownFieldsA_goname = "XXX_unrecognized" 19 | 20 | ExtensionFields_goname = "extensionFields" 21 | ExtensionFieldsA_goname = "XXX_InternalExtensions" 22 | ExtensionFieldsB_goname = "XXX_extensions" 23 | 24 | WeakFieldPrefix_goname = "XXX_weak_" 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.12 6 | // +build !go1.12 7 | 8 | package impl 9 | 10 | import "reflect" 11 | 12 | type mapIter struct { 13 | v reflect.Value 14 | keys []reflect.Value 15 | } 16 | 17 | // mapRange provides a less-efficient equivalent to 18 | // the Go 1.12 reflect.Value.MapRange method. 19 | func mapRange(v reflect.Value) *mapIter { 20 | return &mapIter{v: v} 21 | } 22 | 23 | func (i *mapIter) Next() bool { 24 | if i.keys == nil { 25 | i.keys = i.v.MapKeys() 26 | } else { 27 | i.keys = i.keys[1:] 28 | } 29 | return len(i.keys) > 0 30 | } 31 | 32 | func (i *mapIter) Key() reflect.Value { 33 | return i.keys[0] 34 | } 35 | 36 | func (i *mapIter) Value() reflect.Value { 37 | return i.v.MapIndex(i.keys[0]) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anton Povarov 2 | Brian Goff 3 | Clayton Coleman 4 | Denis Smirnov 5 | DongYun Kang 6 | Dwayne Schultz 7 | Georg Apitz 8 | Gustav Paul 9 | Johan Brandhorst 10 | John Shahid 11 | John Tuley 12 | Laurent 13 | Patrick Lee 14 | Peter Edge 15 | Roger Johansson 16 | Sam Nguyen 17 | Sergio Arbeo 18 | Stephen J Day 19 | Tamir Duberstein 20 | Todd Eisenberger 21 | Tormod Erevik Lea 22 | Vyacheslav Kim 23 | Walter Schulze 24 | -------------------------------------------------------------------------------- /flagvar.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // AssignmentsMap is a `flag.Value` for `KEY=VALUE` arguments. 9 | type AssignmentsMap struct { 10 | Values map[string]*string 11 | Texts []string 12 | } 13 | 14 | // Help returns a string suitable for inclusion in a flag help message. 15 | func (fv *AssignmentsMap) Help() string { 16 | separator := "=" 17 | return fmt.Sprintf("a key/value pair KEY[%sVALUE]", separator) 18 | } 19 | 20 | // Set is flag.Value.Set 21 | func (fv *AssignmentsMap) Set(v string) error { 22 | separator := "=" 23 | fv.Texts = append(fv.Texts, v) 24 | if fv.Values == nil { 25 | fv.Values = make(map[string]*string) 26 | } 27 | i := strings.Index(v, separator) 28 | if i < 0 { 29 | fv.Values[v] = nil 30 | return nil 31 | } 32 | value := v[i+len(separator):] 33 | fv.Values[v[:i]] = &value 34 | return nil 35 | } 36 | 37 | func (fv *AssignmentsMap) String() string { 38 | return strings.Join(fv.Texts, ", ") 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.13 6 | // +build !go1.13 7 | 8 | package errors 9 | 10 | import "reflect" 11 | 12 | // Is is a copy of Go 1.13's errors.Is for use with older Go versions. 13 | func Is(err, target error) bool { 14 | if target == nil { 15 | return err == target 16 | } 17 | 18 | isComparable := reflect.TypeOf(target).Comparable() 19 | for { 20 | if isComparable && err == target { 21 | return true 22 | } 23 | if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { 24 | return true 25 | } 26 | if err = unwrap(err); err == nil { 27 | return false 28 | } 29 | } 30 | } 31 | 32 | func unwrap(err error) error { 33 | u, ok := err.(interface { 34 | Unwrap() error 35 | }) 36 | if !ok { 37 | return nil 38 | } 39 | return u.Unwrap() 40 | } 41 | -------------------------------------------------------------------------------- /pkg/dockerfile/types.go: -------------------------------------------------------------------------------- 1 | package dockerfile 2 | 3 | import ( 4 | "github.com/moby/buildkit/frontend/dockerfile/instructions" 5 | ) 6 | 7 | type Dockerfile struct { 8 | MetaArgs []*MetaArg 9 | Stages []*Stage 10 | } 11 | 12 | type MetaArg struct { 13 | instructions.ArgCommand `json:"-"` 14 | Key string 15 | DefaultValue *string 16 | ProvidedValue *string 17 | Value *string 18 | } 19 | 20 | type From struct { 21 | Stage *FromStage `json:",omitempty"` 22 | Scratch bool `json:",omitempty"` 23 | Image *string `json:",omitempty"` 24 | } 25 | 26 | type FromStage struct { 27 | Named *string `json:",omitempty"` 28 | Index int 29 | } 30 | 31 | type Command struct { 32 | instructions.Command 33 | Name string 34 | Mounts []*instructions.Mount 35 | NetworkMode instructions.NetworkMode 36 | Security string 37 | } 38 | 39 | type Stage struct { 40 | instructions.Stage 41 | Name *string `json:"As,omitempty"` 42 | From From 43 | Commands []*Command 44 | } 45 | -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://goreleaser.com/static/schema.json 2 | # vim: set ts=2 sw=2 tw=0 fo=cnqoj 3 | 4 | version: 2 5 | 6 | before: 7 | hooks: 8 | # You may remove this if you don't use go modules. 9 | - go mod tidy 10 | - go mod vendor 11 | 12 | builds: 13 | - tags: 14 | - dfrunsecurity 15 | env: 16 | - CGO_ENABLED=0 17 | goos: 18 | - linux 19 | - windows 20 | - darwin 21 | 22 | archives: 23 | - format: tar.gz 24 | # this name template makes the OS and Arch compatible with the results of `uname`. 25 | name_template: >- 26 | {{ .ProjectName }}_ 27 | {{- title .Os }}_ 28 | {{- if eq .Arch "amd64" }}x86_64 29 | {{- else if eq .Arch "386" }}i386 30 | {{- else }}{{ .Arch }}{{ end }} 31 | {{- if .Arm }}v{{ .Arm }}{{ end }} 32 | # use zip for windows archives 33 | format_overrides: 34 | - goos: windows 35 | format: zip 36 | 37 | changelog: 38 | sort: asc 39 | filters: 40 | exclude: 41 | - "^docs:" 42 | - "^test:" 43 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/versioned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | // Versioned provides a struct with the manifest schemaVersion and mediaType. 18 | // Incoming content with unknown schema version can be decoded against this 19 | // struct to check the version. 20 | type Versioned struct { 21 | // SchemaVersion is the image manifest schema that this image follows 22 | SchemaVersion int `json:"schemaVersion"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_field_mask_proto = "google/protobuf/field_mask.proto" 14 | 15 | // Names for google.protobuf.FieldMask. 16 | const ( 17 | FieldMask_message_name protoreflect.Name = "FieldMask" 18 | FieldMask_message_fullname protoreflect.FullName = "google.protobuf.FieldMask" 19 | ) 20 | 21 | // Field names for google.protobuf.FieldMask. 22 | const ( 23 | FieldMask_Paths_field_name protoreflect.Name = "paths" 24 | 25 | FieldMask_Paths_field_fullname protoreflect.FullName = "google.protobuf.FieldMask.paths" 26 | ) 27 | 28 | // Field numbers for google.protobuf.FieldMask. 29 | const ( 30 | FieldMask_Paths_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/shell/wordsTest: -------------------------------------------------------------------------------- 1 | hello | hello 2 | hello${hi}bye | hellobye 3 | ENV hi=hi 4 | hello${hi}bye | hellohibye 5 | ENV space=abc def 6 | hello${space}bye | helloabc,defbye 7 | hello"${space}"bye | helloabc defbye 8 | hello "${space}"bye | hello,abc defbye 9 | ENV leading= ab c 10 | hello${leading}def | hello,ab,cdef 11 | hello"${leading}" def | hello ab c,def 12 | hello"${leading}" | hello ab c 13 | hello${leading} | hello,ab,c 14 | # next line MUST have 3 trailing spaces, don't erase them! 15 | ENV trailing=ab c 16 | hello${trailing} | helloab,c 17 | hello${trailing}d | helloab,c,d 18 | hello"${trailing}"d | helloab c d 19 | # next line MUST have 3 trailing spaces, don't erase them! 20 | hel"lo${trailing}" | helloab c 21 | hello" there " | hello there 22 | hello there | hello,there 23 | hello\ there | hello there 24 | hello" there | error 25 | hello\" there | hello",there 26 | hello"\\there" | hello\there 27 | hello"\there" | hello\there 28 | hello'\\there' | hello\\there 29 | hello'\there' | hello\there 30 | hello'$there' | hello$there 31 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/Makefile: -------------------------------------------------------------------------------- 1 | PKGS := github.com/pkg/errors 2 | SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) 3 | GO := go 4 | 5 | check: test vet gofmt misspell unconvert staticcheck ineffassign unparam 6 | 7 | test: 8 | $(GO) test $(PKGS) 9 | 10 | vet: | test 11 | $(GO) vet $(PKGS) 12 | 13 | staticcheck: 14 | $(GO) get honnef.co/go/tools/cmd/staticcheck 15 | staticcheck -checks all $(PKGS) 16 | 17 | misspell: 18 | $(GO) get github.com/client9/misspell/cmd/misspell 19 | misspell \ 20 | -locale GB \ 21 | -error \ 22 | *.md *.go 23 | 24 | unconvert: 25 | $(GO) get github.com/mdempsky/unconvert 26 | unconvert -v $(PKGS) 27 | 28 | ineffassign: 29 | $(GO) get github.com/gordonklaus/ineffassign 30 | find $(SRCDIRS) -name '*.go' | xargs ineffassign 31 | 32 | pedantic: check errcheck 33 | 34 | unparam: 35 | $(GO) get mvdan.cc/unparam 36 | unparam ./... 37 | 38 | errcheck: 39 | $(GO) get github.com/kisielk/errcheck 40 | errcheck $(PKGS) 41 | 42 | gofmt: 43 | @echo Checking code is gofmted 44 | @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" 45 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/keilerkonzept/dockerfile-json 2 | 3 | go 1.23 4 | 5 | toolchain go1.23.1 6 | 7 | require ( 8 | github.com/moby/buildkit v0.19.0 9 | github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 10 | ) 11 | 12 | require ( 13 | github.com/agext/levenshtein v1.2.3 // indirect 14 | github.com/containerd/typeurl/v2 v2.2.3 // indirect 15 | github.com/docker/go-units v0.5.0 // indirect 16 | github.com/gogo/protobuf v1.3.2 // indirect 17 | github.com/moby/docker-image-spec v1.3.1 // indirect 18 | github.com/opencontainers/go-digest v1.0.0 // indirect 19 | github.com/opencontainers/image-spec v1.1.0 // indirect 20 | github.com/pkg/errors v0.9.1 // indirect 21 | github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect 22 | github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect 23 | google.golang.org/protobuf v1.35.2 // indirect 24 | ) 25 | 26 | replace ( 27 | github.com/containerd/containerd => github.com/containerd/containerd v1.7.22 28 | github.com/docker/docker/v23/v20 => github.com/docker/docker v27.3.1+incompatible 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_source_context_proto = "google/protobuf/source_context.proto" 14 | 15 | // Names for google.protobuf.SourceContext. 16 | const ( 17 | SourceContext_message_name protoreflect.Name = "SourceContext" 18 | SourceContext_message_fullname protoreflect.FullName = "google.protobuf.SourceContext" 19 | ) 20 | 21 | // Field names for google.protobuf.SourceContext. 22 | const ( 23 | SourceContext_FileName_field_name protoreflect.Name = "file_name" 24 | 25 | SourceContext_FileName_field_fullname protoreflect.FullName = "google.protobuf.SourceContext.file_name" 26 | ) 27 | 28 | // Field numbers for google.protobuf.SourceContext. 29 | const ( 30 | SourceContext_FileName_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Keilerkonzept UG (haftungsbeschränkt) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/tonistiigi/go-csvvalue/LICENSE: -------------------------------------------------------------------------------- 1 | MIT 2 | 3 | Copyright 2024 Tõnis Tiigi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/any_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_any_proto = "google/protobuf/any.proto" 14 | 15 | // Names for google.protobuf.Any. 16 | const ( 17 | Any_message_name protoreflect.Name = "Any" 18 | Any_message_fullname protoreflect.FullName = "google.protobuf.Any" 19 | ) 20 | 21 | // Field names for google.protobuf.Any. 22 | const ( 23 | Any_TypeUrl_field_name protoreflect.Name = "type_url" 24 | Any_Value_field_name protoreflect.Name = "value" 25 | 26 | Any_TypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Any.type_url" 27 | Any_Value_field_fullname protoreflect.FullName = "google.protobuf.Any.value" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Any. 31 | const ( 32 | Any_TypeUrl_field_number protoreflect.FieldNumber = 1 33 | Any_Value_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/command/command.go: -------------------------------------------------------------------------------- 1 | // Package command contains the set of Dockerfile commands. 2 | package command 3 | 4 | // Define constants for the command strings 5 | const ( 6 | Add = "add" 7 | Arg = "arg" 8 | Cmd = "cmd" 9 | Copy = "copy" 10 | Entrypoint = "entrypoint" 11 | Env = "env" 12 | Expose = "expose" 13 | From = "from" 14 | Healthcheck = "healthcheck" 15 | Label = "label" 16 | Maintainer = "maintainer" 17 | Onbuild = "onbuild" 18 | Run = "run" 19 | Shell = "shell" 20 | StopSignal = "stopsignal" 21 | User = "user" 22 | Volume = "volume" 23 | Workdir = "workdir" 24 | ) 25 | 26 | // Commands is list of all Dockerfile commands 27 | var Commands = map[string]struct{}{ 28 | Add: {}, 29 | Arg: {}, 30 | Cmd: {}, 31 | Copy: {}, 32 | Entrypoint: {}, 33 | Env: {}, 34 | Expose: {}, 35 | From: {}, 36 | Healthcheck: {}, 37 | Label: {}, 38 | Maintainer: {}, 39 | Onbuild: {}, 40 | Run: {}, 41 | Shell: {}, 42 | StopSignal: {}, 43 | User: {}, 44 | Volume: {}, 45 | Workdir: {}, 46 | } 47 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package flags provides a set of flags controlled by build tags. 6 | package flags 7 | 8 | // ProtoLegacy specifies whether to enable support for legacy functionality 9 | // such as MessageSets, weak fields, and various other obscure behavior 10 | // that is necessary to maintain backwards compatibility with proto1 or 11 | // the pre-release variants of proto2 and proto3. 12 | // 13 | // This is disabled by default unless built with the "protolegacy" tag. 14 | // 15 | // WARNING: The compatibility agreement covers nothing provided by this flag. 16 | // As such, functionality may suddenly be removed or changed at our discretion. 17 | const ProtoLegacy = protoLegacy 18 | 19 | // LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions. 20 | // 21 | // Lazy extension unmarshaling validates the contents of message-valued 22 | // extension fields at unmarshal time, but defers creating the message 23 | // structure until the extension is first accessed. 24 | const LazyUnmarshalExtensions = ProtoLegacy 25 | -------------------------------------------------------------------------------- /vendor/github.com/tonistiigi/go-csvvalue/Dockerfile: -------------------------------------------------------------------------------- 1 | #syntax=docker/dockerfile:1.8 2 | #check=error=true 3 | 4 | ARG GO_VERSION=1.22 5 | ARG XX_VERSION=1.4.0 6 | 7 | ARG COVER_FILENAME="cover.out" 8 | ARG BENCH_FILENAME="bench.txt" 9 | 10 | FROM --platform=${BUILDPLATFORM} tonistiigi/xx:${XX_VERSION} AS xx 11 | 12 | FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION}-alpine AS golang 13 | COPY --link --from=xx / / 14 | WORKDIR /src 15 | ARG TARGETPLATFORM 16 | 17 | FROM golang AS build 18 | RUN --mount=target=/root/.cache,type=cache \ 19 | --mount=type=bind xx-go build . 20 | 21 | FROM golang AS runbench 22 | ARG BENCH_FILENAME 23 | RUN --mount=target=/root/.cache,type=cache \ 24 | --mount=type=bind \ 25 | xx-go test -v --run skip --bench . | tee /tmp/${BENCH_FILENAME} 26 | 27 | FROM scratch AS bench 28 | ARG BENCH_FILENAME 29 | COPY --from=runbench /tmp/${BENCH_FILENAME} / 30 | 31 | FROM golang AS runtest 32 | ARG TESTFLAGS="-v" 33 | ARG COVER_FILENAME 34 | RUN --mount=target=/root/.cache,type=cache \ 35 | --mount=type=bind \ 36 | xx-go test -coverprofile=/tmp/${COVER_FILENAME} $TESTFLAGS . 37 | 38 | FROM scratch AS test 39 | ARG COVER_FILENAME 40 | COPY --from=runtest /tmp/${COVER_FILENAME} / 41 | 42 | FROM build 43 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/reset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "fmt" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | // Reset clears every field in the message. 14 | // The resulting message shares no observable memory with its previous state 15 | // other than the memory for the message itself. 16 | func Reset(m Message) { 17 | if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods { 18 | mr.Reset() 19 | return 20 | } 21 | resetMessage(m.ProtoReflect()) 22 | } 23 | 24 | func resetMessage(m protoreflect.Message) { 25 | if !m.IsValid() { 26 | panic(fmt.Sprintf("cannot reset invalid %v message", m.Descriptor().FullName())) 27 | } 28 | 29 | // Clear all known fields. 30 | fds := m.Descriptor().Fields() 31 | for i := 0; i < fds.Len(); i++ { 32 | m.Clear(fds.Get(i)) 33 | } 34 | 35 | // Clear extension fields. 36 | m.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { 37 | m.Clear(fd) 38 | return true 39 | }) 40 | 41 | // Clear unknown fields. 42 | m.SetUnknown(nil) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int32 stores v in a new int32 value and returns a pointer to it. 11 | func Int32(v int32) *int32 { return &v } 12 | 13 | // Int64 stores v in a new int64 value and returns a pointer to it. 14 | func Int64(v int64) *int64 { return &v } 15 | 16 | // Float32 stores v in a new float32 value and returns a pointer to it. 17 | func Float32(v float32) *float32 { return &v } 18 | 19 | // Float64 stores v in a new float64 value and returns a pointer to it. 20 | func Float64(v float64) *float64 { return &v } 21 | 22 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 23 | func Uint32(v uint32) *uint32 { return &v } 24 | 25 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 26 | func Uint64(v uint64) *uint64 { return &v } 27 | 28 | // String stores v in a new string value and returns a pointer to it. 29 | func String(v string) *string { return &v } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/duration.go: -------------------------------------------------------------------------------- 1 | // Package units provides helper function to parse and print size and time units 2 | // in human-readable format. 3 | package units 4 | 5 | import ( 6 | "fmt" 7 | "time" 8 | ) 9 | 10 | // HumanDuration returns a human-readable approximation of a duration 11 | // (eg. "About a minute", "4 hours ago", etc.). 12 | func HumanDuration(d time.Duration) string { 13 | if seconds := int(d.Seconds()); seconds < 1 { 14 | return "Less than a second" 15 | } else if seconds == 1 { 16 | return "1 second" 17 | } else if seconds < 60 { 18 | return fmt.Sprintf("%d seconds", seconds) 19 | } else if minutes := int(d.Minutes()); minutes == 1 { 20 | return "About a minute" 21 | } else if minutes < 60 { 22 | return fmt.Sprintf("%d minutes", minutes) 23 | } else if hours := int(d.Hours() + 0.5); hours == 1 { 24 | return "About an hour" 25 | } else if hours < 48 { 26 | return fmt.Sprintf("%d hours", hours) 27 | } else if hours < 24*7*2 { 28 | return fmt.Sprintf("%d days", hours/24) 29 | } else if hours < 24*30*2 { 30 | return fmt.Sprintf("%d weeks", hours/24/7) 31 | } else if hours < 24*365*2 { 32 | return fmt.Sprintf("%d months", hours/24/30) 33 | } 34 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/pragma/pragma.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package pragma provides types that can be embedded into a struct to 6 | // statically enforce or prevent certain language properties. 7 | package pragma 8 | 9 | import "sync" 10 | 11 | // NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals. 12 | type NoUnkeyedLiterals struct{} 13 | 14 | // DoNotImplement can be embedded in an interface to prevent trivial 15 | // implementations of the interface. 16 | // 17 | // This is useful to prevent unauthorized implementations of an interface 18 | // so that it can be extended in the future for any protobuf language changes. 19 | type DoNotImplement interface{ ProtoInternal(DoNotImplement) } 20 | 21 | // DoNotCompare can be embedded in a struct to prevent comparability. 22 | type DoNotCompare [0]func() 23 | 24 | // DoNotCopy can be embedded in a struct to help prevent shallow copies. 25 | // This does not rely on a Go language feature, but rather a special case 26 | // within the vet checker. 27 | // 28 | // See https://golang.org/issues/8005. 29 | type DoNotCopy [0]sync.Mutex 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/duration_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_duration_proto = "google/protobuf/duration.proto" 14 | 15 | // Names for google.protobuf.Duration. 16 | const ( 17 | Duration_message_name protoreflect.Name = "Duration" 18 | Duration_message_fullname protoreflect.FullName = "google.protobuf.Duration" 19 | ) 20 | 21 | // Field names for google.protobuf.Duration. 22 | const ( 23 | Duration_Seconds_field_name protoreflect.Name = "seconds" 24 | Duration_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Duration_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Duration.seconds" 27 | Duration_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Duration.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Duration. 31 | const ( 32 | Duration_Seconds_field_number protoreflect.FieldNumber = 1 33 | Duration_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | import "fmt" 18 | 19 | const ( 20 | // VersionMajor is for an API incompatible changes 21 | VersionMajor = 1 22 | // VersionMinor is for functionality in a backwards-compatible manner 23 | VersionMinor = 1 24 | // VersionPatch is for backwards-compatible bug fixes 25 | VersionPatch = 0 26 | 27 | // VersionDev indicates development branch. Releases will be empty string. 28 | VersionDev = "" 29 | ) 30 | 31 | // Version is the specification version that the package types support. 32 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 33 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_timestamp_proto = "google/protobuf/timestamp.proto" 14 | 15 | // Names for google.protobuf.Timestamp. 16 | const ( 17 | Timestamp_message_name protoreflect.Name = "Timestamp" 18 | Timestamp_message_fullname protoreflect.FullName = "google.protobuf.Timestamp" 19 | ) 20 | 21 | // Field names for google.protobuf.Timestamp. 22 | const ( 23 | Timestamp_Seconds_field_name protoreflect.Name = "seconds" 24 | Timestamp_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Timestamp_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.seconds" 27 | Timestamp_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Timestamp. 31 | const ( 32 | Timestamp_Seconds_field_number protoreflect.FieldNumber = 1 33 | Timestamp_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/MAINTAINERS: -------------------------------------------------------------------------------- 1 | # go-units maintainers file 2 | # 3 | # This file describes who runs the docker/go-units project and how. 4 | # This is a living document - if you see something out of date or missing, speak up! 5 | # 6 | # It is structured to be consumable by both humans and programs. 7 | # To extract its contents programmatically, use any TOML-compliant parser. 8 | # 9 | # This file is compiled into the MAINTAINERS file in docker/opensource. 10 | # 11 | [Org] 12 | [Org."Core maintainers"] 13 | people = [ 14 | "akihirosuda", 15 | "dnephin", 16 | "thajeztah", 17 | "vdemeester", 18 | ] 19 | 20 | [people] 21 | 22 | # A reference list of all people associated with the project. 23 | # All other sections should refer to people by their canonical key 24 | # in the people section. 25 | 26 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 27 | 28 | [people.akihirosuda] 29 | Name = "Akihiro Suda" 30 | Email = "akihiro.suda.cz@hco.ntt.co.jp" 31 | GitHub = "AkihiroSuda" 32 | 33 | [people.dnephin] 34 | Name = "Daniel Nephin" 35 | Email = "dnephin@gmail.com" 36 | GitHub = "dnephin" 37 | 38 | [people.thajeztah] 39 | Name = "Sebastiaan van Stijn" 40 | Email = "github@gone.nl" 41 | GitHub = "thaJeztah" 42 | 43 | [people.vdemeester] 44 | Name = "Vincent Demeester" 45 | Email = "vincent@sbr.pm" 46 | GitHub = "vdemeester" -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/descopts/options.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package descopts contains the nil pointers to concrete descriptor options. 6 | // 7 | // This package exists as a form of reverse dependency injection so that certain 8 | // packages (e.g., internal/filedesc and internal/filetype can avoid a direct 9 | // dependency on the descriptor proto package). 10 | package descopts 11 | 12 | import "google.golang.org/protobuf/reflect/protoreflect" 13 | 14 | // These variables are set by the init function in descriptor.pb.go via logic 15 | // in internal/filetype. In other words, so long as the descriptor proto package 16 | // is linked in, these variables will be populated. 17 | // 18 | // Each variable is populated with a nil pointer to the options struct. 19 | var ( 20 | File protoreflect.ProtoMessage 21 | Enum protoreflect.ProtoMessage 22 | EnumValue protoreflect.ProtoMessage 23 | Message protoreflect.ProtoMessage 24 | Field protoreflect.ProtoMessage 25 | Oneof protoreflect.ProtoMessage 26 | ExtensionRange protoreflect.ProtoMessage 27 | Service protoreflect.ProtoMessage 28 | Method protoreflect.ProtoMessage 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/errors_windows.go: -------------------------------------------------------------------------------- 1 | package instructions 2 | 3 | import ( 4 | "fmt" 5 | "path/filepath" 6 | "regexp" 7 | "strings" 8 | 9 | "github.com/pkg/errors" 10 | ) 11 | 12 | func errNotJSON(command, original string) error { 13 | // For Windows users, give a hint if it looks like it might contain 14 | // a path which hasn't been escaped such as ["c:\windows\system32\prog.exe", "-param"], 15 | // as JSON must be escaped. Unfortunate... 16 | // 17 | // Specifically looking for quote-driveletter-colon-backslash, there's no 18 | // double backslash and a [] pair. No, this is not perfect, but it doesn't 19 | // have to be. It's simply a hint to make life a little easier. 20 | extra := "" 21 | original = filepath.FromSlash(strings.ToLower(strings.ReplaceAll(strings.ToLower(original), strings.ToLower(command)+" ", ""))) 22 | if len(regexp.MustCompile(`"[a-z]:\\.*`).FindStringSubmatch(original)) > 0 && 23 | !strings.Contains(original, `\\`) && 24 | strings.Contains(original, "[") && 25 | strings.Contains(original, "]") { 26 | extra = fmt.Sprintf(`. It looks like '%s' includes a file path without an escaped back-slash. JSON requires back-slashes to be escaped such as ["c:\\path\\to\\file.exe", "/parameter"]`, original) 27 | } 28 | return errors.Errorf("%s requires the arguments to be in JSON form%s", command, extra) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/util/stack/compress.go: -------------------------------------------------------------------------------- 1 | package stack 2 | 3 | import ( 4 | "slices" 5 | ) 6 | 7 | func compressStacks(st []*Stack) []*Stack { 8 | if len(st) == 0 { 9 | return nil 10 | } 11 | 12 | slices.SortFunc(st, func(a, b *Stack) int { 13 | return len(b.Frames) - len(a.Frames) 14 | }) 15 | 16 | out := []*Stack{st[0]} 17 | 18 | loop0: 19 | for _, st := range st[1:] { 20 | maxIdx := -1 21 | for _, prev := range out { 22 | idx := subFrames(st.Frames, prev.Frames) 23 | if idx == -1 { 24 | continue 25 | } 26 | // full match, potentially skip all 27 | if idx == len(st.Frames)-1 { 28 | if st.Pid == prev.Pid && st.Version == prev.Version && slices.Compare(st.Cmdline, st.Cmdline) == 0 { 29 | continue loop0 30 | } 31 | } 32 | if idx > maxIdx { 33 | maxIdx = idx 34 | } 35 | } 36 | 37 | if maxIdx > 0 { 38 | st.Frames = st.Frames[:len(st.Frames)-maxIdx] 39 | } 40 | out = append(out, st) 41 | } 42 | 43 | return out 44 | } 45 | 46 | func subFrames(a, b []*Frame) int { 47 | idx := -1 48 | i := len(a) - 1 49 | j := len(b) - 1 50 | for i >= 0 { 51 | if j < 0 { 52 | break 53 | } 54 | if a[i].Equal(b[j]) { 55 | idx++ 56 | i-- 57 | j-- 58 | } else { 59 | break 60 | } 61 | } 62 | return idx 63 | } 64 | 65 | func (a *Frame) Equal(b *Frame) bool { 66 | return a.File == b.File && a.Line == b.Line && a.Name == b.Name 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, 2020 OCI Contributors 2 | // Copyright 2017 Docker, Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | package digest 17 | 18 | import "hash" 19 | 20 | // Digester calculates the digest of written data. Writes should go directly 21 | // to the return value of Hash, while calling Digest will return the current 22 | // value of the digest. 23 | type Digester interface { 24 | Hash() hash.Hash // provides direct access to underlying hash instance. 25 | Digest() Digest 26 | } 27 | 28 | // digester provides a simple digester definition that embeds a hasher. 29 | type digester struct { 30 | alg Algorithm 31 | hash hash.Hash 32 | } 33 | 34 | func (d *digester) Hash() hash.Hash { 35 | return d.hash 36 | } 37 | 38 | func (d *digester) Digest() Digest { 39 | return NewDigest(d.alg, d.hash) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | const ( 18 | // ImageLayoutFile is the file name containing ImageLayout in an OCI Image Layout 19 | ImageLayoutFile = "oci-layout" 20 | // ImageLayoutVersion is the version of ImageLayout 21 | ImageLayoutVersion = "1.0.0" 22 | // ImageIndexFile is the file name of the entry point for references and descriptors in an OCI Image Layout 23 | ImageIndexFile = "index.json" 24 | // ImageBlobsDir is the directory name containing content addressable blobs in an OCI Image Layout 25 | ImageBlobsDir = "blobs" 26 | ) 27 | 28 | // ImageLayout is the structure in the "oci-layout" file, found in the root 29 | // of an OCI Image-layout directory. 30 | type ImageLayout struct { 31 | Version string `json:"imageLayoutVersion"` 32 | } 33 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/set/ints.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package set provides simple set data structures for uint64s. 6 | package set 7 | 8 | import "math/bits" 9 | 10 | // int64s represents a set of integers within the range of 0..63. 11 | type int64s uint64 12 | 13 | func (bs *int64s) Len() int { 14 | return bits.OnesCount64(uint64(*bs)) 15 | } 16 | func (bs *int64s) Has(n uint64) bool { 17 | return uint64(*bs)&(uint64(1)< 0 18 | } 19 | func (bs *int64s) Set(n uint64) { 20 | *(*uint64)(bs) |= uint64(1) << n 21 | } 22 | func (bs *int64s) Clear(n uint64) { 23 | *(*uint64)(bs) &^= uint64(1) << n 24 | } 25 | 26 | // Ints represents a set of integers within the range of 0..math.MaxUint64. 27 | type Ints struct { 28 | lo int64s 29 | hi map[uint64]struct{} 30 | } 31 | 32 | func (bs *Ints) Len() int { 33 | return bs.lo.Len() + len(bs.hi) 34 | } 35 | func (bs *Ints) Has(n uint64) bool { 36 | if n < 64 { 37 | return bs.lo.Has(n) 38 | } 39 | _, ok := bs.hi[n] 40 | return ok 41 | } 42 | func (bs *Ints) Set(n uint64) { 43 | if n < 64 { 44 | bs.lo.Set(n) 45 | return 46 | } 47 | if bs.hi == nil { 48 | bs.hi = make(map[uint64]struct{}) 49 | } 50 | bs.hi[n] = struct{}{} 51 | } 52 | func (bs *Ints) Clear(n uint64) { 53 | if n < 64 { 54 | bs.lo.Clear(n) 55 | return 56 | } 57 | delete(bs.hi, n) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/tonistiigi/go-csvvalue/docker-bake.hcl: -------------------------------------------------------------------------------- 1 | variable "COVER_FILENAME" { 2 | default = null 3 | } 4 | 5 | variable "BENCH_FILENAME" { 6 | default = null 7 | } 8 | 9 | variable "GO_VERSION" { 10 | default = null 11 | } 12 | 13 | target "default" { 14 | targets = ["build"] 15 | } 16 | 17 | target "_all_platforms" { 18 | platforms = [ 19 | "linux/amd64", 20 | "linux/arm64", 21 | "linux/arm/v7", 22 | "linux/arm/v6", 23 | "linux/386", 24 | "linux/ppc64le", 25 | "linux/s390x", 26 | "darwin/amd64", 27 | "darwin/arm64", 28 | "windows/amd64", 29 | ] 30 | } 31 | 32 | target "build" { 33 | output = ["type=cacheonly"] 34 | args = { 35 | GO_VERSION = GO_VERSION 36 | } 37 | } 38 | 39 | target "build-all" { 40 | inherits = ["build", "_all_platforms"] 41 | } 42 | 43 | target "test" { 44 | target = "test" 45 | args = { 46 | COVER_FILENAME = COVER_FILENAME 47 | GO_VERSION = GO_VERSION 48 | } 49 | output = [COVER_FILENAME!=null?".":"type=cacheonly"] 50 | } 51 | 52 | target "bench" { 53 | target = "bench" 54 | args = { 55 | BENCH_FILENAME = BENCH_FILENAME 56 | GO_VERSION = GO_VERSION 57 | } 58 | output = [BENCH_FILENAME!=null?".":"type=cacheonly"] 59 | } 60 | 61 | target "lint" { 62 | dockerfile = "hack/dockerfiles/lint.Dockerfile" 63 | output = ["type=cacheonly"] 64 | } 65 | 66 | target "lint-all" { 67 | inherits = ["lint", "_all_platforms"] 68 | } -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/verifiers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, 2020 OCI Contributors 2 | // Copyright 2017 Docker, Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | package digest 17 | 18 | import ( 19 | "hash" 20 | "io" 21 | ) 22 | 23 | // Verifier presents a general verification interface to be used with message 24 | // digests and other byte stream verifications. Users instantiate a Verifier 25 | // from one of the various methods, write the data under test to it then check 26 | // the result with the Verified method. 27 | type Verifier interface { 28 | io.Writer 29 | 30 | // Verified will return true if the content written to Verifier matches 31 | // the digest. 32 | Verified() bool 33 | } 34 | 35 | type hashVerifier struct { 36 | digest Digest 37 | hash hash.Hash 38 | } 39 | 40 | func (hv hashVerifier) Write(p []byte) (n int, err error) { 41 | return hv.hash.Write(p) 42 | } 43 | 44 | func (hv hashVerifier) Verified() bool { 45 | return hv.digest == NewDigest(hv.digest.Algorithm(), hv.hash) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/DCO: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 660 York Street, Suite 102, 6 | San Francisco, CA 94110 USA 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this 9 | license document, but changing it is not allowed. 10 | 11 | 12 | Developer's Certificate of Origin 1.1 13 | 14 | By making a contribution to this project, I certify that: 15 | 16 | (a) The contribution was created in whole or in part by me and I 17 | have the right to submit it under the open source license 18 | indicated in the file; or 19 | 20 | (b) The contribution is based upon previous work that, to the best 21 | of my knowledge, is covered under an appropriate open source 22 | license and I have the right under that license to submit that 23 | work with modifications, whether created in whole or in part 24 | by me, under the same open source license (unless I am 25 | permitted to submit under a different license), as indicated 26 | in the file; or 27 | 28 | (c) The contribution was provided directly to me by some other 29 | person who certified (a), (b) or (c) and I have not modified 30 | it. 31 | 32 | (d) I understand and agree that this project and the contribution 33 | are public and that a record of the contribution (including all 34 | personal information I submit with it, including my sign-off) is 35 | maintained indefinitely and may be redistributed consistent with 36 | this project or the open source license(s) involved. 37 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/commands_runsecurity.go: -------------------------------------------------------------------------------- 1 | //go:build dfrunsecurity 2 | 3 | package instructions 4 | 5 | import ( 6 | "github.com/pkg/errors" 7 | ) 8 | 9 | const ( 10 | SecurityInsecure = "insecure" 11 | SecuritySandbox = "sandbox" 12 | ) 13 | 14 | var allowedSecurity = map[string]struct{}{ 15 | SecurityInsecure: {}, 16 | SecuritySandbox: {}, 17 | } 18 | 19 | func isValidSecurity(value string) bool { 20 | _, ok := allowedSecurity[value] 21 | return ok 22 | } 23 | 24 | var securityKey = "dockerfile/run/security" 25 | 26 | func init() { 27 | parseRunPreHooks = append(parseRunPreHooks, runSecurityPreHook) 28 | parseRunPostHooks = append(parseRunPostHooks, runSecurityPostHook) 29 | } 30 | 31 | func runSecurityPreHook(cmd *RunCommand, req parseRequest) error { 32 | st := &securityState{} 33 | st.flag = req.flags.AddString("security", SecuritySandbox) 34 | cmd.setExternalValue(securityKey, st) 35 | return nil 36 | } 37 | 38 | func runSecurityPostHook(cmd *RunCommand, req parseRequest) error { 39 | st := cmd.getExternalValue(securityKey).(*securityState) 40 | if st == nil { 41 | return errors.Errorf("no security state") 42 | } 43 | 44 | value := st.flag.Value 45 | if !isValidSecurity(value) { 46 | return errors.Errorf("security %q is not valid", value) 47 | } 48 | 49 | st.security = value 50 | 51 | return nil 52 | } 53 | 54 | func GetSecurity(cmd *RunCommand) string { 55 | return cmd.getExternalValue(securityKey).(*securityState).security 56 | } 57 | 58 | type securityState struct { 59 | flag *Flag 60 | security string 61 | } 62 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/encoding/text/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package text implements the text format for protocol buffers. 6 | // This package has no semantic understanding for protocol buffers and is only 7 | // a parser and composer for the format. 8 | // 9 | // There is no formal specification for the protobuf text format, as such the 10 | // C++ implementation (see google::protobuf::TextFormat) is the reference 11 | // implementation of the text format. 12 | // 13 | // This package is neither a superset nor a subset of the C++ implementation. 14 | // This implementation permits a more liberal grammar in some cases to be 15 | // backwards compatible with the historical Go implementation. 16 | // Future parsings unique to Go should not be added. 17 | // Some grammars allowed by the C++ implementation are deliberately 18 | // not implemented here because they are considered a bug by the protobuf team 19 | // and should not be replicated. 20 | // 21 | // The Go implementation should implement a sufficient amount of the C++ 22 | // grammar such that the default text serialization by C++ can be parsed by Go. 23 | // However, just because the C++ parser accepts some input does not mean that 24 | // the Go implementation should as well. 25 | // 26 | // The text format is almost a superset of JSON except: 27 | // - message keys are not quoted strings, but identifiers 28 | // - the top-level value must be a message without the delimiters 29 | package text 30 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/go113.go: -------------------------------------------------------------------------------- 1 | // +build go1.13 2 | 3 | package errors 4 | 5 | import ( 6 | stderrors "errors" 7 | ) 8 | 9 | // Is reports whether any error in err's chain matches target. 10 | // 11 | // The chain consists of err itself followed by the sequence of errors obtained by 12 | // repeatedly calling Unwrap. 13 | // 14 | // An error is considered to match a target if it is equal to that target or if 15 | // it implements a method Is(error) bool such that Is(target) returns true. 16 | func Is(err, target error) bool { return stderrors.Is(err, target) } 17 | 18 | // As finds the first error in err's chain that matches target, and if so, sets 19 | // target to that error value and returns true. 20 | // 21 | // The chain consists of err itself followed by the sequence of errors obtained by 22 | // repeatedly calling Unwrap. 23 | // 24 | // An error matches target if the error's concrete value is assignable to the value 25 | // pointed to by target, or if the error has a method As(interface{}) bool such that 26 | // As(target) returns true. In the latter case, the As method is responsible for 27 | // setting target. 28 | // 29 | // As will panic if target is not a non-nil pointer to either a type that implements 30 | // error, or to any interface type. As returns false if err is nil. 31 | func As(err error, target interface{}) bool { return stderrors.As(err, target) } 32 | 33 | // Unwrap returns the result of calling the Unwrap method on err, if err's 34 | // type contains an Unwrap method returning error. 35 | // Otherwise, Unwrap returns nil. 36 | func Unwrap(err error) error { 37 | return stderrors.Unwrap(err) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/typeurl/v2/README.md: -------------------------------------------------------------------------------- 1 | # typeurl 2 | 3 | [![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/typeurl)](https://pkg.go.dev/github.com/containerd/typeurl) 4 | [![Build Status](https://github.com/containerd/typeurl/workflows/CI/badge.svg)](https://github.com/containerd/typeurl/actions?query=workflow%3ACI) 5 | [![codecov](https://codecov.io/gh/containerd/typeurl/branch/main/graph/badge.svg)](https://codecov.io/gh/containerd/typeurl) 6 | [![Go Report Card](https://goreportcard.com/badge/github.com/containerd/typeurl)](https://goreportcard.com/report/github.com/containerd/typeurl) 7 | 8 | A Go package for managing the registration, marshaling, and unmarshaling of encoded types. 9 | 10 | This package helps when types are sent over a ttrpc/GRPC API and marshaled as a protobuf [Any](https://pkg.go.dev/google.golang.org/protobuf@v1.27.1/types/known/anypb#Any) 11 | 12 | ## Project details 13 | 14 | **typeurl** is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). 15 | As a containerd sub-project, you will find the: 16 | * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), 17 | * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), 18 | * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) 19 | 20 | information in our [`containerd/project`](https://github.com/containerd/project) repository. 21 | 22 | ## Optional 23 | 24 | By default, support for gogoproto is available along side the standard Google 25 | protobuf types. 26 | You can choose to leave gogo support out by using the `!no_gogo` build tag. 27 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/errors" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | ) 11 | 12 | // Message is the top-level interface that all messages must implement. 13 | // It provides access to a reflective view of a message. 14 | // Any implementation of this interface may be used with all functions in the 15 | // protobuf module that accept a Message, except where otherwise specified. 16 | // 17 | // This is the v2 interface definition for protobuf messages. 18 | // The v1 interface definition is [github.com/golang/protobuf/proto.Message]. 19 | // 20 | // - To convert a v1 message to a v2 message, 21 | // use [google.golang.org/protobuf/protoadapt.MessageV2Of]. 22 | // - To convert a v2 message to a v1 message, 23 | // use [google.golang.org/protobuf/protoadapt.MessageV1Of]. 24 | type Message = protoreflect.ProtoMessage 25 | 26 | // Error matches all errors produced by packages in the protobuf module 27 | // according to [errors.Is]. 28 | // 29 | // Example usage: 30 | // 31 | // if errors.Is(err, proto.Error) { ... } 32 | var Error error 33 | 34 | func init() { 35 | Error = errors.Error 36 | } 37 | 38 | // MessageName returns the full name of m. 39 | // If m is nil, it returns an empty string. 40 | func MessageName(m Message) protoreflect.FullName { 41 | if m == nil { 42 | return "" 43 | } 44 | return m.ProtoReflect().Descriptor().FullName() 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/yalp/jsonpath/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2015, Marc Capdevielle 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/instructions/commands_runnetwork.go: -------------------------------------------------------------------------------- 1 | package instructions 2 | 3 | import ( 4 | "github.com/pkg/errors" 5 | ) 6 | 7 | type NetworkMode = string 8 | 9 | const ( 10 | NetworkDefault NetworkMode = "default" 11 | NetworkNone NetworkMode = "none" 12 | NetworkHost NetworkMode = "host" 13 | ) 14 | 15 | var allowedNetwork = map[NetworkMode]struct{}{ 16 | NetworkDefault: {}, 17 | NetworkNone: {}, 18 | NetworkHost: {}, 19 | } 20 | 21 | func isValidNetwork(value string) bool { 22 | _, ok := allowedNetwork[value] 23 | return ok 24 | } 25 | 26 | var networkKey = "dockerfile/run/network" 27 | 28 | func init() { 29 | parseRunPreHooks = append(parseRunPreHooks, runNetworkPreHook) 30 | parseRunPostHooks = append(parseRunPostHooks, runNetworkPostHook) 31 | } 32 | 33 | func runNetworkPreHook(cmd *RunCommand, req parseRequest) error { 34 | st := &networkState{} 35 | st.flag = req.flags.AddString("network", NetworkDefault) 36 | cmd.setExternalValue(networkKey, st) 37 | return nil 38 | } 39 | 40 | func runNetworkPostHook(cmd *RunCommand, req parseRequest) error { 41 | st := cmd.getExternalValue(networkKey).(*networkState) 42 | if st == nil { 43 | return errors.Errorf("no network state") 44 | } 45 | 46 | value := st.flag.Value 47 | if !isValidNetwork(value) { 48 | return errors.Errorf("invalid network mode %q", value) 49 | } 50 | 51 | st.networkMode = value 52 | 53 | return nil 54 | } 55 | 56 | func GetNetwork(cmd *RunCommand) NetworkMode { 57 | return cmd.getExternalValue(networkKey).(*networkState).networkMode 58 | } 59 | 60 | type networkState struct { 61 | flag *Flag 62 | networkMode string 63 | } 64 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package protoimpl contains the default implementation for messages 6 | // generated by protoc-gen-go. 7 | // 8 | // WARNING: This package should only ever be imported by generated messages. 9 | // The compatibility agreement covers nothing except for functionality needed 10 | // to keep existing generated messages operational. Breakages that occur due 11 | // to unauthorized usages of this package are not the author's responsibility. 12 | package protoimpl 13 | 14 | import ( 15 | "google.golang.org/protobuf/internal/filedesc" 16 | "google.golang.org/protobuf/internal/filetype" 17 | "google.golang.org/protobuf/internal/impl" 18 | ) 19 | 20 | // UnsafeEnabled specifies whether package unsafe can be used. 21 | const UnsafeEnabled = impl.UnsafeEnabled 22 | 23 | type ( 24 | // Types used by generated code in init functions. 25 | DescBuilder = filedesc.Builder 26 | TypeBuilder = filetype.Builder 27 | 28 | // Types used by generated code to implement EnumType, MessageType, and ExtensionType. 29 | EnumInfo = impl.EnumInfo 30 | MessageInfo = impl.MessageInfo 31 | ExtensionInfo = impl.ExtensionInfo 32 | 33 | // Types embedded in generated messages. 34 | MessageState = impl.MessageState 35 | SizeCache = impl.SizeCache 36 | WeakFields = impl.WeakFields 37 | UnknownFields = impl.UnknownFields 38 | ExtensionFields = impl.ExtensionFields 39 | ExtensionFieldV1 = impl.ExtensionField 40 | 41 | Pointer = impl.Pointer 42 | ) 43 | 44 | var X impl.Export 45 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/encode_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | func NewRequiredNotSetError(field string) *RequiredNotSetError { 32 | return &RequiredNotSetError{field} 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/planetscale/vtprotobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021, PlanetScale Inc. All rights reserved. 2 | Copyright (c) 2013, The GoGo Authors. All rights reserved. 3 | Copyright (c) 2018 The Go Authors. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following disclaimer 13 | in the documentation and/or other materials provided with the 14 | distribution. 15 | * Neither the name of Google Inc. nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/properties_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2018, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "reflect" 33 | ) 34 | 35 | var sizerType = reflect.TypeOf((*Sizer)(nil)).Elem() 36 | var protosizerType = reflect.TypeOf((*ProtoSizer)(nil)).Elem() 37 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | import "github.com/opencontainers/image-spec/specs-go" 18 | 19 | // Index references manifests for various platforms. 20 | // This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. 21 | type Index struct { 22 | specs.Versioned 23 | 24 | // MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json` 25 | MediaType string `json:"mediaType,omitempty"` 26 | 27 | // ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact. 28 | ArtifactType string `json:"artifactType,omitempty"` 29 | 30 | // Manifests references platform specific manifests. 31 | Manifests []Descriptor `json:"manifests"` 32 | 33 | // Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest. 34 | Subject *Descriptor `json:"subject,omitempty"` 35 | 36 | // Annotations contains arbitrary metadata for the image index. 37 | Annotations map[string]string `json:"annotations,omitempty"` 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/parser/errors.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "github.com/moby/buildkit/util/stack" 5 | "github.com/pkg/errors" 6 | ) 7 | 8 | // ErrorLocation gives a location in source code that caused the error 9 | type ErrorLocation struct { 10 | Locations [][]Range 11 | error 12 | } 13 | 14 | // Unwrap unwraps to the next error 15 | func (e *ErrorLocation) Unwrap() error { 16 | return e.error 17 | } 18 | 19 | // Range is a code section between two positions 20 | type Range struct { 21 | Start Position 22 | End Position 23 | } 24 | 25 | // Position is a point in source code 26 | type Position struct { 27 | Line int 28 | Character int 29 | } 30 | 31 | func withLocation(err error, start, end int) error { 32 | return WithLocation(err, toRanges(start, end)) 33 | } 34 | 35 | // WithLocation extends an error with a source code location 36 | func WithLocation(err error, location []Range) error { 37 | return setLocation(err, location, true) 38 | } 39 | 40 | func SetLocation(err error, location []Range) error { 41 | return setLocation(err, location, false) 42 | } 43 | 44 | func setLocation(err error, location []Range, add bool) error { 45 | if err == nil { 46 | return nil 47 | } 48 | var el *ErrorLocation 49 | if errors.As(err, &el) { 50 | if add { 51 | el.Locations = append(el.Locations, location) 52 | } else { 53 | el.Locations = [][]Range{location} 54 | } 55 | return err 56 | } 57 | return stack.Enable(&ErrorLocation{ 58 | error: err, 59 | Locations: [][]Range{location}, 60 | }) 61 | } 62 | 63 | func toRanges(start, end int) (r []Range) { 64 | if end <= start { 65 | end = start 66 | } 67 | for i := start; i <= end; i++ { 68 | r = append(r, Range{Start: Position{Line: i}, End: Position{Line: i}}) 69 | } 70 | return 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/custom_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2018, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import "reflect" 32 | 33 | type custom interface { 34 | Marshal() ([]byte, error) 35 | Unmarshal(data []byte) error 36 | Size() int 37 | } 38 | 39 | var customType = reflect.TypeOf((*custom)(nil)).Elem() 40 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/typeurl/v2/types_gogo.go: -------------------------------------------------------------------------------- 1 | //go:build !no_gogo 2 | 3 | /* 4 | Copyright The containerd Authors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | 19 | package typeurl 20 | 21 | import ( 22 | "reflect" 23 | 24 | gogoproto "github.com/gogo/protobuf/proto" 25 | ) 26 | 27 | func init() { 28 | handlers = append(handlers, gogoHandler{}) 29 | } 30 | 31 | type gogoHandler struct{} 32 | 33 | func (gogoHandler) Marshaller(v interface{}) func() ([]byte, error) { 34 | pm, ok := v.(gogoproto.Message) 35 | if !ok { 36 | return nil 37 | } 38 | return func() ([]byte, error) { 39 | return gogoproto.Marshal(pm) 40 | } 41 | } 42 | 43 | func (gogoHandler) Unmarshaller(v interface{}) func([]byte) error { 44 | pm, ok := v.(gogoproto.Message) 45 | if !ok { 46 | return nil 47 | } 48 | 49 | return func(dt []byte) error { 50 | return gogoproto.Unmarshal(dt, pm) 51 | } 52 | } 53 | 54 | func (gogoHandler) TypeURL(v interface{}) string { 55 | pm, ok := v.(gogoproto.Message) 56 | if !ok { 57 | return "" 58 | } 59 | return gogoproto.MessageName(pm) 60 | } 61 | 62 | func (gogoHandler) GetType(url string) (reflect.Type, bool) { 63 | t := gogoproto.MessageType(url) 64 | if t == nil { 65 | return nil, false 66 | } 67 | return t.Elem(), true 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, The GoGo Authors. All rights reserved. 2 | 3 | Protocol Buffers for Go with Gadgets 4 | 5 | Go support for Protocol Buffers - Google's data interchange format 6 | 7 | Copyright 2010 The Go Authors. All rights reserved. 8 | https://github.com/golang/protobuf 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are 12 | met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the following disclaimer 18 | in the documentation and/or other materials provided with the 19 | distribution. 20 | * Neither the name of Google Inc. nor the names of its 21 | contributors may be used to endorse or promote products derived from 22 | this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /pkg/dockerfile/expand.go: -------------------------------------------------------------------------------- 1 | package dockerfile 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/moby/buildkit/frontend/dockerfile/instructions" 8 | ) 9 | 10 | type SingleWordExpander instructions.SingleWordExpander 11 | 12 | func (d *Dockerfile) Expand(env SingleWordExpander) { 13 | d.expand(instructions.SingleWordExpander(env)) 14 | d.analyzeStages() 15 | } 16 | 17 | func (d *Dockerfile) expand(env instructions.SingleWordExpander) { 18 | metaArgsEnvExpander := d.metaArgsEnvExpander(env) 19 | for i, stage := range d.Stages { 20 | d.Stages[i].BaseName = os.Expand(stage.BaseName, func(key string) string { 21 | value, err := metaArgsEnvExpander(key) 22 | if err != nil { 23 | return "" 24 | } 25 | return value 26 | }) 27 | for i := range stage.Commands { 28 | cmdExpander, ok := stage.Commands[i].Command.(instructions.SupportsSingleWordExpansion) 29 | if ok { 30 | cmdExpander.Expand(metaArgsEnvExpander) 31 | } 32 | } 33 | } 34 | } 35 | 36 | func (d *Dockerfile) metaArgsEnvExpander(env instructions.SingleWordExpander) instructions.SingleWordExpander { 37 | metaArgsEnv := make(map[string]string, len(d.MetaArgs)) 38 | for _, arg := range d.MetaArgs { 39 | if defaultValue := arg.DefaultValue; defaultValue != nil { 40 | metaArgsEnv[arg.Key] = *defaultValue 41 | } 42 | if value, err := env(arg.Key); err == nil { 43 | arg.ProvidedValue = &value 44 | metaArgsEnv[arg.Key] = value 45 | arg.Value = &value 46 | } 47 | err := arg.Expand(env) 48 | if err != nil { 49 | continue 50 | } 51 | for _, kv := range arg.ArgCommand.Args { 52 | if kv.Value != nil { 53 | metaArgsEnv[arg.Key] = *kv.Value 54 | } 55 | } 56 | } 57 | return func(key string) (string, error) { 58 | if value, ok := metaArgsEnv[key]; ok { 59 | return value, nil 60 | } 61 | return "", fmt.Errorf("not defined: $%s", key) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /pkg/dockerfile/parse.go: -------------------------------------------------------------------------------- 1 | package dockerfile 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | 8 | "github.com/moby/buildkit/frontend/dockerfile/instructions" 9 | "github.com/moby/buildkit/frontend/dockerfile/parser" 10 | ) 11 | 12 | func Parse(path string) (*Dockerfile, error) { 13 | f, err := os.Open(path) 14 | if err != nil { 15 | return nil, fmt.Errorf("%q: %v", path, err) 16 | } 17 | defer f.Close() 18 | return ParseReader(f) 19 | } 20 | 21 | func ParseReader(r io.Reader) (*Dockerfile, error) { 22 | result, err := parser.Parse(r) 23 | if err != nil { 24 | return nil, fmt.Errorf("dockerfile/parser.Parse %v", err) 25 | } 26 | stages, metaArgs, err := instructions.Parse(result.AST, nil) 27 | if err != nil { 28 | return nil, fmt.Errorf("dockerfile/instructions.Parse %v", err) 29 | } 30 | var out Dockerfile 31 | for _, metaArg := range metaArgs { 32 | metaArgOut := &MetaArg{ArgCommand: metaArg} 33 | for _, kv := range metaArg.Args { 34 | metaArgOut.Key = kv.Key 35 | if defaultValue := kv.Value; defaultValue != nil { 36 | { 37 | defaultValueCopy := *defaultValue 38 | metaArgOut.DefaultValue = &defaultValueCopy 39 | } 40 | { 41 | defaultValueCopy := *defaultValue 42 | metaArgOut.Value = &defaultValueCopy 43 | } 44 | } 45 | } 46 | out.MetaArgs = append(out.MetaArgs, metaArgOut) 47 | } 48 | for _, stage := range stages { 49 | outStage := &Stage{Stage: stage} 50 | for _, command := range stage.Commands { 51 | outCommand := &Command{Command: command} 52 | switch command := command.(type) { 53 | case *instructions.RunCommand: 54 | outCommand.Mounts = instructions.GetMounts(command) 55 | outCommand.NetworkMode = instructions.GetNetwork(command) 56 | outCommand.Security = instructions.GetSecurity(command) 57 | } 58 | outStage.Commands = append(outStage.Commands, outCommand) 59 | } 60 | out.Stages = append(out.Stages, outStage) 61 | } 62 | out.analyzeStages() 63 | return &out, nil 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/Makefile: -------------------------------------------------------------------------------- 1 | # Go support for Protocol Buffers - Google's data interchange format 2 | # 3 | # Copyright 2010 The Go Authors. All rights reserved. 4 | # https://github.com/golang/protobuf 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | install: 33 | go install 34 | 35 | test: install generate-test-pbs 36 | go test 37 | 38 | 39 | generate-test-pbs: 40 | make install 41 | make -C test_proto 42 | make -C proto3_proto 43 | make 44 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/lib_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "encoding/json" 33 | "strconv" 34 | ) 35 | 36 | type Sizer interface { 37 | Size() int 38 | } 39 | 40 | type ProtoSizer interface { 41 | ProtoSize() int 42 | } 43 | 44 | func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) { 45 | s, ok := m[value] 46 | if !ok { 47 | s = strconv.Itoa(int(value)) 48 | } 49 | return json.Marshal(s) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2022 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | import "github.com/opencontainers/image-spec/specs-go" 18 | 19 | // Manifest provides `application/vnd.oci.image.manifest.v1+json` mediatype structure when marshalled to JSON. 20 | type Manifest struct { 21 | specs.Versioned 22 | 23 | // MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json` 24 | MediaType string `json:"mediaType,omitempty"` 25 | 26 | // ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact. 27 | ArtifactType string `json:"artifactType,omitempty"` 28 | 29 | // Config references a configuration object for a container, by digest. 30 | // The referenced configuration object is a JSON blob that the runtime uses to set up the container. 31 | Config Descriptor `json:"config"` 32 | 33 | // Layers is an indexed list of layers referenced by the manifest. 34 | Layers []Descriptor `json:"layers"` 35 | 36 | // Subject is an optional link from the image manifest to another manifest forming an association between the image manifest and the other manifest. 37 | Subject *Descriptor `json:"subject,omitempty"` 38 | 39 | // Annotations contains arbitrary metadata for the image manifest. 40 | Annotations map[string]string `json:"annotations,omitempty"` 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/util/suggest/error.go: -------------------------------------------------------------------------------- 1 | package suggest 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/agext/levenshtein" 7 | ) 8 | 9 | func Search(val string, options []string, caseSensitive bool) (string, bool) { 10 | orig := val 11 | if !caseSensitive { 12 | val = strings.ToLower(val) 13 | } 14 | var match string 15 | mindist := 3 // same as hcl 16 | for _, opt := range options { 17 | if !caseSensitive { 18 | opt = strings.ToLower(opt) 19 | } 20 | if val == opt { 21 | // exact match means error was unrelated to the value 22 | return "", false 23 | } 24 | dist := levenshtein.Distance(val, opt, nil) 25 | if dist < mindist { 26 | if !caseSensitive { 27 | match = matchCase(opt, orig) 28 | } else { 29 | match = opt 30 | } 31 | mindist = dist 32 | } 33 | } 34 | return match, match != "" 35 | } 36 | 37 | // WrapError wraps error with a suggestion for fixing it 38 | func WrapError(err error, val string, options []string, caseSensitive bool) error { 39 | _, err = WrapErrorMaybe(err, val, options, caseSensitive) 40 | return err 41 | } 42 | 43 | func WrapErrorMaybe(err error, val string, options []string, caseSensitive bool) (bool, error) { 44 | if err == nil { 45 | return false, nil 46 | } 47 | match, ok := Search(val, options, caseSensitive) 48 | if match == "" || !ok { 49 | return false, err 50 | } 51 | 52 | return true, &suggestError{ 53 | err: err, 54 | match: match, 55 | } 56 | } 57 | 58 | type suggestError struct { 59 | err error 60 | match string 61 | } 62 | 63 | func (e *suggestError) Error() string { 64 | return e.err.Error() + " (did you mean " + e.match + "?)" 65 | } 66 | 67 | // Unwrap returns the underlying error. 68 | func (e *suggestError) Unwrap() error { 69 | return e.err 70 | } 71 | 72 | func matchCase(val, orig string) string { 73 | if orig == strings.ToLower(orig) { 74 | return strings.ToLower(val) 75 | } 76 | if orig == strings.ToUpper(orig) { 77 | return strings.ToUpper(val) 78 | } 79 | return val 80 | } 81 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/detrand/rand.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package detrand provides deterministically random functionality. 6 | // 7 | // The pseudo-randomness of these functions is seeded by the program binary 8 | // itself and guarantees that the output does not change within a program, 9 | // while ensuring that the output is unstable across different builds. 10 | package detrand 11 | 12 | import ( 13 | "encoding/binary" 14 | "hash/fnv" 15 | "os" 16 | ) 17 | 18 | // Disable disables detrand such that all functions returns the zero value. 19 | // This function is not concurrent-safe and must be called during program init. 20 | func Disable() { 21 | randSeed = 0 22 | } 23 | 24 | // Bool returns a deterministically random boolean. 25 | func Bool() bool { 26 | return randSeed%2 == 1 27 | } 28 | 29 | // Intn returns a deterministically random integer between 0 and n-1, inclusive. 30 | func Intn(n int) int { 31 | if n <= 0 { 32 | panic("must be positive") 33 | } 34 | return int(randSeed % uint64(n)) 35 | } 36 | 37 | // randSeed is a best-effort at an approximate hash of the Go binary. 38 | var randSeed = binaryHash() 39 | 40 | func binaryHash() uint64 { 41 | // Open the Go binary. 42 | s, err := os.Executable() 43 | if err != nil { 44 | return 0 45 | } 46 | f, err := os.Open(s) 47 | if err != nil { 48 | return 0 49 | } 50 | defer f.Close() 51 | 52 | // Hash the size and several samples of the Go binary. 53 | const numSamples = 8 54 | var buf [64]byte 55 | h := fnv.New64() 56 | fi, err := f.Stat() 57 | if err != nil { 58 | return 0 59 | } 60 | binary.LittleEndian.PutUint64(buf[:8], uint64(fi.Size())) 61 | h.Write(buf[:8]) 62 | for i := int64(0); i < numSamples; i++ { 63 | if _, err := f.ReadAt(buf[:], i*fi.Size()/numSamples); err != nil { 64 | return 0 65 | } 66 | h.Write(buf[:]) 67 | } 68 | return h.Sum64() 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_go_features_proto = "google/protobuf/go_features.proto" 14 | 15 | // Names for pb.GoFeatures. 16 | const ( 17 | GoFeatures_message_name protoreflect.Name = "GoFeatures" 18 | GoFeatures_message_fullname protoreflect.FullName = "pb.GoFeatures" 19 | ) 20 | 21 | // Field names for pb.GoFeatures. 22 | const ( 23 | GoFeatures_LegacyUnmarshalJsonEnum_field_name protoreflect.Name = "legacy_unmarshal_json_enum" 24 | GoFeatures_StripEnumPrefix_field_name protoreflect.Name = "strip_enum_prefix" 25 | 26 | GoFeatures_LegacyUnmarshalJsonEnum_field_fullname protoreflect.FullName = "pb.GoFeatures.legacy_unmarshal_json_enum" 27 | GoFeatures_StripEnumPrefix_field_fullname protoreflect.FullName = "pb.GoFeatures.strip_enum_prefix" 28 | ) 29 | 30 | // Field numbers for pb.GoFeatures. 31 | const ( 32 | GoFeatures_LegacyUnmarshalJsonEnum_field_number protoreflect.FieldNumber = 1 33 | GoFeatures_StripEnumPrefix_field_number protoreflect.FieldNumber = 3 34 | ) 35 | 36 | // Full and short names for pb.GoFeatures.StripEnumPrefix. 37 | const ( 38 | GoFeatures_StripEnumPrefix_enum_fullname = "pb.GoFeatures.StripEnumPrefix" 39 | GoFeatures_StripEnumPrefix_enum_name = "StripEnumPrefix" 40 | ) 41 | 42 | // Enum values for pb.GoFeatures.StripEnumPrefix. 43 | const ( 44 | GoFeatures_STRIP_ENUM_PREFIX_UNSPECIFIED_enum_value = 0 45 | GoFeatures_STRIP_ENUM_PREFIX_KEEP_enum_value = 1 46 | GoFeatures_STRIP_ENUM_PREFIX_GENERATE_BOTH_enum_value = 2 47 | GoFeatures_STRIP_ENUM_PREFIX_STRIP_enum_value = 3 48 | ) 49 | 50 | // Extension numbers 51 | const ( 52 | FeatureSet_Go_ext_number protoreflect.FieldNumber = 1002 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/size_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-types. DO NOT EDIT. 6 | 7 | package proto 8 | 9 | import ( 10 | "google.golang.org/protobuf/encoding/protowire" 11 | "google.golang.org/protobuf/reflect/protoreflect" 12 | ) 13 | 14 | func (o MarshalOptions) sizeSingular(num protowire.Number, kind protoreflect.Kind, v protoreflect.Value) int { 15 | switch kind { 16 | case protoreflect.BoolKind: 17 | return protowire.SizeVarint(protowire.EncodeBool(v.Bool())) 18 | case protoreflect.EnumKind: 19 | return protowire.SizeVarint(uint64(v.Enum())) 20 | case protoreflect.Int32Kind: 21 | return protowire.SizeVarint(uint64(int32(v.Int()))) 22 | case protoreflect.Sint32Kind: 23 | return protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) 24 | case protoreflect.Uint32Kind: 25 | return protowire.SizeVarint(uint64(uint32(v.Uint()))) 26 | case protoreflect.Int64Kind: 27 | return protowire.SizeVarint(uint64(v.Int())) 28 | case protoreflect.Sint64Kind: 29 | return protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) 30 | case protoreflect.Uint64Kind: 31 | return protowire.SizeVarint(v.Uint()) 32 | case protoreflect.Sfixed32Kind: 33 | return protowire.SizeFixed32() 34 | case protoreflect.Fixed32Kind: 35 | return protowire.SizeFixed32() 36 | case protoreflect.FloatKind: 37 | return protowire.SizeFixed32() 38 | case protoreflect.Sfixed64Kind: 39 | return protowire.SizeFixed64() 40 | case protoreflect.Fixed64Kind: 41 | return protowire.SizeFixed64() 42 | case protoreflect.DoubleKind: 43 | return protowire.SizeFixed64() 44 | case protoreflect.StringKind: 45 | return protowire.SizeBytes(len(v.String())) 46 | case protoreflect.BytesKind: 47 | return protowire.SizeBytes(len(v.Bytes())) 48 | case protoreflect.MessageKind: 49 | return protowire.SizeBytes(o.size(v.Message())) 50 | case protoreflect.GroupKind: 51 | return protowire.SizeGroup(num, o.size(v.Message())) 52 | default: 53 | return 0 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/duration_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2016, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "reflect" 33 | "time" 34 | ) 35 | 36 | var durationType = reflect.TypeOf((*time.Duration)(nil)).Elem() 37 | 38 | type duration struct { 39 | Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` 40 | Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` 41 | } 42 | 43 | func (m *duration) Reset() { *m = duration{} } 44 | func (*duration) ProtoMessage() {} 45 | func (*duration) String() string { return "duration" } 46 | 47 | func init() { 48 | RegisterType((*duration)(nil), "gogo.protobuf.proto.duration") 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2016, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "reflect" 33 | "time" 34 | ) 35 | 36 | var timeType = reflect.TypeOf((*time.Time)(nil)).Elem() 37 | 38 | type timestamp struct { 39 | Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` 40 | Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` 41 | } 42 | 43 | func (m *timestamp) Reset() { *m = timestamp{} } 44 | func (*timestamp) ProtoMessage() {} 45 | func (*timestamp) String() string { return "timestamp" } 46 | 47 | func init() { 48 | RegisterType((*timestamp)(nil), "gogo.protobuf.proto.timestamp") 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/text_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2013, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | package proto 30 | 31 | import ( 32 | "fmt" 33 | "reflect" 34 | ) 35 | 36 | func (tm *TextMarshaler) writeEnum(w *textWriter, v reflect.Value, props *Properties) error { 37 | m, ok := enumStringMaps[props.Enum] 38 | if !ok { 39 | if err := tm.writeAny(w, v, props); err != nil { 40 | return err 41 | } 42 | } 43 | key := int32(0) 44 | if v.Kind() == reflect.Ptr { 45 | key = int32(v.Elem().Int()) 46 | } else { 47 | key = int32(v.Int()) 48 | } 49 | s, ok := m[key] 50 | if !ok { 51 | if err := tm.writeAny(w, v, props); err != nil { 52 | return err 53 | } 54 | } 55 | _, err := fmt.Fprint(w, s) 56 | return err 57 | } 58 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/checkinit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/errors" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | "google.golang.org/protobuf/runtime/protoiface" 11 | ) 12 | 13 | // CheckInitialized returns an error if any required fields in m are not set. 14 | func CheckInitialized(m Message) error { 15 | // Treat a nil message interface as an "untyped" empty message, 16 | // which we assume to have no required fields. 17 | if m == nil { 18 | return nil 19 | } 20 | 21 | return checkInitialized(m.ProtoReflect()) 22 | } 23 | 24 | // CheckInitialized returns an error if any required fields in m are not set. 25 | func checkInitialized(m protoreflect.Message) error { 26 | if methods := protoMethods(m); methods != nil && methods.CheckInitialized != nil { 27 | _, err := methods.CheckInitialized(protoiface.CheckInitializedInput{ 28 | Message: m, 29 | }) 30 | return err 31 | } 32 | return checkInitializedSlow(m) 33 | } 34 | 35 | func checkInitializedSlow(m protoreflect.Message) error { 36 | md := m.Descriptor() 37 | fds := md.Fields() 38 | for i, nums := 0, md.RequiredNumbers(); i < nums.Len(); i++ { 39 | fd := fds.ByNumber(nums.Get(i)) 40 | if !m.Has(fd) { 41 | return errors.RequiredNotSet(string(fd.FullName())) 42 | } 43 | } 44 | var err error 45 | m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { 46 | switch { 47 | case fd.IsList(): 48 | if fd.Message() == nil { 49 | return true 50 | } 51 | for i, list := 0, v.List(); i < list.Len() && err == nil; i++ { 52 | err = checkInitialized(list.Get(i).Message()) 53 | } 54 | case fd.IsMap(): 55 | if fd.MapValue().Message() == nil { 56 | return true 57 | } 58 | v.Map().Range(func(key protoreflect.MapKey, v protoreflect.Value) bool { 59 | err = checkInitialized(v.Message()) 60 | return err == nil 61 | }) 62 | default: 63 | if fd.Message() == nil { 64 | return true 65 | } 66 | err = checkInitialized(v.Message()) 67 | } 68 | return err == nil 69 | }) 70 | return err 71 | } 72 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoimpl/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package protoimpl 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/version" 9 | ) 10 | 11 | const ( 12 | // MaxVersion is the maximum supported version for generated .pb.go files. 13 | // It is always the current version of the module. 14 | MaxVersion = version.Minor 15 | 16 | // GenVersion is the runtime version required by generated .pb.go files. 17 | // This is incremented when generated code relies on new functionality 18 | // in the runtime. 19 | GenVersion = 20 20 | 21 | // MinVersion is the minimum supported version for generated .pb.go files. 22 | // This is incremented when the runtime drops support for old code. 23 | MinVersion = 0 24 | ) 25 | 26 | // EnforceVersion is used by code generated by protoc-gen-go 27 | // to statically enforce minimum and maximum versions of this package. 28 | // A compilation failure implies either that: 29 | // - the runtime package is too old and needs to be updated OR 30 | // - the generated code is too old and needs to be regenerated. 31 | // 32 | // The runtime package can be upgraded by running: 33 | // 34 | // go get google.golang.org/protobuf 35 | // 36 | // The generated code can be regenerated by running: 37 | // 38 | // protoc --go_out=${PROTOC_GEN_GO_ARGS} ${PROTO_FILES} 39 | // 40 | // Example usage by generated code: 41 | // 42 | // const ( 43 | // // Verify that this generated code is sufficiently up-to-date. 44 | // _ = protoimpl.EnforceVersion(genVersion - protoimpl.MinVersion) 45 | // // Verify that runtime/protoimpl is sufficiently up-to-date. 46 | // _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - genVersion) 47 | // ) 48 | // 49 | // The genVersion is the current minor version used to generated the code. 50 | // This compile-time check relies on negative integer overflow of a uint 51 | // being a compilation failure (guaranteed by the Go specification). 52 | type EnforceVersion uint 53 | 54 | // This enforces the following invariant: 55 | // 56 | // MinVersion ≤ GenVersion ≤ MaxVersion 57 | const ( 58 | _ = EnforceVersion(GenVersion - MinVersion) 59 | _ = EnforceVersion(MaxVersion - GenVersion) 60 | ) 61 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2018, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | // +build !purego,!appengine,!js 30 | 31 | // This file contains the implementation of the proto field accesses using package unsafe. 32 | 33 | package proto 34 | 35 | import ( 36 | "reflect" 37 | "unsafe" 38 | ) 39 | 40 | func (p pointer) getRef() pointer { 41 | return pointer{p: (unsafe.Pointer)(&p.p)} 42 | } 43 | 44 | func (p pointer) appendRef(v pointer, typ reflect.Type) { 45 | slice := p.getSlice(typ) 46 | elem := v.asPointerTo(typ).Elem() 47 | newSlice := reflect.Append(slice, elem) 48 | slice.Set(newSlice) 49 | } 50 | 51 | func (p pointer) getSlice(typ reflect.Type) reflect.Value { 52 | sliceTyp := reflect.SliceOf(typ) 53 | slice := p.asPointerTo(sliceTyp) 54 | slice = slice.Elem() 55 | return slice 56 | } 57 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/weak.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | import ( 8 | "fmt" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | "google.golang.org/protobuf/reflect/protoregistry" 12 | ) 13 | 14 | // weakFields adds methods to the exported WeakFields type for internal use. 15 | // 16 | // The exported type is an alias to an unnamed type, so methods can't be 17 | // defined directly on it. 18 | type weakFields WeakFields 19 | 20 | func (w weakFields) get(num protoreflect.FieldNumber) (protoreflect.ProtoMessage, bool) { 21 | m, ok := w[int32(num)] 22 | return m, ok 23 | } 24 | 25 | func (w *weakFields) set(num protoreflect.FieldNumber, m protoreflect.ProtoMessage) { 26 | if *w == nil { 27 | *w = make(weakFields) 28 | } 29 | (*w)[int32(num)] = m 30 | } 31 | 32 | func (w *weakFields) clear(num protoreflect.FieldNumber) { 33 | delete(*w, int32(num)) 34 | } 35 | 36 | func (Export) HasWeak(w WeakFields, num protoreflect.FieldNumber) bool { 37 | _, ok := w[int32(num)] 38 | return ok 39 | } 40 | 41 | func (Export) ClearWeak(w *WeakFields, num protoreflect.FieldNumber) { 42 | delete(*w, int32(num)) 43 | } 44 | 45 | func (Export) GetWeak(w WeakFields, num protoreflect.FieldNumber, name protoreflect.FullName) protoreflect.ProtoMessage { 46 | if m, ok := w[int32(num)]; ok { 47 | return m 48 | } 49 | mt, _ := protoregistry.GlobalTypes.FindMessageByName(name) 50 | if mt == nil { 51 | panic(fmt.Sprintf("message %v for weak field is not linked in", name)) 52 | } 53 | return mt.Zero().Interface() 54 | } 55 | 56 | func (Export) SetWeak(w *WeakFields, num protoreflect.FieldNumber, name protoreflect.FullName, m protoreflect.ProtoMessage) { 57 | if m != nil { 58 | mt, _ := protoregistry.GlobalTypes.FindMessageByName(name) 59 | if mt == nil { 60 | panic(fmt.Sprintf("message %v for weak field is not linked in", name)) 61 | } 62 | if mt != m.ProtoReflect().Type() { 63 | panic(fmt.Sprintf("invalid message type for weak field: got %T, want %T", m, mt.Zero().Interface())) 64 | } 65 | } 66 | if m == nil || !m.ProtoReflect().IsValid() { 67 | delete(*w, int32(num)) 68 | return 69 | } 70 | if *w == nil { 71 | *w = make(weakFields) 72 | } 73 | (*w)[int32(num)] = m 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/moby/docker-image-spec/specs-go/v1/image.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | import ( 4 | "time" 5 | 6 | ocispec "github.com/opencontainers/image-spec/specs-go/v1" 7 | ) 8 | 9 | const DockerOCIImageMediaType = "application/vnd.docker.container.image.v1+json" 10 | 11 | // DockerOCIImage is a ocispec.Image extended with Docker specific Config. 12 | type DockerOCIImage struct { 13 | ocispec.Image 14 | 15 | // Shadow ocispec.Image.Config 16 | Config DockerOCIImageConfig `json:"config,omitempty"` 17 | } 18 | 19 | // DockerOCIImageConfig is a ocispec.ImageConfig extended with Docker specific fields. 20 | type DockerOCIImageConfig struct { 21 | ocispec.ImageConfig 22 | 23 | DockerOCIImageConfigExt 24 | } 25 | 26 | // DockerOCIImageConfigExt contains Docker-specific fields in DockerImageConfig. 27 | type DockerOCIImageConfigExt struct { 28 | Healthcheck *HealthcheckConfig `json:",omitempty"` // Healthcheck describes how to check the container is healthy 29 | 30 | OnBuild []string `json:",omitempty"` // ONBUILD metadata that were defined on the image Dockerfile 31 | Shell []string `json:",omitempty"` // Shell for shell-form of RUN, CMD, ENTRYPOINT 32 | } 33 | 34 | // HealthcheckConfig holds configuration settings for the HEALTHCHECK feature. 35 | type HealthcheckConfig struct { 36 | // Test is the test to perform to check that the container is healthy. 37 | // An empty slice means to inherit the default. 38 | // The options are: 39 | // {} : inherit healthcheck 40 | // {"NONE"} : disable healthcheck 41 | // {"CMD", args...} : exec arguments directly 42 | // {"CMD-SHELL", command} : run command with system's default shell 43 | Test []string `json:",omitempty"` 44 | 45 | // Zero means to inherit. Durations are expressed as integer nanoseconds. 46 | Interval time.Duration `json:",omitempty"` // Interval is the time to wait between checks. 47 | Timeout time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung. 48 | StartPeriod time.Duration `json:",omitempty"` // The start period for the container to initialize before the retries starts to count down. 49 | StartInterval time.Duration `json:",omitempty"` // The interval to attempt healthchecks at during the start period 50 | 51 | // Retries is the number of consecutive failures needed to consider a container as unhealthy. 52 | // Zero means inherit. 53 | Retries int `json:",omitempty"` 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Go with Gadgets 2 | // 3 | // Copyright (c) 2018, The GoGo Authors. All rights reserved. 4 | // http://github.com/gogo/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | // +build purego appengine js 30 | 31 | // This file contains an implementation of proto field accesses using package reflect. 32 | // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can 33 | // be used on App Engine. 34 | 35 | package proto 36 | 37 | import ( 38 | "reflect" 39 | ) 40 | 41 | // TODO: untested, so probably incorrect. 42 | 43 | func (p pointer) getRef() pointer { 44 | return pointer{v: p.v.Addr()} 45 | } 46 | 47 | func (p pointer) appendRef(v pointer, typ reflect.Type) { 48 | slice := p.getSlice(typ) 49 | elem := v.asPointerTo(typ).Elem() 50 | newSlice := reflect.Append(slice, elem) 51 | slice.Set(newSlice) 52 | } 53 | 54 | func (p pointer) getSlice(typ reflect.Type) reflect.Value { 55 | sliceTyp := reflect.SliceOf(typ) 56 | slice := p.asPointerTo(sliceTyp) 57 | slice = slice.Elem() 58 | return slice 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/yalp/jsonpath/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/yalp/jsonpath.svg?branch=master)](https://travis-ci.org/yalp/jsonpath) 2 | 3 | This was mostly an experiment to learn go and test using closures to interpret a JSON path. 4 | You should use https://github.com/PaesslerAG/jsonpath instead. 5 | 6 | # jsonpath 7 | 8 | a (partial) implementation in [Go](http://golang.org) based on [Stefan Goener JSON Path](http://goessner.net/articles/JsonPath/) 9 | 10 | ## Limitations 11 | 12 | * No support for subexpressions : `$books[(@.length-1)]` 13 | * No support for filters : `$books[?(@.price > 10)]` 14 | * Strings in brackets must use double quotes : `$["bookstore"]` 15 | * Cannot operate on struct fields 16 | 17 | The third limitation comes from using the `text/scanner` package from the standard library. 18 | The last one could be overcome by using reflection. 19 | 20 | ## JsonPath quick intro 21 | 22 | All expressions start `$`. 23 | 24 | Examples (supported by the current implementation) : 25 | * `$` the current object (or array) 26 | * `$.books` access to the key of an object (or `$["books"]`with bracket syntax) 27 | * `$.books[1]` access to the index of an array 28 | * `$.books[1].authors[1].name` chaining of keys and index 29 | * `$["books"][1]["authors"][1]["name"]` the same with braket syntax 30 | * `$.books[0,1,3]` union on an array 31 | * `$["books", "songs", "movies"]` union on an object 32 | * `$books[1:3]` second and third items of an array 33 | * `$books[:-2:2]` every two items except the last two of an array 34 | * `$books[::-1]` all items in reversed order 35 | * `$..authors` all authors (recursive search) 36 | 37 | Checkout the [tests](jsonpath_test.go) for more examples. 38 | 39 | ## Install 40 | 41 | go get github.com/yalp/jsonpath 42 | 43 | ## Usage 44 | 45 | A jsonpath applies to any JSON decoded data using `interface{}` when decoded with [encoding/json](http://golang.org/pkg/encoding/json/) : 46 | 47 | var bookstore interface{} 48 | err := json.Unmarshal(data, &bookstore) 49 | authors, err := jsonpath.Read(bookstore, "$..authors") 50 | 51 | A jsonpath expression can be prepared to be reused multiple times : 52 | 53 | allAuthors, err = jsonpath.Prepare("$..authors") 54 | ... 55 | var bookstore interface{} 56 | err := json.Unmarshal(data, &bookstore) 57 | authors, err := allAuthors(bookstore) 58 | 59 | The type of the values returned by the `Read` method or `Prepare` functions depends on the jsonpath expression. 60 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.21 6 | 7 | package strs 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | ) 14 | 15 | // UnsafeString returns an unsafe string reference of b. 16 | // The caller must treat the input slice as immutable. 17 | // 18 | // WARNING: Use carefully. The returned result must not leak to the end user 19 | // unless the input slice is provably immutable. 20 | func UnsafeString(b []byte) string { 21 | return unsafe.String(unsafe.SliceData(b), len(b)) 22 | } 23 | 24 | // UnsafeBytes returns an unsafe bytes slice reference of s. 25 | // The caller must treat returned slice as immutable. 26 | // 27 | // WARNING: Use carefully. The returned result must not leak to the end user. 28 | func UnsafeBytes(s string) []byte { 29 | return unsafe.Slice(unsafe.StringData(s), len(s)) 30 | } 31 | 32 | // Builder builds a set of strings with shared lifetime. 33 | // This differs from strings.Builder, which is for building a single string. 34 | type Builder struct { 35 | buf []byte 36 | } 37 | 38 | // AppendFullName is equivalent to protoreflect.FullName.Append, 39 | // but optimized for large batches where each name has a shared lifetime. 40 | func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName { 41 | n := len(prefix) + len(".") + len(name) 42 | if len(prefix) == 0 { 43 | n -= len(".") 44 | } 45 | sb.grow(n) 46 | sb.buf = append(sb.buf, prefix...) 47 | sb.buf = append(sb.buf, '.') 48 | sb.buf = append(sb.buf, name...) 49 | return protoreflect.FullName(sb.last(n)) 50 | } 51 | 52 | // MakeString is equivalent to string(b), but optimized for large batches 53 | // with a shared lifetime. 54 | func (sb *Builder) MakeString(b []byte) string { 55 | sb.grow(len(b)) 56 | sb.buf = append(sb.buf, b...) 57 | return sb.last(len(b)) 58 | } 59 | 60 | func (sb *Builder) grow(n int) { 61 | if cap(sb.buf)-len(sb.buf) >= n { 62 | return 63 | } 64 | 65 | // Unlike strings.Builder, we do not need to copy over the contents 66 | // of the old buffer since our builder provides no API for 67 | // retrieving previously created strings. 68 | sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n)) 69 | } 70 | 71 | func (sb *Builder) last(n int) string { 72 | return UnsafeString(sb.buf[len(sb.buf)-n:]) 73 | } 74 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/equal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "reflect" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | "google.golang.org/protobuf/runtime/protoiface" 12 | ) 13 | 14 | // Equal reports whether two messages are equal, 15 | // by recursively comparing the fields of the message. 16 | // 17 | // - Bytes fields are equal if they contain identical bytes. 18 | // Empty bytes (regardless of nil-ness) are considered equal. 19 | // 20 | // - Floating-point fields are equal if they contain the same value. 21 | // Unlike the == operator, a NaN is equal to another NaN. 22 | // 23 | // - Other scalar fields are equal if they contain the same value. 24 | // 25 | // - Message fields are equal if they have 26 | // the same set of populated known and extension field values, and 27 | // the same set of unknown fields values. 28 | // 29 | // - Lists are equal if they are the same length and 30 | // each corresponding element is equal. 31 | // 32 | // - Maps are equal if they have the same set of keys and 33 | // the corresponding value for each key is equal. 34 | // 35 | // An invalid message is not equal to a valid message. 36 | // An invalid message is only equal to another invalid message of the 37 | // same type. An invalid message often corresponds to a nil pointer 38 | // of the concrete message type. For example, (*pb.M)(nil) is not equal 39 | // to &pb.M{}. 40 | // If two valid messages marshal to the same bytes under deterministic 41 | // serialization, then Equal is guaranteed to report true. 42 | func Equal(x, y Message) bool { 43 | if x == nil || y == nil { 44 | return x == nil && y == nil 45 | } 46 | if reflect.TypeOf(x).Kind() == reflect.Ptr && x == y { 47 | // Avoid an expensive comparison if both inputs are identical pointers. 48 | return true 49 | } 50 | mx := x.ProtoReflect() 51 | my := y.ProtoReflect() 52 | if mx.IsValid() != my.IsValid() { 53 | return false 54 | } 55 | 56 | // Only one of the messages needs to implement the fast-path for it to work. 57 | pmx := protoMethods(mx) 58 | pmy := protoMethods(my) 59 | if pmx != nil && pmy != nil && pmx.Equal != nil && pmy.Equal != nil { 60 | return pmx.Equal(protoiface.EqualInput{MessageA: mx, MessageB: my}).Equal 61 | } 62 | 63 | vx := protoreflect.ValueOfMessage(mx) 64 | vy := protoreflect.ValueOfMessage(my) 65 | return vx.Equal(vy) 66 | } 67 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package protoreflect 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/pragma" 9 | ) 10 | 11 | // The following types are used by the fast-path Message.ProtoMethods method. 12 | // 13 | // To avoid polluting the public protoreflect API with types used only by 14 | // low-level implementations, the canonical definitions of these types are 15 | // in the runtime/protoiface package. The definitions here and in protoiface 16 | // must be kept in sync. 17 | type ( 18 | methods = struct { 19 | pragma.NoUnkeyedLiterals 20 | Flags supportFlags 21 | Size func(sizeInput) sizeOutput 22 | Marshal func(marshalInput) (marshalOutput, error) 23 | Unmarshal func(unmarshalInput) (unmarshalOutput, error) 24 | Merge func(mergeInput) mergeOutput 25 | CheckInitialized func(checkInitializedInput) (checkInitializedOutput, error) 26 | Equal func(equalInput) equalOutput 27 | } 28 | supportFlags = uint64 29 | sizeInput = struct { 30 | pragma.NoUnkeyedLiterals 31 | Message Message 32 | Flags uint8 33 | } 34 | sizeOutput = struct { 35 | pragma.NoUnkeyedLiterals 36 | Size int 37 | } 38 | marshalInput = struct { 39 | pragma.NoUnkeyedLiterals 40 | Message Message 41 | Buf []byte 42 | Flags uint8 43 | } 44 | marshalOutput = struct { 45 | pragma.NoUnkeyedLiterals 46 | Buf []byte 47 | } 48 | unmarshalInput = struct { 49 | pragma.NoUnkeyedLiterals 50 | Message Message 51 | Buf []byte 52 | Flags uint8 53 | Resolver interface { 54 | FindExtensionByName(field FullName) (ExtensionType, error) 55 | FindExtensionByNumber(message FullName, field FieldNumber) (ExtensionType, error) 56 | } 57 | Depth int 58 | } 59 | unmarshalOutput = struct { 60 | pragma.NoUnkeyedLiterals 61 | Flags uint8 62 | } 63 | mergeInput = struct { 64 | pragma.NoUnkeyedLiterals 65 | Source Message 66 | Destination Message 67 | } 68 | mergeOutput = struct { 69 | pragma.NoUnkeyedLiterals 70 | Flags uint8 71 | } 72 | checkInitializedInput = struct { 73 | pragma.NoUnkeyedLiterals 74 | Message Message 75 | } 76 | checkInitializedOutput = struct { 77 | pragma.NoUnkeyedLiterals 78 | } 79 | equalInput = struct { 80 | pragma.NoUnkeyedLiterals 81 | MessageA Message 82 | MessageB Message 83 | } 84 | equalOutput = struct { 85 | pragma.NoUnkeyedLiterals 86 | Equal bool 87 | } 88 | ) 89 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/version/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package version records versioning information about this module. 6 | package version 7 | 8 | import ( 9 | "fmt" 10 | "strings" 11 | ) 12 | 13 | // These constants determine the current version of this module. 14 | // 15 | // For our release process, we enforce the following rules: 16 | // - Tagged releases use a tag that is identical to String. 17 | // - Tagged releases never reference a commit where the String 18 | // contains "devel". 19 | // - The set of all commits in this repository where String 20 | // does not contain "devel" must have a unique String. 21 | // 22 | // Steps for tagging a new release: 23 | // 24 | // 1. Create a new CL. 25 | // 26 | // 2. Update Minor, Patch, and/or PreRelease as necessary. 27 | // PreRelease must not contain the string "devel". 28 | // 29 | // 3. Since the last released minor version, have there been any changes to 30 | // generator that relies on new functionality in the runtime? 31 | // If yes, then increment RequiredGenerated. 32 | // 33 | // 4. Since the last released minor version, have there been any changes to 34 | // the runtime that removes support for old .pb.go source code? 35 | // If yes, then increment SupportMinimum. 36 | // 37 | // 5. Send out the CL for review and submit it. 38 | // Note that the next CL in step 8 must be submitted after this CL 39 | // without any other CLs in-between. 40 | // 41 | // 6. Tag a new version, where the tag is is the current String. 42 | // 43 | // 7. Write release notes for all notable changes 44 | // between this release and the last release. 45 | // 46 | // 8. Create a new CL. 47 | // 48 | // 9. Update PreRelease to include the string "devel". 49 | // For example: "" -> "devel" or "rc.1" -> "rc.1.devel" 50 | // 51 | // 10. Send out the CL for review and submit it. 52 | const ( 53 | Major = 1 54 | Minor = 35 55 | Patch = 2 56 | PreRelease = "" 57 | ) 58 | 59 | // String formats the version string for this module in semver format. 60 | // 61 | // Examples: 62 | // 63 | // v1.20.1 64 | // v1.21.0-rc.1 65 | func String() string { 66 | v := fmt.Sprintf("v%d.%d.%d", Major, Minor, Patch) 67 | if PreRelease != "" { 68 | v += "-" + PreRelease 69 | 70 | // TODO: Add metadata about the commit or build hash. 71 | // See https://golang.org/issue/29814 72 | // See https://golang.org/issue/33533 73 | var metadata string 74 | if strings.Contains(PreRelease, "devel") && metadata != "" { 75 | v += "+" + metadata 76 | } 77 | } 78 | return v 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/proto/deprecated.go: -------------------------------------------------------------------------------- 1 | // Go support for Protocol Buffers - Google's data interchange format 2 | // 3 | // Copyright 2018 The Go Authors. All rights reserved. 4 | // https://github.com/golang/protobuf 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are 8 | // met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following disclaimer 14 | // in the documentation and/or other materials provided with the 15 | // distribution. 16 | // * Neither the name of Google Inc. nor the names of its 17 | // contributors may be used to endorse or promote products derived from 18 | // this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | package proto 33 | 34 | import "errors" 35 | 36 | // Deprecated: do not use. 37 | type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } 38 | 39 | // Deprecated: do not use. 40 | func GetStats() Stats { return Stats{} } 41 | 42 | // Deprecated: do not use. 43 | func MarshalMessageSet(interface{}) ([]byte, error) { 44 | return nil, errors.New("proto: not implemented") 45 | } 46 | 47 | // Deprecated: do not use. 48 | func UnmarshalMessageSet([]byte, interface{}) error { 49 | return errors.New("proto: not implemented") 50 | } 51 | 52 | // Deprecated: do not use. 53 | func MarshalMessageSetJSON(interface{}) ([]byte, error) { 54 | return nil, errors.New("proto: not implemented") 55 | } 56 | 57 | // Deprecated: do not use. 58 | func UnmarshalMessageSetJSON([]byte, interface{}) error { 59 | return errors.New("proto: not implemented") 60 | } 61 | 62 | // Deprecated: do not use. 63 | func RegisterMessageSetType(Message, int32, string) {} 64 | -------------------------------------------------------------------------------- /vendor/github.com/tonistiigi/go-csvvalue/readme.md: -------------------------------------------------------------------------------- 1 | ### go-csvvalue 2 | 3 | ![GitHub Release](https://img.shields.io/github/v/release/tonistiigi/go-csvvalue) 4 | [![Go Reference](https://pkg.go.dev/badge/github.com/tonistiigi/go-csvvalue.svg)](https://pkg.go.dev/github.com/tonistiigi/go-csvvalue) 5 | ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/tonistiigi/go-csvvalue/ci.yml) 6 | ![Codecov](https://img.shields.io/codecov/c/github/tonistiigi/go-csvvalue) 7 | ![GitHub License](https://img.shields.io/github/license/tonistiigi/go-csvvalue) 8 | 9 | 10 | `go-csvvalue` provides an efficient parser for a single-line CSV value. 11 | 12 | It is more efficient than the standard library `encoding/csv` package for parsing many small values. The main problem with stdlib implementation is that it calls `bufio.NewReader` internally, allocating 4KB of memory on each invocation. For multi-line CSV parsing, the standard library is still recommended. If you wish to optimize memory usage for `encoding/csv`, call `csv.NewReader` with an instance of `*bufio.Reader` that already has a 4KB buffer allocated and then reuse that buffer for all reads. 13 | 14 | For further memory optimization, an existing string slice can be optionally passed to be reused for returning the parsed fields. 15 | 16 | For backwards compatibility with stdlib record parser, the input may contain a trailing newline character. 17 | 18 | ### Benchmark 19 | 20 | ``` 21 | goos: linux 22 | goarch: amd64 23 | pkg: github.com/tonistiigi/go-csvvalue 24 | cpu: AMD EPYC 7763 64-Core Processor 25 | BenchmarkFields/stdlib/withcache-4 1109917 1103 ns/op 4520 B/op 14 allocs/op 26 | BenchmarkFields/stdlib/nocache-4 1082838 1125 ns/op 4520 B/op 14 allocs/op 27 | BenchmarkFields/csvvalue/withcache-4 28554976 42.12 ns/op 0 B/op 0 allocs/op 28 | BenchmarkFields/csvvalue/nocache-4 13666134 83.77 ns/op 48 B/op 1 allocs/op 29 | ``` 30 | ``` 31 | goos: darwin 32 | goarch: arm64 33 | pkg: github.com/tonistiigi/go-csvvalue 34 | BenchmarkFields/stdlib/nocache-10 1679923 784.9 ns/op 4520 B/op 14 allocs/op 35 | BenchmarkFields/stdlib/withcache-10 1641891 826.9 ns/op 4520 B/op 14 allocs/op 36 | BenchmarkFields/csvvalue/withcache-10 34399642 33.93 ns/op 0 B/op 0 allocs/op 37 | BenchmarkFields/csvvalue/nocache-10 17441373 67.21 ns/op 48 B/op 1 allocs/op 38 | PASS 39 | ``` 40 | 41 | ### Credits 42 | 43 | This package is mostly based on `encoding/csv` implementation and also uses that package for compatibility testing. 44 | 45 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019, 2020 OCI Contributors 2 | // Copyright 2017 Docker, Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // https://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | // Package digest provides a generalized type to opaquely represent message 17 | // digests and their operations within the registry. The Digest type is 18 | // designed to serve as a flexible identifier in a content-addressable system. 19 | // More importantly, it provides tools and wrappers to work with 20 | // hash.Hash-based digests with little effort. 21 | // 22 | // Basics 23 | // 24 | // The format of a digest is simply a string with two parts, dubbed the 25 | // "algorithm" and the "digest", separated by a colon: 26 | // 27 | // : 28 | // 29 | // An example of a sha256 digest representation follows: 30 | // 31 | // sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc 32 | // 33 | // The "algorithm" portion defines both the hashing algorithm used to calculate 34 | // the digest and the encoding of the resulting digest, which defaults to "hex" 35 | // if not otherwise specified. Currently, all supported algorithms have their 36 | // digests encoded in hex strings. 37 | // 38 | // In the example above, the string "sha256" is the algorithm and the hex bytes 39 | // are the "digest". 40 | // 41 | // Because the Digest type is simply a string, once a valid Digest is 42 | // obtained, comparisons are cheap, quick and simple to express with the 43 | // standard equality operator. 44 | // 45 | // Verification 46 | // 47 | // The main benefit of using the Digest type is simple verification against a 48 | // given digest. The Verifier interface, modeled after the stdlib hash.Hash 49 | // interface, provides a common write sink for digest verification. After 50 | // writing is complete, calling the Verifier.Verified method will indicate 51 | // whether or not the stream of bytes matches the target digest. 52 | // 53 | // Missing Features 54 | // 55 | // In addition to the above, we intend to add the following features to this 56 | // package: 57 | // 58 | // 1. A Digester type that supports write sink digest calculation. 59 | // 60 | // 2. Suspend and resume of ongoing digest calculations to support efficient digest verification in the registry. 61 | // 62 | package digest 63 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/legacy_file.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | import ( 8 | "bytes" 9 | "compress/gzip" 10 | "io" 11 | "sync" 12 | 13 | "google.golang.org/protobuf/internal/filedesc" 14 | "google.golang.org/protobuf/reflect/protoreflect" 15 | "google.golang.org/protobuf/reflect/protoregistry" 16 | ) 17 | 18 | // Every enum and message type generated by protoc-gen-go since commit 2fc053c5 19 | // on February 25th, 2016 has had a method to get the raw descriptor. 20 | // Types that were not generated by protoc-gen-go or were generated prior 21 | // to that version are not supported. 22 | // 23 | // The []byte returned is the encoded form of a FileDescriptorProto message 24 | // compressed using GZIP. The []int is the path from the top-level file 25 | // to the specific message or enum declaration. 26 | type ( 27 | enumV1 interface { 28 | EnumDescriptor() ([]byte, []int) 29 | } 30 | messageV1 interface { 31 | Descriptor() ([]byte, []int) 32 | } 33 | ) 34 | 35 | var legacyFileDescCache sync.Map // map[*byte]protoreflect.FileDescriptor 36 | 37 | // legacyLoadFileDesc unmarshals b as a compressed FileDescriptorProto message. 38 | // 39 | // This assumes that b is immutable and that b does not refer to part of a 40 | // concatenated series of GZIP files (which would require shenanigans that 41 | // rely on the concatenation properties of both protobufs and GZIP). 42 | // File descriptors generated by protoc-gen-go do not rely on that property. 43 | func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor { 44 | // Fast-path: check whether we already have a cached file descriptor. 45 | if fd, ok := legacyFileDescCache.Load(&b[0]); ok { 46 | return fd.(protoreflect.FileDescriptor) 47 | } 48 | 49 | // Slow-path: decompress and unmarshal the file descriptor proto. 50 | zr, err := gzip.NewReader(bytes.NewReader(b)) 51 | if err != nil { 52 | panic(err) 53 | } 54 | b2, err := io.ReadAll(zr) 55 | if err != nil { 56 | panic(err) 57 | } 58 | 59 | fd := filedesc.Builder{ 60 | RawDescriptor: b2, 61 | FileRegistry: resolverOnly{protoregistry.GlobalFiles}, // do not register back to global registry 62 | }.Build().File 63 | if fd, ok := legacyFileDescCache.LoadOrStore(&b[0], fd); ok { 64 | return fd.(protoreflect.FileDescriptor) 65 | } 66 | return fd 67 | } 68 | 69 | type resolverOnly struct { 70 | reg *protoregistry.Files 71 | } 72 | 73 | func (r resolverOnly) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { 74 | return r.reg.FindFileByPath(path) 75 | } 76 | func (r resolverOnly) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { 77 | return r.reg.FindDescriptorByName(name) 78 | } 79 | func (resolverOnly) RegisterFile(protoreflect.FileDescriptor) error { 80 | return nil 81 | } 82 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.21 6 | 7 | package strs 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | ) 14 | 15 | type ( 16 | stringHeader struct { 17 | Data unsafe.Pointer 18 | Len int 19 | } 20 | sliceHeader struct { 21 | Data unsafe.Pointer 22 | Len int 23 | Cap int 24 | } 25 | ) 26 | 27 | // UnsafeString returns an unsafe string reference of b. 28 | // The caller must treat the input slice as immutable. 29 | // 30 | // WARNING: Use carefully. The returned result must not leak to the end user 31 | // unless the input slice is provably immutable. 32 | func UnsafeString(b []byte) (s string) { 33 | src := (*sliceHeader)(unsafe.Pointer(&b)) 34 | dst := (*stringHeader)(unsafe.Pointer(&s)) 35 | dst.Data = src.Data 36 | dst.Len = src.Len 37 | return s 38 | } 39 | 40 | // UnsafeBytes returns an unsafe bytes slice reference of s. 41 | // The caller must treat returned slice as immutable. 42 | // 43 | // WARNING: Use carefully. The returned result must not leak to the end user. 44 | func UnsafeBytes(s string) (b []byte) { 45 | src := (*stringHeader)(unsafe.Pointer(&s)) 46 | dst := (*sliceHeader)(unsafe.Pointer(&b)) 47 | dst.Data = src.Data 48 | dst.Len = src.Len 49 | dst.Cap = src.Len 50 | return b 51 | } 52 | 53 | // Builder builds a set of strings with shared lifetime. 54 | // This differs from strings.Builder, which is for building a single string. 55 | type Builder struct { 56 | buf []byte 57 | } 58 | 59 | // AppendFullName is equivalent to protoreflect.FullName.Append, 60 | // but optimized for large batches where each name has a shared lifetime. 61 | func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName { 62 | n := len(prefix) + len(".") + len(name) 63 | if len(prefix) == 0 { 64 | n -= len(".") 65 | } 66 | sb.grow(n) 67 | sb.buf = append(sb.buf, prefix...) 68 | sb.buf = append(sb.buf, '.') 69 | sb.buf = append(sb.buf, name...) 70 | return protoreflect.FullName(sb.last(n)) 71 | } 72 | 73 | // MakeString is equivalent to string(b), but optimized for large batches 74 | // with a shared lifetime. 75 | func (sb *Builder) MakeString(b []byte) string { 76 | sb.grow(len(b)) 77 | sb.buf = append(sb.buf, b...) 78 | return sb.last(len(b)) 79 | } 80 | 81 | func (sb *Builder) grow(n int) { 82 | if cap(sb.buf)-len(sb.buf) >= n { 83 | return 84 | } 85 | 86 | // Unlike strings.Builder, we do not need to copy over the contents 87 | // of the old buffer since our builder provides no API for 88 | // retrieving previously created strings. 89 | sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n)) 90 | } 91 | 92 | func (sb *Builder) last(n int) string { 93 | return UnsafeString(sb.buf[len(sb.buf)-n:]) 94 | } 95 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.21 6 | 7 | package protoreflect 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "google.golang.org/protobuf/internal/pragma" 13 | ) 14 | 15 | type ( 16 | ifaceHeader struct { 17 | _ [0]any // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. 18 | Type unsafe.Pointer 19 | Data unsafe.Pointer 20 | } 21 | ) 22 | 23 | var ( 24 | nilType = typeOf(nil) 25 | boolType = typeOf(*new(bool)) 26 | int32Type = typeOf(*new(int32)) 27 | int64Type = typeOf(*new(int64)) 28 | uint32Type = typeOf(*new(uint32)) 29 | uint64Type = typeOf(*new(uint64)) 30 | float32Type = typeOf(*new(float32)) 31 | float64Type = typeOf(*new(float64)) 32 | stringType = typeOf(*new(string)) 33 | bytesType = typeOf(*new([]byte)) 34 | enumType = typeOf(*new(EnumNumber)) 35 | ) 36 | 37 | // typeOf returns a pointer to the Go type information. 38 | // The pointer is comparable and equal if and only if the types are identical. 39 | func typeOf(t any) unsafe.Pointer { 40 | return (*ifaceHeader)(unsafe.Pointer(&t)).Type 41 | } 42 | 43 | // value is a union where only one type can be represented at a time. 44 | // The struct is 24B large on 64-bit systems and requires the minimum storage 45 | // necessary to represent each possible type. 46 | // 47 | // The Go GC needs to be able to scan variables containing pointers. 48 | // As such, pointers and non-pointers cannot be intermixed. 49 | type value struct { 50 | pragma.DoNotCompare // 0B 51 | 52 | // typ stores the type of the value as a pointer to the Go type. 53 | typ unsafe.Pointer // 8B 54 | 55 | // ptr stores the data pointer for a String, Bytes, or interface value. 56 | ptr unsafe.Pointer // 8B 57 | 58 | // num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or 59 | // Enum value as a raw uint64. 60 | // 61 | // It is also used to store the length of a String or Bytes value; 62 | // the capacity is ignored. 63 | num uint64 // 8B 64 | } 65 | 66 | func valueOfString(v string) Value { 67 | return Value{typ: stringType, ptr: unsafe.Pointer(unsafe.StringData(v)), num: uint64(len(v))} 68 | } 69 | func valueOfBytes(v []byte) Value { 70 | return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))} 71 | } 72 | func valueOfIface(v any) Value { 73 | p := (*ifaceHeader)(unsafe.Pointer(&v)) 74 | return Value{typ: p.Type, ptr: p.Data} 75 | } 76 | 77 | func (v Value) getString() string { 78 | return unsafe.String((*byte)(v.ptr), v.num) 79 | } 80 | func (v Value) getBytes() []byte { 81 | return unsafe.Slice((*byte)(v.ptr), v.num) 82 | } 83 | func (v Value) getIface() (x any) { 84 | *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} 85 | return x 86 | } 87 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/README.md: -------------------------------------------------------------------------------- 1 | # errors [![Travis-CI](https://travis-ci.org/pkg/errors.svg)](https://travis-ci.org/pkg/errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/b98mptawhudj53ep/branch/master?svg=true)](https://ci.appveyor.com/project/davecheney/errors/branch/master) [![GoDoc](https://godoc.org/github.com/pkg/errors?status.svg)](http://godoc.org/github.com/pkg/errors) [![Report card](https://goreportcard.com/badge/github.com/pkg/errors)](https://goreportcard.com/report/github.com/pkg/errors) [![Sourcegraph](https://sourcegraph.com/github.com/pkg/errors/-/badge.svg)](https://sourcegraph.com/github.com/pkg/errors?badge) 2 | 3 | Package errors provides simple error handling primitives. 4 | 5 | `go get github.com/pkg/errors` 6 | 7 | The traditional error handling idiom in Go is roughly akin to 8 | ```go 9 | if err != nil { 10 | return err 11 | } 12 | ``` 13 | which applied recursively up the call stack results in error reports without context or debugging information. The errors package allows programmers to add context to the failure path in their code in a way that does not destroy the original value of the error. 14 | 15 | ## Adding context to an error 16 | 17 | The errors.Wrap function returns a new error that adds context to the original error. For example 18 | ```go 19 | _, err := ioutil.ReadAll(r) 20 | if err != nil { 21 | return errors.Wrap(err, "read failed") 22 | } 23 | ``` 24 | ## Retrieving the cause of an error 25 | 26 | Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to reverse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`. 27 | ```go 28 | type causer interface { 29 | Cause() error 30 | } 31 | ``` 32 | `errors.Cause` will recursively retrieve the topmost error which does not implement `causer`, which is assumed to be the original cause. For example: 33 | ```go 34 | switch err := errors.Cause(err).(type) { 35 | case *MyError: 36 | // handle specifically 37 | default: 38 | // unknown error 39 | } 40 | ``` 41 | 42 | [Read the package documentation for more information](https://godoc.org/github.com/pkg/errors). 43 | 44 | ## Roadmap 45 | 46 | With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows: 47 | 48 | - 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible) 49 | - 1.0. Final release. 50 | 51 | ## Contributing 52 | 53 | Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports. 54 | 55 | Before sending a PR, please discuss your change by raising an issue. 56 | 57 | ## License 58 | 59 | BSD-2-Clause 60 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to go-units 2 | 3 | Want to hack on go-units? Awesome! Here are instructions to get you started. 4 | 5 | go-units is a part of the [Docker](https://www.docker.com) project, and follows 6 | the same rules and principles. If you're already familiar with the way 7 | Docker does things, you'll feel right at home. 8 | 9 | Otherwise, go read Docker's 10 | [contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), 11 | [issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), 12 | [review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and 13 | [branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). 14 | 15 | ### Sign your work 16 | 17 | The sign-off is a simple line at the end of the explanation for the patch. Your 18 | signature certifies that you wrote the patch or otherwise have the right to pass 19 | it on as an open-source patch. The rules are pretty simple: if you can certify 20 | the below (from [developercertificate.org](http://developercertificate.org/)): 21 | 22 | ``` 23 | Developer Certificate of Origin 24 | Version 1.1 25 | 26 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 27 | 660 York Street, Suite 102, 28 | San Francisco, CA 94110 USA 29 | 30 | Everyone is permitted to copy and distribute verbatim copies of this 31 | license document, but changing it is not allowed. 32 | 33 | Developer's Certificate of Origin 1.1 34 | 35 | By making a contribution to this project, I certify that: 36 | 37 | (a) The contribution was created in whole or in part by me and I 38 | have the right to submit it under the open source license 39 | indicated in the file; or 40 | 41 | (b) The contribution is based upon previous work that, to the best 42 | of my knowledge, is covered under an appropriate open source 43 | license and I have the right under that license to submit that 44 | work with modifications, whether created in whole or in part 45 | by me, under the same open source license (unless I am 46 | permitted to submit under a different license), as indicated 47 | in the file; or 48 | 49 | (c) The contribution was provided directly to me by some other 50 | person who certified (a), (b) or (c) and I have not modified 51 | it. 52 | 53 | (d) I understand and agree that this project and the contribution 54 | are public and that a record of the contribution (including all 55 | personal information I submit with it, including my sign-off) is 56 | maintained indefinitely and may be redistributed consistent with 57 | this project or the open source license(s) involved. 58 | ``` 59 | 60 | Then you just add a line to every git commit message: 61 | 62 | Signed-off-by: Joe Smith 63 | 64 | Use your real name (sorry, no pseudonyms or anonymous contributions.) 65 | 66 | If you set your `user.name` and `user.email` git configs, you can sign your 67 | commit automatically with `git commit -s`. 68 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package errors implements functions to manipulate errors. 6 | package errors 7 | 8 | import ( 9 | "errors" 10 | "fmt" 11 | 12 | "google.golang.org/protobuf/internal/detrand" 13 | ) 14 | 15 | // Error is a sentinel matching all errors produced by this package. 16 | var Error = errors.New("protobuf error") 17 | 18 | // New formats a string according to the format specifier and arguments and 19 | // returns an error that has a "proto" prefix. 20 | func New(f string, x ...any) error { 21 | return &prefixError{s: format(f, x...)} 22 | } 23 | 24 | type prefixError struct{ s string } 25 | 26 | var prefix = func() string { 27 | // Deliberately introduce instability into the error message string to 28 | // discourage users from performing error string comparisons. 29 | if detrand.Bool() { 30 | return "proto: " // use non-breaking spaces (U+00a0) 31 | } else { 32 | return "proto: " // use regular spaces (U+0020) 33 | } 34 | }() 35 | 36 | func (e *prefixError) Error() string { 37 | return prefix + e.s 38 | } 39 | 40 | func (e *prefixError) Unwrap() error { 41 | return Error 42 | } 43 | 44 | // Wrap returns an error that has a "proto" prefix, the formatted string described 45 | // by the format specifier and arguments, and a suffix of err. The error wraps err. 46 | func Wrap(err error, f string, x ...any) error { 47 | return &wrapError{ 48 | s: format(f, x...), 49 | err: err, 50 | } 51 | } 52 | 53 | type wrapError struct { 54 | s string 55 | err error 56 | } 57 | 58 | func (e *wrapError) Error() string { 59 | return format("%v%v: %v", prefix, e.s, e.err) 60 | } 61 | 62 | func (e *wrapError) Unwrap() error { 63 | return e.err 64 | } 65 | 66 | func (e *wrapError) Is(target error) bool { 67 | return target == Error 68 | } 69 | 70 | func format(f string, x ...any) string { 71 | // avoid "proto: " prefix when chaining 72 | for i := 0; i < len(x); i++ { 73 | switch e := x[i].(type) { 74 | case *prefixError: 75 | x[i] = e.s 76 | case *wrapError: 77 | x[i] = format("%v: %v", e.s, e.err) 78 | } 79 | } 80 | return fmt.Sprintf(f, x...) 81 | } 82 | 83 | func InvalidUTF8(name string) error { 84 | return New("field %v contains invalid UTF-8", name) 85 | } 86 | 87 | func RequiredNotSet(name string) error { 88 | return New("required field %v not set", name) 89 | } 90 | 91 | type SizeMismatchError struct { 92 | Calculated, Measured int 93 | } 94 | 95 | func (e *SizeMismatchError) Error() string { 96 | return fmt.Sprintf("size mismatch (see https://github.com/golang/protobuf/issues/1609): calculated=%d, measured=%d", e.Calculated, e.Measured) 97 | } 98 | 99 | func MismatchedSizeCalculation(calculated, measured int) error { 100 | return &SizeMismatchError{ 101 | Calculated: calculated, 102 | Measured: measured, 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.21 6 | 7 | package protoreflect 8 | 9 | import ( 10 | "unsafe" 11 | 12 | "google.golang.org/protobuf/internal/pragma" 13 | ) 14 | 15 | type ( 16 | stringHeader struct { 17 | Data unsafe.Pointer 18 | Len int 19 | } 20 | sliceHeader struct { 21 | Data unsafe.Pointer 22 | Len int 23 | Cap int 24 | } 25 | ifaceHeader struct { 26 | Type unsafe.Pointer 27 | Data unsafe.Pointer 28 | } 29 | ) 30 | 31 | var ( 32 | nilType = typeOf(nil) 33 | boolType = typeOf(*new(bool)) 34 | int32Type = typeOf(*new(int32)) 35 | int64Type = typeOf(*new(int64)) 36 | uint32Type = typeOf(*new(uint32)) 37 | uint64Type = typeOf(*new(uint64)) 38 | float32Type = typeOf(*new(float32)) 39 | float64Type = typeOf(*new(float64)) 40 | stringType = typeOf(*new(string)) 41 | bytesType = typeOf(*new([]byte)) 42 | enumType = typeOf(*new(EnumNumber)) 43 | ) 44 | 45 | // typeOf returns a pointer to the Go type information. 46 | // The pointer is comparable and equal if and only if the types are identical. 47 | func typeOf(t any) unsafe.Pointer { 48 | return (*ifaceHeader)(unsafe.Pointer(&t)).Type 49 | } 50 | 51 | // value is a union where only one type can be represented at a time. 52 | // The struct is 24B large on 64-bit systems and requires the minimum storage 53 | // necessary to represent each possible type. 54 | // 55 | // The Go GC needs to be able to scan variables containing pointers. 56 | // As such, pointers and non-pointers cannot be intermixed. 57 | type value struct { 58 | pragma.DoNotCompare // 0B 59 | 60 | // typ stores the type of the value as a pointer to the Go type. 61 | typ unsafe.Pointer // 8B 62 | 63 | // ptr stores the data pointer for a String, Bytes, or interface value. 64 | ptr unsafe.Pointer // 8B 65 | 66 | // num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or 67 | // Enum value as a raw uint64. 68 | // 69 | // It is also used to store the length of a String or Bytes value; 70 | // the capacity is ignored. 71 | num uint64 // 8B 72 | } 73 | 74 | func valueOfString(v string) Value { 75 | p := (*stringHeader)(unsafe.Pointer(&v)) 76 | return Value{typ: stringType, ptr: p.Data, num: uint64(len(v))} 77 | } 78 | func valueOfBytes(v []byte) Value { 79 | p := (*sliceHeader)(unsafe.Pointer(&v)) 80 | return Value{typ: bytesType, ptr: p.Data, num: uint64(len(v))} 81 | } 82 | func valueOfIface(v any) Value { 83 | p := (*ifaceHeader)(unsafe.Pointer(&v)) 84 | return Value{typ: p.Type, ptr: p.Data} 85 | } 86 | 87 | func (v Value) getString() (x string) { 88 | *(*stringHeader)(unsafe.Pointer(&x)) = stringHeader{Data: v.ptr, Len: int(v.num)} 89 | return x 90 | } 91 | func (v Value) getBytes() (x []byte) { 92 | *(*sliceHeader)(unsafe.Pointer(&x)) = sliceHeader{Data: v.ptr, Len: int(v.num), Cap: int(v.num)} 93 | return x 94 | } 95 | func (v Value) getIface() (x any) { 96 | *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} 97 | return x 98 | } 99 | -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/agext/levenshtein v1.2.3 2 | ## explicit 3 | github.com/agext/levenshtein 4 | # github.com/containerd/typeurl/v2 v2.2.3 5 | ## explicit; go 1.21 6 | github.com/containerd/typeurl/v2 7 | # github.com/docker/go-units v0.5.0 8 | ## explicit 9 | github.com/docker/go-units 10 | # github.com/gogo/protobuf v1.3.2 11 | ## explicit; go 1.15 12 | github.com/gogo/protobuf/proto 13 | # github.com/moby/buildkit v0.19.0 14 | ## explicit; go 1.22.0 15 | github.com/moby/buildkit/frontend/dockerfile/command 16 | github.com/moby/buildkit/frontend/dockerfile/instructions 17 | github.com/moby/buildkit/frontend/dockerfile/linter 18 | github.com/moby/buildkit/frontend/dockerfile/parser 19 | github.com/moby/buildkit/frontend/dockerfile/shell 20 | github.com/moby/buildkit/util/stack 21 | github.com/moby/buildkit/util/suggest 22 | # github.com/moby/docker-image-spec v1.3.1 23 | ## explicit; go 1.18 24 | github.com/moby/docker-image-spec/specs-go/v1 25 | # github.com/opencontainers/go-digest v1.0.0 26 | ## explicit; go 1.13 27 | github.com/opencontainers/go-digest 28 | # github.com/opencontainers/image-spec v1.1.0 29 | ## explicit; go 1.18 30 | github.com/opencontainers/image-spec/specs-go 31 | github.com/opencontainers/image-spec/specs-go/v1 32 | # github.com/pkg/errors v0.9.1 33 | ## explicit 34 | github.com/pkg/errors 35 | # github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 36 | ## explicit; go 1.20 37 | github.com/planetscale/vtprotobuf/protohelpers 38 | # github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 39 | ## explicit; go 1.16 40 | github.com/tonistiigi/go-csvvalue 41 | # github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 42 | ## explicit 43 | github.com/yalp/jsonpath 44 | # google.golang.org/protobuf v1.35.2 45 | ## explicit; go 1.21 46 | google.golang.org/protobuf/encoding/prototext 47 | google.golang.org/protobuf/encoding/protowire 48 | google.golang.org/protobuf/internal/descfmt 49 | google.golang.org/protobuf/internal/descopts 50 | google.golang.org/protobuf/internal/detrand 51 | google.golang.org/protobuf/internal/editiondefaults 52 | google.golang.org/protobuf/internal/encoding/defval 53 | google.golang.org/protobuf/internal/encoding/messageset 54 | google.golang.org/protobuf/internal/encoding/tag 55 | google.golang.org/protobuf/internal/encoding/text 56 | google.golang.org/protobuf/internal/errors 57 | google.golang.org/protobuf/internal/filedesc 58 | google.golang.org/protobuf/internal/filetype 59 | google.golang.org/protobuf/internal/flags 60 | google.golang.org/protobuf/internal/genid 61 | google.golang.org/protobuf/internal/impl 62 | google.golang.org/protobuf/internal/order 63 | google.golang.org/protobuf/internal/pragma 64 | google.golang.org/protobuf/internal/set 65 | google.golang.org/protobuf/internal/strs 66 | google.golang.org/protobuf/internal/version 67 | google.golang.org/protobuf/proto 68 | google.golang.org/protobuf/reflect/protoreflect 69 | google.golang.org/protobuf/reflect/protoregistry 70 | google.golang.org/protobuf/runtime/protoiface 71 | google.golang.org/protobuf/runtime/protoimpl 72 | google.golang.org/protobuf/types/known/anypb 73 | # github.com/containerd/containerd => github.com/containerd/containerd v1.7.22 74 | # github.com/docker/docker/v23/v20 => github.com/docker/docker v27.3.1+incompatible 75 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Docker open source projects 2 | 3 | Want to hack on this project? Awesome! Here are instructions to get you started. 4 | 5 | This project is a part of the [Docker](https://www.docker.com) project, and follows 6 | the same rules and principles. If you're already familiar with the way 7 | Docker does things, you'll feel right at home. 8 | 9 | Otherwise, go read Docker's 10 | [contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), 11 | [issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), 12 | [review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and 13 | [branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). 14 | 15 | For an in-depth description of our contribution process, visit the 16 | contributors guide: [Understand how to contribute](https://docs.docker.com/opensource/workflow/make-a-contribution/) 17 | 18 | ### Sign your work 19 | 20 | The sign-off is a simple line at the end of the explanation for the patch. Your 21 | signature certifies that you wrote the patch or otherwise have the right to pass 22 | it on as an open-source patch. The rules are pretty simple: if you can certify 23 | the below (from [developercertificate.org](http://developercertificate.org/)): 24 | 25 | ``` 26 | Developer Certificate of Origin 27 | Version 1.1 28 | 29 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 30 | 1 Letterman Drive 31 | Suite D4700 32 | San Francisco, CA, 94129 33 | 34 | Everyone is permitted to copy and distribute verbatim copies of this 35 | license document, but changing it is not allowed. 36 | 37 | 38 | Developer's Certificate of Origin 1.1 39 | 40 | By making a contribution to this project, I certify that: 41 | 42 | (a) The contribution was created in whole or in part by me and I 43 | have the right to submit it under the open source license 44 | indicated in the file; or 45 | 46 | (b) The contribution is based upon previous work that, to the best 47 | of my knowledge, is covered under an appropriate open source 48 | license and I have the right under that license to submit that 49 | work with modifications, whether created in whole or in part 50 | by me, under the same open source license (unless I am 51 | permitted to submit under a different license), as indicated 52 | in the file; or 53 | 54 | (c) The contribution was provided directly to me by some other 55 | person who certified (a), (b) or (c) and I have not modified 56 | it. 57 | 58 | (d) I understand and agree that this project and the contribution 59 | are public and that a record of the contribution (including all 60 | personal information I submit with it, including my sign-off) is 61 | maintained indefinitely and may be redistributed consistent with 62 | this project or the open source license(s) involved. 63 | ``` 64 | 65 | Then you just add a line to every git commit message: 66 | 67 | Signed-off-by: Joe Smith 68 | 69 | Use your real name (sorry, no pseudonyms or anonymous contributions.) 70 | 71 | If you set your `user.name` and `user.email` git configs, you can sign your 72 | commit automatically with `git commit -s`. 73 | -------------------------------------------------------------------------------- /vendor/github.com/moby/buildkit/frontend/dockerfile/parser/split_command.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "strings" 5 | "unicode" 6 | ) 7 | 8 | // splitCommand takes a single line of text and parses out the cmd and args, 9 | // which are used for dispatching to more exact parsing functions. 10 | func splitCommand(line string) (string, []string, string, error) { 11 | var args string 12 | var flags []string 13 | 14 | // Make sure we get the same results irrespective of leading/trailing spaces 15 | cmdline := reWhitespace.Split(strings.TrimSpace(line), 2) 16 | 17 | if len(cmdline) == 2 { 18 | var err error 19 | args, flags, err = extractBuilderFlags(cmdline[1]) 20 | if err != nil { 21 | return "", nil, "", err 22 | } 23 | } 24 | 25 | return cmdline[0], flags, strings.TrimSpace(args), nil 26 | } 27 | 28 | func extractBuilderFlags(line string) (string, []string, error) { 29 | // Parses the BuilderFlags and returns the remaining part of the line 30 | 31 | const ( 32 | inSpaces = iota // looking for start of a word 33 | inWord 34 | inQuote 35 | ) 36 | 37 | words := []string{} 38 | phase := inSpaces 39 | sbuilder := &strings.Builder{} 40 | quote := '\000' 41 | blankOK := false 42 | var ch rune 43 | 44 | for pos := 0; pos <= len(line); pos++ { 45 | if pos != len(line) { 46 | ch = rune(line[pos]) 47 | } 48 | 49 | if phase == inSpaces { // Looking for start of word 50 | if pos == len(line) { // end of input 51 | break 52 | } 53 | if unicode.IsSpace(ch) { // skip spaces 54 | continue 55 | } 56 | 57 | // Only keep going if the next word starts with -- 58 | if ch != '-' || pos+1 == len(line) || rune(line[pos+1]) != '-' { 59 | return line[pos:], words, nil 60 | } 61 | 62 | phase = inWord // found something with "--", fall through 63 | } 64 | if (phase == inWord || phase == inQuote) && (pos == len(line)) { 65 | if word := sbuilder.String(); word != "--" && (blankOK || len(word) > 0) { 66 | words = append(words, word) 67 | } 68 | break 69 | } 70 | if phase == inWord { 71 | if unicode.IsSpace(ch) { 72 | word := sbuilder.String() 73 | phase = inSpaces 74 | if word == "--" { 75 | return line[pos:], words, nil 76 | } 77 | if blankOK || len(word) > 0 { 78 | words = append(words, word) 79 | } 80 | sbuilder.Reset() 81 | blankOK = false 82 | continue 83 | } 84 | if ch == '\'' || ch == '"' { 85 | quote = ch 86 | blankOK = true 87 | phase = inQuote 88 | continue 89 | } 90 | if ch == '\\' { 91 | if pos+1 == len(line) { 92 | continue // just skip \ at end 93 | } 94 | pos++ 95 | ch = rune(line[pos]) 96 | } 97 | if _, err := sbuilder.WriteRune(ch); err != nil { 98 | return "", nil, err 99 | } 100 | continue 101 | } 102 | if phase == inQuote { 103 | if ch == quote { 104 | phase = inWord 105 | continue 106 | } 107 | if ch == '\\' { 108 | if pos+1 == len(line) { 109 | phase = inWord 110 | continue // just skip \ at end 111 | } 112 | pos++ 113 | ch = rune(line[pos]) 114 | } 115 | if _, err := sbuilder.WriteRune(ch); err != nil { 116 | return "", nil, err 117 | } 118 | } 119 | } 120 | 121 | return "", words, nil 122 | } 123 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/order/order.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package order 6 | 7 | import ( 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | // FieldOrder specifies the ordering to visit message fields. 12 | // It is a function that reports whether x is ordered before y. 13 | type FieldOrder func(x, y protoreflect.FieldDescriptor) bool 14 | 15 | var ( 16 | // AnyFieldOrder specifies no specific field ordering. 17 | AnyFieldOrder FieldOrder = nil 18 | 19 | // LegacyFieldOrder sorts fields in the same ordering as emitted by 20 | // wire serialization in the github.com/golang/protobuf implementation. 21 | LegacyFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool { 22 | ox, oy := x.ContainingOneof(), y.ContainingOneof() 23 | inOneof := func(od protoreflect.OneofDescriptor) bool { 24 | return od != nil && !od.IsSynthetic() 25 | } 26 | 27 | // Extension fields sort before non-extension fields. 28 | if x.IsExtension() != y.IsExtension() { 29 | return x.IsExtension() && !y.IsExtension() 30 | } 31 | // Fields not within a oneof sort before those within a oneof. 32 | if inOneof(ox) != inOneof(oy) { 33 | return !inOneof(ox) && inOneof(oy) 34 | } 35 | // Fields in disjoint oneof sets are sorted by declaration index. 36 | if inOneof(ox) && inOneof(oy) && ox != oy { 37 | return ox.Index() < oy.Index() 38 | } 39 | // Fields sorted by field number. 40 | return x.Number() < y.Number() 41 | } 42 | 43 | // NumberFieldOrder sorts fields by their field number. 44 | NumberFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool { 45 | return x.Number() < y.Number() 46 | } 47 | 48 | // IndexNameFieldOrder sorts non-extension fields before extension fields. 49 | // Non-extensions are sorted according to their declaration index. 50 | // Extensions are sorted according to their full name. 51 | IndexNameFieldOrder FieldOrder = func(x, y protoreflect.FieldDescriptor) bool { 52 | // Non-extension fields sort before extension fields. 53 | if x.IsExtension() != y.IsExtension() { 54 | return !x.IsExtension() && y.IsExtension() 55 | } 56 | // Extensions sorted by fullname. 57 | if x.IsExtension() && y.IsExtension() { 58 | return x.FullName() < y.FullName() 59 | } 60 | // Non-extensions sorted by declaration index. 61 | return x.Index() < y.Index() 62 | } 63 | ) 64 | 65 | // KeyOrder specifies the ordering to visit map entries. 66 | // It is a function that reports whether x is ordered before y. 67 | type KeyOrder func(x, y protoreflect.MapKey) bool 68 | 69 | var ( 70 | // AnyKeyOrder specifies no specific key ordering. 71 | AnyKeyOrder KeyOrder = nil 72 | 73 | // GenericKeyOrder sorts false before true, numeric keys in ascending order, 74 | // and strings in lexicographical ordering according to UTF-8 codepoints. 75 | GenericKeyOrder KeyOrder = func(x, y protoreflect.MapKey) bool { 76 | switch x.Interface().(type) { 77 | case bool: 78 | return !x.Bool() && y.Bool() 79 | case int32, int64: 80 | return x.Int() < y.Int() 81 | case uint32, uint64: 82 | return x.Uint() < y.Uint() 83 | case string: 84 | return x.String() < y.String() 85 | default: 86 | panic("invalid map key type") 87 | } 88 | } 89 | ) 90 | -------------------------------------------------------------------------------- /vendor/github.com/agext/levenshtein/README.md: -------------------------------------------------------------------------------- 1 | # A Go package for calculating the Levenshtein distance between two strings 2 | 3 | [![Release](https://img.shields.io/github/release/agext/levenshtein.svg?style=flat)](https://github.com/agext/levenshtein/releases/latest) 4 | [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/agext/levenshtein)  5 | [![Build Status](https://travis-ci.org/agext/levenshtein.svg?branch=master&style=flat)](https://travis-ci.org/agext/levenshtein) 6 | [![Coverage Status](https://coveralls.io/repos/github/agext/levenshtein/badge.svg?style=flat)](https://coveralls.io/github/agext/levenshtein) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/agext/levenshtein?style=flat)](https://goreportcard.com/report/github.com/agext/levenshtein) 8 | 9 | 10 | This package implements distance and similarity metrics for strings, based on the Levenshtein measure, in [Go](http://golang.org). 11 | 12 | ## Project Status 13 | 14 | v1.2.3 Stable: Guaranteed no breaking changes to the API in future v1.x releases. Probably safe to use in production, though provided on "AS IS" basis. 15 | 16 | This package is being actively maintained. If you encounter any problems or have any suggestions for improvement, please [open an issue](https://github.com/agext/levenshtein/issues). Pull requests are welcome. 17 | 18 | ## Overview 19 | 20 | The Levenshtein `Distance` between two strings is the minimum total cost of edits that would convert the first string into the second. The allowed edit operations are insertions, deletions, and substitutions, all at character (one UTF-8 code point) level. Each operation has a default cost of 1, but each can be assigned its own cost equal to or greater than 0. 21 | 22 | A `Distance` of 0 means the two strings are identical, and the higher the value the more different the strings. Since in practice we are interested in finding if the two strings are "close enough", it often does not make sense to continue the calculation once the result is mathematically guaranteed to exceed a desired threshold. Providing this value to the `Distance` function allows it to take a shortcut and return a lower bound instead of an exact cost when the threshold is exceeded. 23 | 24 | The `Similarity` function calculates the distance, then converts it into a normalized metric within the range 0..1, with 1 meaning the strings are identical, and 0 that they have nothing in common. A minimum similarity threshold can be provided to speed up the calculation of the metric for strings that are far too dissimilar for the purpose at hand. All values under this threshold are rounded down to 0. 25 | 26 | The `Match` function provides a similarity metric, with the same range and meaning as `Similarity`, but with a bonus for string pairs that share a common prefix and have a similarity above a "bonus threshold". It uses the same method as proposed by Winkler for the Jaro distance, and the reasoning behind it is that these string pairs are very likely spelling variations or errors, and they are more closely linked than the edit distance alone would suggest. 27 | 28 | The underlying `Calculate` function is also exported, to allow the building of other derivative metrics, if needed. 29 | 30 | ## Installation 31 | 32 | ``` 33 | go get github.com/agext/levenshtein 34 | ``` 35 | 36 | ## License 37 | 38 | Package levenshtein is released under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details. 39 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/typeurl/v2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The containerd Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package typeurl 18 | 19 | // Package typeurl assists with managing the registration, marshaling, and 20 | // unmarshaling of types encoded as protobuf.Any. 21 | // 22 | // A protobuf.Any is a proto message that can contain any arbitrary data. It 23 | // consists of two components, a TypeUrl and a Value, and its proto definition 24 | // looks like this: 25 | // 26 | // message Any { 27 | // string type_url = 1; 28 | // bytes value = 2; 29 | // } 30 | // 31 | // The TypeUrl is used to distinguish the contents from other proto.Any 32 | // messages. This typeurl library manages these URLs to enable automagic 33 | // marshaling and unmarshaling of the contents. 34 | // 35 | // For example, consider this go struct: 36 | // 37 | // type Foo struct { 38 | // Field1 string 39 | // Field2 string 40 | // } 41 | // 42 | // To use typeurl, types must first be registered. This is typically done in 43 | // the init function 44 | // 45 | // func init() { 46 | // typeurl.Register(&Foo{}, "Foo") 47 | // } 48 | // 49 | // This will register the type Foo with the url path "Foo". The arguments to 50 | // Register are variadic, and are used to construct a url path. Consider this 51 | // example, from the github.com/containerd/containerd/client package: 52 | // 53 | // func init() { 54 | // const prefix = "types.containerd.io" 55 | // // register TypeUrls for commonly marshaled external types 56 | // major := strconv.Itoa(specs.VersionMajor) 57 | // typeurl.Register(&specs.Spec{}, prefix, "opencontainers/runtime-spec", major, "Spec") 58 | // // this function has more Register calls, which are elided. 59 | // } 60 | // 61 | // This registers several types under a more complex url, which ends up mapping 62 | // to `types.containerd.io/opencontainers/runtime-spec/1/Spec` (or some other 63 | // value for major). 64 | // 65 | // Once a type is registered, it can be marshaled to a proto.Any message simply 66 | // by calling `MarshalAny`, like this: 67 | // 68 | // foo := &Foo{Field1: "value1", Field2: "value2"} 69 | // anyFoo, err := typeurl.MarshalAny(foo) 70 | // 71 | // MarshalAny will resolve the correct URL for the type. If the type in 72 | // question implements the proto.Message interface, then it will be marshaled 73 | // as a proto message. Otherwise, it will be marshaled as json. This means that 74 | // typeurl will work on any arbitrary data, whether or not it has a proto 75 | // definition, as long as it can be serialized to json. 76 | // 77 | // To unmarshal, the process is simply inverse: 78 | // 79 | // iface, err := typeurl.UnmarshalAny(anyFoo) 80 | // foo := iface.(*Foo) 81 | // 82 | // The correct type is automatically chosen from the type registry, and the 83 | // returned interface can be cast straight to that type. 84 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/annotations.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | const ( 18 | // AnnotationCreated is the annotation key for the date and time on which the image was built (date-time string as defined by RFC 3339). 19 | AnnotationCreated = "org.opencontainers.image.created" 20 | 21 | // AnnotationAuthors is the annotation key for the contact details of the people or organization responsible for the image (freeform string). 22 | AnnotationAuthors = "org.opencontainers.image.authors" 23 | 24 | // AnnotationURL is the annotation key for the URL to find more information on the image. 25 | AnnotationURL = "org.opencontainers.image.url" 26 | 27 | // AnnotationDocumentation is the annotation key for the URL to get documentation on the image. 28 | AnnotationDocumentation = "org.opencontainers.image.documentation" 29 | 30 | // AnnotationSource is the annotation key for the URL to get source code for building the image. 31 | AnnotationSource = "org.opencontainers.image.source" 32 | 33 | // AnnotationVersion is the annotation key for the version of the packaged software. 34 | // The version MAY match a label or tag in the source code repository. 35 | // The version MAY be Semantic versioning-compatible. 36 | AnnotationVersion = "org.opencontainers.image.version" 37 | 38 | // AnnotationRevision is the annotation key for the source control revision identifier for the packaged software. 39 | AnnotationRevision = "org.opencontainers.image.revision" 40 | 41 | // AnnotationVendor is the annotation key for the name of the distributing entity, organization or individual. 42 | AnnotationVendor = "org.opencontainers.image.vendor" 43 | 44 | // AnnotationLicenses is the annotation key for the license(s) under which contained software is distributed as an SPDX License Expression. 45 | AnnotationLicenses = "org.opencontainers.image.licenses" 46 | 47 | // AnnotationRefName is the annotation key for the name of the reference for a target. 48 | // SHOULD only be considered valid when on descriptors on `index.json` within image layout. 49 | AnnotationRefName = "org.opencontainers.image.ref.name" 50 | 51 | // AnnotationTitle is the annotation key for the human-readable title of the image. 52 | AnnotationTitle = "org.opencontainers.image.title" 53 | 54 | // AnnotationDescription is the annotation key for the human-readable description of the software packaged in the image. 55 | AnnotationDescription = "org.opencontainers.image.description" 56 | 57 | // AnnotationBaseImageDigest is the annotation key for the digest of the image's base image. 58 | AnnotationBaseImageDigest = "org.opencontainers.image.base.digest" 59 | 60 | // AnnotationBaseImageName is the annotation key for the image reference of the image's base image. 61 | AnnotationBaseImageName = "org.opencontainers.image.base.name" 62 | ) 63 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016-2022 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | import digest "github.com/opencontainers/go-digest" 18 | 19 | // Descriptor describes the disposition of targeted content. 20 | // This structure provides `application/vnd.oci.descriptor.v1+json` mediatype 21 | // when marshalled to JSON. 22 | type Descriptor struct { 23 | // MediaType is the media type of the object this schema refers to. 24 | MediaType string `json:"mediaType"` 25 | 26 | // Digest is the digest of the targeted content. 27 | Digest digest.Digest `json:"digest"` 28 | 29 | // Size specifies the size in bytes of the blob. 30 | Size int64 `json:"size"` 31 | 32 | // URLs specifies a list of URLs from which this object MAY be downloaded 33 | URLs []string `json:"urls,omitempty"` 34 | 35 | // Annotations contains arbitrary metadata relating to the targeted content. 36 | Annotations map[string]string `json:"annotations,omitempty"` 37 | 38 | // Data is an embedding of the targeted content. This is encoded as a base64 39 | // string when marshalled to JSON (automatically, by encoding/json). If 40 | // present, Data can be used directly to avoid fetching the targeted content. 41 | Data []byte `json:"data,omitempty"` 42 | 43 | // Platform describes the platform which the image in the manifest runs on. 44 | // 45 | // This should only be used when referring to a manifest. 46 | Platform *Platform `json:"platform,omitempty"` 47 | 48 | // ArtifactType is the IANA media type of this artifact. 49 | ArtifactType string `json:"artifactType,omitempty"` 50 | } 51 | 52 | // Platform describes the platform which the image in the manifest runs on. 53 | type Platform struct { 54 | // Architecture field specifies the CPU architecture, for example 55 | // `amd64` or `ppc64le`. 56 | Architecture string `json:"architecture"` 57 | 58 | // OS specifies the operating system, for example `linux` or `windows`. 59 | OS string `json:"os"` 60 | 61 | // OSVersion is an optional field specifying the operating system 62 | // version, for example on Windows `10.0.14393.1066`. 63 | OSVersion string `json:"os.version,omitempty"` 64 | 65 | // OSFeatures is an optional field specifying an array of strings, 66 | // each listing a required OS feature (for example on Windows `win32k`). 67 | OSFeatures []string `json:"os.features,omitempty"` 68 | 69 | // Variant is an optional field specifying a variant of the CPU, for 70 | // example `v7` to specify ARMv7 when architecture is `arm`. 71 | Variant string `json:"variant,omitempty"` 72 | } 73 | 74 | // DescriptorEmptyJSON is the descriptor of a blob with content of `{}`. 75 | var DescriptorEmptyJSON = Descriptor{ 76 | MediaType: MediaTypeEmptyJSON, 77 | Digest: `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`, 78 | Size: 2, 79 | Data: []byte(`{}`), 80 | } 81 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/order/range.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package order provides ordered access to messages and maps. 6 | package order 7 | 8 | import ( 9 | "sort" 10 | "sync" 11 | 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | ) 14 | 15 | type messageField struct { 16 | fd protoreflect.FieldDescriptor 17 | v protoreflect.Value 18 | } 19 | 20 | var messageFieldPool = sync.Pool{ 21 | New: func() any { return new([]messageField) }, 22 | } 23 | 24 | type ( 25 | // FieldRnger is an interface for visiting all fields in a message. 26 | // The protoreflect.Message type implements this interface. 27 | FieldRanger interface{ Range(VisitField) } 28 | // VisitField is called every time a message field is visited. 29 | VisitField = func(protoreflect.FieldDescriptor, protoreflect.Value) bool 30 | ) 31 | 32 | // RangeFields iterates over the fields of fs according to the specified order. 33 | func RangeFields(fs FieldRanger, less FieldOrder, fn VisitField) { 34 | if less == nil { 35 | fs.Range(fn) 36 | return 37 | } 38 | 39 | // Obtain a pre-allocated scratch buffer. 40 | p := messageFieldPool.Get().(*[]messageField) 41 | fields := (*p)[:0] 42 | defer func() { 43 | if cap(fields) < 1024 { 44 | *p = fields 45 | messageFieldPool.Put(p) 46 | } 47 | }() 48 | 49 | // Collect all fields in the message and sort them. 50 | fs.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { 51 | fields = append(fields, messageField{fd, v}) 52 | return true 53 | }) 54 | sort.Slice(fields, func(i, j int) bool { 55 | return less(fields[i].fd, fields[j].fd) 56 | }) 57 | 58 | // Visit the fields in the specified ordering. 59 | for _, f := range fields { 60 | if !fn(f.fd, f.v) { 61 | return 62 | } 63 | } 64 | } 65 | 66 | type mapEntry struct { 67 | k protoreflect.MapKey 68 | v protoreflect.Value 69 | } 70 | 71 | var mapEntryPool = sync.Pool{ 72 | New: func() any { return new([]mapEntry) }, 73 | } 74 | 75 | type ( 76 | // EntryRanger is an interface for visiting all fields in a message. 77 | // The protoreflect.Map type implements this interface. 78 | EntryRanger interface{ Range(VisitEntry) } 79 | // VisitEntry is called every time a map entry is visited. 80 | VisitEntry = func(protoreflect.MapKey, protoreflect.Value) bool 81 | ) 82 | 83 | // RangeEntries iterates over the entries of es according to the specified order. 84 | func RangeEntries(es EntryRanger, less KeyOrder, fn VisitEntry) { 85 | if less == nil { 86 | es.Range(fn) 87 | return 88 | } 89 | 90 | // Obtain a pre-allocated scratch buffer. 91 | p := mapEntryPool.Get().(*[]mapEntry) 92 | entries := (*p)[:0] 93 | defer func() { 94 | if cap(entries) < 1024 { 95 | *p = entries 96 | mapEntryPool.Put(p) 97 | } 98 | }() 99 | 100 | // Collect all entries in the map and sort them. 101 | es.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { 102 | entries = append(entries, mapEntry{k, v}) 103 | return true 104 | }) 105 | sort.Slice(entries, func(i, j int) bool { 106 | return less(entries[i].k, entries[j].k) 107 | }) 108 | 109 | // Visit the entries in the specified ordering. 110 | for _, e := range entries { 111 | if !fn(e.k, e.v) { 112 | return 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /vendor/github.com/planetscale/vtprotobuf/protohelpers/protohelpers.go: -------------------------------------------------------------------------------- 1 | // Package protohelpers provides helper functions for encoding and decoding protobuf messages. 2 | // The spec can be found at https://protobuf.dev/programming-guides/encoding/. 3 | package protohelpers 4 | 5 | import ( 6 | "fmt" 7 | "io" 8 | "math/bits" 9 | ) 10 | 11 | var ( 12 | // ErrInvalidLength is returned when decoding a negative length. 13 | ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") 14 | // ErrIntOverflow is returned when decoding a varint representation of an integer that overflows 64 bits. 15 | ErrIntOverflow = fmt.Errorf("proto: integer overflow") 16 | // ErrUnexpectedEndOfGroup is returned when decoding a group end without a corresponding group start. 17 | ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") 18 | ) 19 | 20 | // EncodeVarint encodes a uint64 into a varint-encoded byte slice and returns the offset of the encoded value. 21 | // The provided offset is the offset after the last byte of the encoded value. 22 | func EncodeVarint(dAtA []byte, offset int, v uint64) int { 23 | offset -= SizeOfVarint(v) 24 | base := offset 25 | for v >= 1<<7 { 26 | dAtA[offset] = uint8(v&0x7f | 0x80) 27 | v >>= 7 28 | offset++ 29 | } 30 | dAtA[offset] = uint8(v) 31 | return base 32 | } 33 | 34 | // SizeOfVarint returns the size of the varint-encoded value. 35 | func SizeOfVarint(x uint64) (n int) { 36 | return (bits.Len64(x|1) + 6) / 7 37 | } 38 | 39 | // SizeOfZigzag returns the size of the zigzag-encoded value. 40 | func SizeOfZigzag(x uint64) (n int) { 41 | return SizeOfVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 42 | } 43 | 44 | // Skip the first record of the byte slice and return the offset of the next record. 45 | func Skip(dAtA []byte) (n int, err error) { 46 | l := len(dAtA) 47 | iNdEx := 0 48 | depth := 0 49 | for iNdEx < l { 50 | var wire uint64 51 | for shift := uint(0); ; shift += 7 { 52 | if shift >= 64 { 53 | return 0, ErrIntOverflow 54 | } 55 | if iNdEx >= l { 56 | return 0, io.ErrUnexpectedEOF 57 | } 58 | b := dAtA[iNdEx] 59 | iNdEx++ 60 | wire |= (uint64(b) & 0x7F) << shift 61 | if b < 0x80 { 62 | break 63 | } 64 | } 65 | wireType := int(wire & 0x7) 66 | switch wireType { 67 | case 0: 68 | for shift := uint(0); ; shift += 7 { 69 | if shift >= 64 { 70 | return 0, ErrIntOverflow 71 | } 72 | if iNdEx >= l { 73 | return 0, io.ErrUnexpectedEOF 74 | } 75 | iNdEx++ 76 | if dAtA[iNdEx-1] < 0x80 { 77 | break 78 | } 79 | } 80 | case 1: 81 | iNdEx += 8 82 | case 2: 83 | var length int 84 | for shift := uint(0); ; shift += 7 { 85 | if shift >= 64 { 86 | return 0, ErrIntOverflow 87 | } 88 | if iNdEx >= l { 89 | return 0, io.ErrUnexpectedEOF 90 | } 91 | b := dAtA[iNdEx] 92 | iNdEx++ 93 | length |= (int(b) & 0x7F) << shift 94 | if b < 0x80 { 95 | break 96 | } 97 | } 98 | if length < 0 { 99 | return 0, ErrInvalidLength 100 | } 101 | iNdEx += length 102 | case 3: 103 | depth++ 104 | case 4: 105 | if depth == 0 { 106 | return 0, ErrUnexpectedEndOfGroup 107 | } 108 | depth-- 109 | case 5: 110 | iNdEx += 4 111 | default: 112 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 113 | } 114 | if iNdEx < 0 { 115 | return 0, ErrInvalidLength 116 | } 117 | if depth == 0 { 118 | return iNdEx, nil 119 | } 120 | } 121 | return 0, io.ErrUnexpectedEOF 122 | } 123 | --------------------------------------------------------------------------------