repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
eks-distro | aws | Go | package projects
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"github.com/aws/eks-distro/cmd/release/utils/projects"
)
var (
prevReleaseBranch string
nextReleaseBranch string
)
// CreateFilesAndDirectories returns the number of files generated. If there was an error, ret... | 134 |
eks-distro | aws | Go | package main
import (
"flag"
"fmt"
"log"
"os"
"strconv"
"github.com/aws/eks-distro/cmd/release/utils/changetype"
"github.com/aws/eks-distro/cmd/release/utils/git"
"github.com/aws/eks-distro/cmd/release/utils/values"
)
// Updates RELEASE number for dev or prod, depending on the values provided to the appropri... | 84 |
eks-distro | aws | Go | package changetype
import "fmt"
type ChangeType string
const (
Dev ChangeType = "development"
Prod ChangeType = "production"
Docs ChangeType = "docs"
GHRelease ChangeType = "gh_release"
)
func (ct ChangeType) String() string {
return string(ct)
}
func (ct ChangeType) IsDevOrProd() bool {
retu... | 31 |
eks-distro | aws | Go | package git
import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"github.com/aws/eks-distro/cmd/release/utils/values"
)
var (
prScriptPathFromRoot = filepath.Join(values.GetGitRootDirectory(), "cmd/release/utils/git/open-pr.sh")
outputStream io.Writer = os.Stdout
errStream io.Writ... | 46 |
eks-distro | aws | Go | package git
import (
"bytes"
"fmt"
"os/exec"
"strings"
"github.com/aws/eks-distro/cmd/release/utils/values"
)
const cmdName = "git"
var (
baseCmd = []string{"-C", values.GetGitRootDirectory()}
add = cmdRunner("add")
commit = cmdRunner("commit", "-m")
checkoutBranch = cmdRunner(... | 52 |
eks-distro | aws | Go | package projects
import (
"fmt"
"os"
"path/filepath"
"github.com/aws/eks-distro/cmd/release/utils/values"
)
var projectPathRoot = filepath.Join(values.GetGitRootDirectory(), "projects")
type Project struct {
org string
repo string
}
func GetProjects() ([]Project, error) {
orgDirs, err := os.ReadDir(project... | 79 |
eks-distro | aws | Go | package projects
import (
"bytes"
"fmt"
"os"
"path/filepath"
)
const (
gitTagFilename = "GIT_TAG"
golangFilename = "GOLANG_VERSION"
)
type Version struct {
gitTag string
golang string
}
func (v *Version) GetGitTag() string {
return v.gitTag
}
func (v *Version) GetGolang() string {
return v.golang
}
func... | 43 |
eks-distro | aws | Go | package release
import (
"fmt"
"github.com/aws/eks-distro/cmd/release/utils/changetype"
)
const (
MinNumber = 0
InvalidNumberUpperLimit = MinNumber - 1
)
type Release struct {
branch string
number string
kubernetesGitTag string // e.g. v1.23.1
tag string // e.g. v1-23-eks-1
mani... | 83 |
eks-distro | aws | Go | package release
import (
"fmt"
"strconv"
"strings"
"github.com/aws/eks-distro/cmd/release/utils/changetype"
"github.com/aws/eks-distro/cmd/release/utils/values"
)
const defaultReleaseEnv = changetype.Prod
func newRelease(releaseBranchInput string, overrideNumInput string, hasOverrideNum bool) (*Release, error)... | 77 |
eks-distro | aws | Go | package release
import (
"reflect"
"testing"
"github.com/aws/eks-distro/cmd/release/utils/changetype"
)
const (
validCT = changetype.Docs
validReleaseBranch = "1-24" // update when 1-24 no longer supported
// Only valid if Release was made with override number
validOverrideNumber = "1"
va... | 375 |
eks-distro | aws | Go | package values
import (
"bytes"
"fmt"
"io"
"net/http"
"regexp"
"sort"
"strings"
)
const (
ecrBase = "public.ecr.aws/eks-distro"
expectedStatusCode = 200
)
type component struct {
name, version, uri []byte
}
func GetComponentsFromReleaseManifest(releaseManifestURL string) (string, error) {
resp... | 81 |
eks-distro | aws | Go | package values
import (
"strings"
"testing"
)
func TestGetComponentsFromReleaseManifest(t *testing.T) {
type args struct {
url string
}
tests := []struct {
name string
args args
want string
wantErr bool
errMsgContains string
}{
{
name: "error_if_invalid_U... | 89 |
eks-distro | aws | Go | package values
import (
"fmt"
"os"
"os/exec"
"strings"
)
// If an error is encountered while assigning the value to gitRootDirectory, the program is terminated by panic().
// This heavy-handed response is because so much of the program depends on the gitRootDirectory value. If this value is
// missing, there is n... | 58 |
eks-distro | aws | Go | package values
import "fmt"
const (
IndexFileName = "index.md"
ReleaseAnnouncementFileName = "release-announcement.txt"
)
type ReleaseTag interface {
Tag() string
}
func GetChangelogFileName(rt ReleaseTag) string {
return fmt.Sprintf("CHANGELOG-%s.md", rt.Tag())
}
| 17 |
eks-distro | aws | Go | package values
import (
"path/filepath"
"strings"
)
var (
IndexPath = getAbsolutePath("docs", "contents", IndexFileName)
ReadmePath = getAbsolutePath("README.md")
docsLocalPath = filepath.Join("docs", "contents", "releases")
)
type PathValues interface {
Branch() string
Number() string
}
// GetRelease... | 56 |
eks-distro | aws | Go | package values
import (
"bytes"
"fmt"
"os"
"strings"
"github.com/aws/eks-distro/cmd/release/utils/changetype"
)
// GetLocalNumber returns the current number and the filepath to the local file used to determine that number for the
// provided branch and ct. The returned num only reflects the local environment an... | 34 |
eks-distro | aws | Go | package values
import (
"bytes"
"fmt"
"os"
"strconv"
"strings"
)
var (
supportedReleaseBranchesPath = getAbsolutePath("release", "SUPPORTED_RELEASE_BRANCHES").String()
defaultReleaseBranchPath = getAbsolutePath("release", "DEFAULT_RELEASE_BRANCH").String()
)
func IsDefaultReleaseBranch(providedReleaseBran... | 102 |
eks-distro | aws | Go | package values
import (
"context"
"fmt"
"strings"
"github.com/google/go-github/v52/github"
)
const (
baseQuery = "repo:aws/eks-distro is:pr is:merged"
githubTimeFormat = "2006-01-02T15:04:05+00:00"
)
func GetChangelogPRs(releaseVersion string, overrideNumber int) (string, error) {
githubClient := gith... | 93 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 94 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 39 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 23 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 107 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 88 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 34 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 90 |
eks-distro-build-tooling | aws | Go | /*
Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 230 |
eks-distro-build-tooling | aws | Go | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | 84 |
eks-distro-build-tooling | aws | Go | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | 32 |
eks-distro-build-tooling | aws | Go | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | 106 |
eks-distro-build-tooling | aws | Go | package dhcp4client
import (
"bytes"
"fmt"
"hash/fnv"
"math/rand"
"net"
"sync"
"syscall"
"time"
"github.com/d2g/dhcp4"
)
const (
MaxDHCPLen = 576
)
type Client struct {
hardwareAddr net.HardwareAddr //The HardwareAddr to send in the request.
ignoreServers []net.IP //List of Servers to Ignore re... | 417 |
eks-distro-build-tooling | aws | Go | package dhcp4client
import (
cryptorand "crypto/rand"
mathrand "math/rand"
)
func CryptoGenerateXID(b []byte) {
if _, err := cryptorand.Read(b); err != nil {
panic(err)
}
}
func MathGenerateXID(b []byte) {
if _, err := mathrand.Read(b); err != nil {
panic(err)
}
}
| 19 |
eks-distro-build-tooling | aws | Go | package dhcp4client
import (
"net"
"time"
)
type inetSock struct {
*net.UDPConn
laddr net.UDPAddr
raddr net.UDPAddr
}
func NewInetSock(options ...func(*inetSock) error) (*inetSock, error) {
c := &inetSock{
laddr: net.UDPAddr{IP: net.IPv4(0, 0, 0, 0), Port: 68},
raddr: net.UDPAddr{IP: net.IPv4bcast, Port: ... | 76 |
eks-distro-build-tooling | aws | Go | package dhcp4client
import (
"encoding/binary"
"math/rand"
"net"
"time"
"golang.org/x/sys/unix"
)
const (
minIPHdrLen = 20
maxIPHdrLen = 60
udpHdrLen = 8
ip4Ver = 0x40
ttl = 16
srcPort = 68
dstPort = 67
)
var (
bcastMAC = []byte{255, 255, 255, 255, 255, 255}
)
// abstracts AF_PA... | 148 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 151 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 178 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 40 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 117 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 162 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 37 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 117 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 162 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 37 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 151 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 178 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 40 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 117 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 162 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 37 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 117 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 162 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 37 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 117 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 162 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 37 |
eks-distro-build-tooling | aws | Go | package hcl
import (
"errors"
"fmt"
"reflect"
"sort"
"strconv"
"strings"
"github.com/hashicorp/hcl/hcl/ast"
"github.com/hashicorp/hcl/hcl/parser"
"github.com/hashicorp/hcl/hcl/token"
)
// This is the tag to use with structures to have settings for HCL
const tagName = "hcl"
var (
// nodeType holds a refere... | 730 |
eks-distro-build-tooling | aws | Go | // Package hcl decodes HCL into usable Go structures.
//
// hcl input can come in either pure HCL format or JSON format.
// It can be parsed into an AST, and then decoded into a structure,
// or it can be decoded directly from a string into a structure.
//
// If you choose to parse HCL into a raw AST, the benefit is th... | 12 |
eks-distro-build-tooling | aws | Go | package hcl
import (
"unicode"
"unicode/utf8"
)
type lexModeValue byte
const (
lexModeUnknown lexModeValue = iota
lexModeHcl
lexModeJson
)
// lexMode returns whether we're going to be parsing in JSON
// mode or HCL mode.
func lexMode(v []byte) lexModeValue {
var (
r rune
w int
offset int
)
... | 39 |
eks-distro-build-tooling | aws | Go | package hcl
import (
"fmt"
"github.com/hashicorp/hcl/hcl/ast"
hclParser "github.com/hashicorp/hcl/hcl/parser"
jsonParser "github.com/hashicorp/hcl/json/parser"
)
// ParseBytes accepts as input byte slice and returns ast tree.
//
// Input can be either JSON or HCL
func ParseBytes(in []byte) (*ast.File, error) {
... | 40 |
eks-distro-build-tooling | aws | Go | // Package ast declares the types used to represent syntax trees for HCL
// (HashiCorp Configuration Language)
package ast
import (
"fmt"
"strings"
"github.com/hashicorp/hcl/hcl/token"
)
// Node is an element in the abstract syntax tree.
type Node interface {
node()
Pos() token.Pos
}
func (File) node() ... | 220 |
eks-distro-build-tooling | aws | Go | package ast
import "fmt"
// WalkFunc describes a function to be called for each node during a Walk. The
// returned node can be used to rewrite the AST. Walking stops the returned
// bool is false.
type WalkFunc func(Node) (Node, bool)
// Walk traverses an AST in depth-first order: It starts by calling fn(node);
// ... | 53 |
eks-distro-build-tooling | aws | Go | package parser
import (
"fmt"
"github.com/hashicorp/hcl/hcl/token"
)
// PosError is a parse error that contains a position.
type PosError struct {
Pos token.Pos
Err error
}
func (e *PosError) Error() string {
return fmt.Sprintf("At %s: %s", e.Pos, e.Err)
}
| 18 |
eks-distro-build-tooling | aws | Go | // Package parser implements a parser for HCL (HashiCorp Configuration
// Language)
package parser
import (
"bytes"
"errors"
"fmt"
"strings"
"github.com/hashicorp/hcl/hcl/ast"
"github.com/hashicorp/hcl/hcl/scanner"
"github.com/hashicorp/hcl/hcl/token"
)
type Parser struct {
sc *scanner.Scanner
// Last read... | 533 |
eks-distro-build-tooling | aws | Go | package printer
import (
"bytes"
"fmt"
"sort"
"github.com/hashicorp/hcl/hcl/ast"
"github.com/hashicorp/hcl/hcl/token"
)
const (
blank = byte(' ')
newline = byte('\n')
tab = byte('\t')
infinity = 1 << 30 // offset or line
)
var (
unindent = []byte("\uE123") // in the private use space
)
type prin... | 790 |
eks-distro-build-tooling | aws | Go | // Package printer implements printing of AST nodes to HCL format.
package printer
import (
"bytes"
"io"
"text/tabwriter"
"github.com/hashicorp/hcl/hcl/ast"
"github.com/hashicorp/hcl/hcl/parser"
)
var DefaultConfig = Config{
SpacesWidth: 2,
}
// A Config node controls the output of Fprint.
type Config struct ... | 67 |
eks-distro-build-tooling | aws | Go | // Package scanner implements a scanner for HCL (HashiCorp Configuration
// Language) source text.
package scanner
import (
"bytes"
"fmt"
"os"
"regexp"
"unicode"
"unicode/utf8"
"github.com/hashicorp/hcl/hcl/token"
)
// eof represents a marker rune for the end of the reader.
const eof = rune(0)
// Scanner def... | 653 |
eks-distro-build-tooling | aws | Go | package strconv
import (
"errors"
"unicode/utf8"
)
// ErrSyntax indicates that a value does not have the right syntax for the target type.
var ErrSyntax = errors.New("invalid syntax")
// Unquote interprets s as a single-quoted, double-quoted,
// or backquoted Go string literal, returning the string value
// that s... | 242 |
eks-distro-build-tooling | aws | Go | package token
import "fmt"
// Pos describes an arbitrary source position
// including the file, line, and column location.
// A Position is valid if the line number is > 0.
type Pos struct {
Filename string // filename, if any
Offset int // offset, starting at 0
Line int // line number, starting at 1
... | 47 |
eks-distro-build-tooling | aws | Go | // Package token defines constants representing the lexical tokens for HCL
// (HashiCorp Configuration Language)
package token
import (
"fmt"
"strconv"
"strings"
hclstrconv "github.com/hashicorp/hcl/hcl/strconv"
)
// Token defines a single HCL token which can be obtained via the Scanner
type Token struct {
Type... | 220 |
eks-distro-build-tooling | aws | Go | package parser
import "github.com/hashicorp/hcl/hcl/ast"
// flattenObjects takes an AST node, walks it, and flattens
func flattenObjects(node ast.Node) {
ast.Walk(node, func(n ast.Node) (ast.Node, bool) {
// We only care about lists, because this is what we modify
list, ok := n.(*ast.ObjectList)
if !ok {
re... | 118 |
eks-distro-build-tooling | aws | Go | package parser
import (
"errors"
"fmt"
"github.com/hashicorp/hcl/hcl/ast"
hcltoken "github.com/hashicorp/hcl/hcl/token"
"github.com/hashicorp/hcl/json/scanner"
"github.com/hashicorp/hcl/json/token"
)
type Parser struct {
sc *scanner.Scanner
// Last read token
tok token.Token
commaPrev token.Token
... | 314 |
eks-distro-build-tooling | aws | Go | package scanner
import (
"bytes"
"fmt"
"os"
"unicode"
"unicode/utf8"
"github.com/hashicorp/hcl/json/token"
)
// eof represents a marker rune for the end of the reader.
const eof = rune(0)
// Scanner defines a lexical scanner
type Scanner struct {
buf *bytes.Buffer // Source buffer for advancing and scanning
... | 452 |
eks-distro-build-tooling | aws | Go | package token
import "fmt"
// Pos describes an arbitrary source position
// including the file, line, and column location.
// A Position is valid if the line number is > 0.
type Pos struct {
Filename string // filename, if any
Offset int // offset, starting at 0
Line int // line number, starting at 1
... | 47 |
eks-distro-build-tooling | aws | Go | package token
import (
"fmt"
"strconv"
hcltoken "github.com/hashicorp/hcl/hcl/token"
)
// Token defines a single HCL token which can be obtained via the Scanner
type Token struct {
Type Type
Pos Pos
Text string
}
// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language)
type Type int... | 119 |
eks-distro-build-tooling | aws | Go | package lru
import (
"fmt"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
const (
// Default2QRecentRatio is the ratio of the 2Q cache dedicated
// to recently added entries that have only been accessed once.
Default2QRecentRatio = 0.25
// Default2QGhostEntries is the default ratio of ghost
// entries... | 224 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC).
// ARC is an enhancement over the standard LRU cache in that tracks both
// frequency and recency of use. This avoids a burst in access to new
// entries from evicting... | 258 |
eks-distro-build-tooling | aws | Go | // Package lru provides three different LRU caches of varying sophistication.
//
// Cache is a simple LRU cache. It is based on the
// LRU implementation in groupcache:
// https://github.com/golang/groupcache/tree/master/lru
//
// TwoQueueCache tracks frequently used and recently used entries separately.
// This avoids... | 22 |
eks-distro-build-tooling | aws | Go | package lru
import (
"sync"
"github.com/hashicorp/golang-lru/simplelru"
)
// Cache is a thread-safe fixed size LRU cache.
type Cache struct {
lru simplelru.LRUCache
lock sync.RWMutex
}
// New creates an LRU of the given size.
func New(size int) (*Cache, error) {
return NewWithEvict(size, nil)
}
// NewWithEvi... | 117 |
eks-distro-build-tooling | aws | Go | package simplelru
import (
"container/list"
"errors"
)
// EvictCallback is used to get a callback when a cache entry is evicted
type EvictCallback func(key interface{}, value interface{})
// LRU implements a non-thread safe fixed size LRU cache
type LRU struct {
size int
evictList *list.List
items map[... | 162 |
eks-distro-build-tooling | aws | Go | package simplelru
// LRUCache is the interface for simple LRU cache.
type LRUCache interface {
// Adds a value to the cache, returns true if an eviction occurred and
// updates the "recently used"-ness of the key.
Add(key, value interface{}) bool
// Returns key's value from the cache and
// updates the "recently... | 37 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.