text stringlengths 3.08k 10.4k |
|---|
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"github.com/gentlemanautomaton/globber"
fw "github.com/scjalliance/dpmafirmware"
)
// Filter matches models and files.
type Filter struct {
Models globber.Set // Comma or whitespace separated, glob matchin... |
package client
import (
"encoding/json"
"time"
"github.com/shopspring/decimal"
)
type InvoiceCreation struct {
// These are required fields
Currency string `json:"currency"`
Price float64 `json:"price"`
Token string `json:"token"`
// These are optional fields below
OrderID string `jso... |
package peerexchange
import (
"bufio"
"context"
"fmt"
"net"
"time"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
ma "github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr/net"
"go.uber.org/atomic"
"gi... |
package main
import (
"encoding/json"
"fmt"
"github.com/fsnotify/fsnotify"
"github.com/gorilla/mux"
"github.com/tenderly/solidity-hmr/etherscan"
"github.com/tenderly/solidity-hmr/truffle"
"io/ioutil"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
)
var config *truffle.Config
const (
port = ... |
// Copyright 2021 Google LLC. 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 required by applicable... |
package libfgg
import (
"context"
"encoding/json"
"errors"
"time"
"filegogo/libfgg/transfer"
"filegogo/libfgg/webrtc"
"filegogo/libfgg/websocket"
pion "github.com/pion/webrtc/v3"
"github.com/sb-im/jsonrpc-lite"
log "github.com/sirupsen/logrus"
)
type Fgg struct {
Tran *transfer.Transfer
Conn Conn
ws ... |
package mq
import (
"cloud.google.com/go/pubsub"
"fmt"
"github.com/invokit/go-util/debug"
"github.com/invokit/vorspiel-lib/mq"
"golang.org/x/net/context"
"github.com/rs/xid"
"log"
"os"
"strings"
)
var dbg = debug.NewLogger("github.com/invokit/vorspiel-lib/google/mq")
var logger = log.New(os.Stderr, "", log.L... |
// Copyright (C) 2017 ScyllaDB
package repair
import (
"bytes"
"fmt"
"sort"
"github.com/cespare/xxhash/v2"
"github.com/scylladb/go-set/strset"
"github.com/scylladb/scylla-manager/pkg/dht"
"github.com/scylladb/scylla-manager/pkg/scyllaclient"
)
type tableTokenRange struct {
Keyspace string
Table stri... |
// +build e2e
/*
Copyright 2019 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 ... |
// Copyright 2020 Red Hat, Inc.
//
// 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 i... |
package main
import (
"crypto/md5"
"encoding/hex"
"flag"
"fmt"
"image"
"image/color"
"image/draw"
"image/png"
"log"
"net/http"
"os"
"regexp"
"strconv"
"strings"
"github.com/BurntSushi/toml"
"github.com/gorilla/mux"
)
// https://processing.org/reference/map_.html
func remap(value uint32, vmin uint32, ... |
package oneagent
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"os"
"testing"
api "github.com/Dynatrace/dynatrace-oneagent-operator/pkg/apis/dynatrace/v1alpha1"
dynatracev1alpha1 "github.com/Dynatrace/dynatrace-oneagent-operator/pkg/apis/dynatrace/v1alpha1"
dtclient "github.com/Dynatrace/... |
/*
Copyright 2019 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... |
package main
import (
"time"
"github.com/bwmarrin/snowflake"
"github.com/mitchellh/mapstructure"
)
// REST types
// Deprecated
type responseGetGateway struct {
URL string `json:"url"`
}
// Gateway opcodes
const (
GW_OP_HEARTBEAT_ACK = 11
GW_OP_HELLO = 10
GW_OP_INVALID_SESSION = 9
GW_OP_RESUME ... |
// SPDX-License-Identifier: Apache-2.0
// Copyright The Linux Foundation and npm-spdx contributors.
package npm
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
)
// GetVersionData queries the NPM API for a specified package
// and version, and returns a RegistryVersion object ... |
/*
* Copyright 2016 <NAME>
*
* 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 wr... |
package display
import (
"fmt"
"strings"
"github.com/auth0/auth0-cli/internal/ansi"
"github.com/auth0/auth0-cli/internal/auth0"
"gopkg.in/auth0.v5/management"
)
type actionView struct {
ID string
Name string
CreatedAt string
Type string
raw interface{}
}
func (v *actionView) AsTable... |
/*
Copyright The containerd 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... |
// Copyright (c) 2019 Cisco and/or its affiliates.
//
// 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 app... |
package v1
import (
"context"
"log"
"os"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"time"
"github.com/docker/docker/api/types/container"
"github.com/golang/protobuf/ptypes/empty"
v1 "github.com/onuryartasi/scaler/pkg/api/v1"
"encoding/json"
"fmt"
"strconv"
"github.com/onu... |
// Copyright © 2020 <NAME>
//
// 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 wri... |
// haveibeenpwned.com cli for get breached accounts details
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"github.com/jessevdk/go-flags"
"io"
"log"
"os"
"strings"
"time"
)
// current program version
const Version = "v0.1.0"
/*
TODO: logs (color)
TODO: nicer formatting (color / emoji)
*/
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rekognition
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type StartContentModerationInput struct {
_ struct{} `type:"structure"`
// Idempotent token used to identify the star... |
package main
import (
"archive/zip"
"context"
"flag"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
"bazil.org/fuse"
"bazil.org/fuse/fs"
)
var progName = filepath.Base(os.Args[0])
func usage() {
fmt.Fprintf(os.Stderr, "Usage of %s:\n", progName)
fmt.Fprintf(os.Stderr, " %s file.zip mountpoint\n", pro... |
package pulsar
import (
"encoding/json"
"fmt"
"hash/fnv"
"io"
"io/ioutil"
"sort"
"time"
"github.com/linkedin/goavro"
"github.com/prometheus/common/model"
)
type Serializer interface {
Marshal(*Sample) ([]byte, error)
Unmarshal([]byte) (*Sample, error)
}
// JSONSerializer represents the sample in the upst... |
// Copyright © 2017 Aqua Security Software Ltd. <<EMAIL>>
//
// 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 app... |
// +build freebsd netbsd openbsd dragonfly darwin
package immortal
import (
"fmt"
"log"
"math/rand"
"os"
"path/filepath"
"strings"
"sync"
"time"
)
// ScanDir struct
type ScanDir struct {
scandir string
sdir string
services sync.Map
watch chan string
}
// NewScanDir returns ScanDir struct
func Ne... |
// Copyright © 2022 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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
//
// Unle... |
package db
import (
"context"
"time"
"github.com/golang/protobuf/ptypes"
v1 "github.com/thought-machine/dracon/api/proto/v1"
)
type issue struct {
Hash string `db:"hash"`
FirstSeen time.Time `db:"first_seen"`
Occurrences uint64 `db:"occurrences"`
FalsePositive bool `db:"false_positi... |
package test
import (
"strconv"
"strings"
"testing"
"github.com/iotaledger/goshimmer/packages/ledgerstate"
"github.com/iotaledger/wasp/contracts/common"
"github.com/iotaledger/wasp/packages/hashing"
"github.com/iotaledger/wasp/packages/iscp"
"github.com/iotaledger/wasp/packages/kv/codec"
"github.com/iotaledg... |
package main
import (
"encoding/json"
"fmt"
"strconv"
mqtt "github.com/eclipse/paho.mqtt.golang"
log "github.com/sirupsen/logrus"
)
// TempSensorConfig supports reading in sensor data from a bunch of topics (the "subs") and
// posting a single string to another topic at the given offsets.
type TempSensorConfig ... |
package main
import (
"fmt"
"log"
"math"
"net/http"
"os"
"strconv"
"github.com/codegangsta/cli"
"github.com/mdlayher/untappd"
)
const (
// appName is the name of this binary.
appName = "untappdctl"
)
func main() {
// Initialize new CLI app
app := cli.NewApp()
app.Name = appName
app.Usage = "query and ... |
package router
import (
"fmt"
"net/url"
"reflect"
"strconv"
"strings"
"github.com/ml-tv/tv-api/src/core/network/http/httperr"
"github.com/ml-tv/tv-api/src/core/primitives/strngs"
)
// ParamOptions represent all the options for a field
type ParamOptions struct {
// Ignore means the field should not been parse... |
package websocket
import (
"bytes"
"crypto/sha1"
"encoding/base64"
"io"
"net/http"
"net/textproto"
"net/url"
"strings"
"golang.org/x/net/http/httpguts"
"golang.org/x/xerrors"
)
// AcceptOptions represents the options available to pass to Accept.
type AcceptOptions struct {
// Subprotocols lists the websoc... |
// Copyright (c) 2020 Cisco Systems and/or its affiliates.
// Licensed under the Apache License, Version 2.0 (the "License");
// that can be found in the LICENSE file in the root of the source
// tree.
package main
import (
"emu/core"
"fmt"
"log"
"math/rand"
"os"
"time"
"github.com/akamensky/argparse"
"github... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package chime
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type UpdateRoomMembershipInput struct {
_ struct{} `type:"structure"`
// T... |
/*
Copyright (c) 2019 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package printer
import (
"context"
"fmt"
"strings"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
extv1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/util/sets"
"github.com/vmware/octant/pkg/v... |
package dramautils
import (
"fmt"
"os"
"path"
"path/filepath"
"sync"
jsoniter "github.com/json-iterator/go"
"github.com/zhs007/drama"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var logger *zap.Logger
var onceLogger sync.Once
var logPath string
// var panicFile *os.File
var logSubName string
func initPa... |
/*
Copyright 2017 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, ... |
package v1alpha1
import (
"fmt"
"kubedb.dev/apimachinery/apis"
"kubedb.dev/apimachinery/apis/kubedb"
"github.com/appscode/go/types"
apps "k8s.io/api/apps/v1"
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
crdutils "kmodules.xyz/client-go/apiextensions/v1beta1"
meta_util "kmodul... |
package grizzly
import (
"encoding/json"
"fmt"
"github.com/gobwas/glob"
"github.com/grafana/tanka/pkg/kubernetes/manifest"
"gopkg.in/yaml.v3"
)
// Resource represents a single Resource destined for a single endpoint
type Resource map[string]interface{}
// NewResource returns a new Resource object
func NewResou... |
package keboola
import (
"encoding/json"
"fmt"
"log"
"net/url"
"github.com/hashicorp/terraform/helper/schema"
"github.com/plmwong/terraform-provider-keboola/plugin/providers/keboola/buffer"
)
//region Keboola API Contracts
type ElasticSearchWriterTableItem struct {
Name string `json:"name"`
Type ... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package rekognition
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/rekognition/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "githu... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Returns the default object ACL entry for the specified entity on the ... |
package ebnfparser
import (
"fmt"
"strings"
"github.com/hashicorp/hcl/hcl/strconv"
"github.com/spf13/afero"
"github.com/anz-bank/sysl/pkg/eval"
"github.com/anz-bank/sysl/pkg/sysl"
"github.com/sirupsen/logrus"
)
type EbnfGrammar struct {
Rules map[string][]TermNode
Start string
}
func ReadGrammar(fs afer... |
// Copyright 2019 Liquidata, Inc.
//
// 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... |
// Copyright 2018 the LinuxBoot Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package visitors
import (
"errors"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/linuxboot/fiano/pkg/uefi"
)
var (
force = flag.Bo... |
package models
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"sync"
"time"
"go.opencensus.io/trace"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
const (
serverObjectsEndpointURL = "/objects/"
)
var (
CallbackSelfDeleteTime = 30 * time.Second
)
// CallbackService defines a set of method... |
package execution
import (
"fmt"
"github.com/go-pg/pg"
"github.com/google/uuid"
"net/http"
"scheduler0/server/managers/job"
"scheduler0/server/models"
"scheduler0/utils"
"time"
)
// Manager this manager handles interacting with the database for all execution entity type
type Manager models.ExecutionModel
// ... |
package weixin
import (
"encoding/json"
"fmt"
"os"
)
// 客服消息接口
const (
CustomAddURL = "https://api.weixin.qq.com/customservice/kfaccount/add?access_token=%s"
CustomUpdateURL = "https://api.weixin.qq.com/customservice/kfaccount/update?access_token=%s"
CustomDeleteURL = "https://api.weixin.qq.com/customservice... |
// Copyright (c) 2021 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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/LIC... |
package game
import (
"github.com/faiface/pixel/pixelgl"
"retro-carnage/assets"
"retro-carnage/engine"
"retro-carnage/engine/input"
"retro-carnage/logging"
"retro-carnage/ui/common"
"retro-carnage/ui/highscore"
"time"
)
// Screen in this package is the one that show the actual gameplay.
type Screen struct {
... |
/*
* Copyright 2022 InfAI (CC SES)
*
* 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 t... |
package confluent
import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/benthosdev/benthos/v4/public/service"
)
func TestSchemaRegistryDecoderConfigParse(t *testing.T) {
configTests :... |
// Package linkie implements the protocol for TP-Link smart home devices with
// xor-encoded communication over port 9999.
//
// TODO: discovery
package linkie
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net"
"time"
"github.com/pgaskin/kasa/transport"
)
const (
DevicePort = 9999
CryptoIV = byte(0xAB)
)
... |
// Copyright 2020 The SQLFlow Authors. 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 required by applicab... |
package wstnet
import (
"fmt"
"net"
"os"
"path/filepath"
"sync"
"syscall"
"github.com/sammck-go/logger"
)
// LockedUnixSocketListener is a transparent wrapper around a unix domain socket net.Listener
// That holds a flock-style file lock on a parallel ".lock" file that can be
// used to prevent collisions of ... |
// Copyright 2017 <NAME> <<EMAIL>>
package httpapi
import (
"context"
"encoding/json"
"fmt"
"net/http"
"strconv"
"strings"
"time"
"github.com/golang/glog"
"github.com/zhangpeihao/zim/pkg/app"
"github.com/zhangpeihao/zim/pkg/define"
"github.com/zhangpeihao/zim/pkg/protocol"
"github.com/zhangpeihao/zim/pkg... |
package main
import (
"fmt"
)
func genQueryObject(qInfo QueryInfo, cols []ColDesc) {
goQueryName := convertCase(qInfo.Name)
//========= Generate the imports ===========
{
ff("%s", `import (
"errors"
"fmt"
"time"
"github.com/jackc/pgx"
"github.com/jackc/pgx/pgtype"
)
`)
}
//--------------------------... |
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"net/http"
"strconv"
"time"
"github.com/gorilla/mux"
)
var port string = "8080" // have to port-forward this
var wc http.Client = http.Client{}
func random_fn(category string) (string, int) {
_files, _ := ioutil.ReadDir("./im... |
package service
import (
"context"
"sort"
"sync"
"go-common/app/interface/openplatform/article/dao"
artmdl "go-common/app/interface/openplatform/article/model"
"go-common/library/log"
"go-common/library/sync/errgroup"
)
// UpArticleMetas list up article metas
func (s *Service) UpArticleMetas(c context.Contex... |
/*
* Copyright (C) 2019 The oneroot-network Authors
* This file is part of The onerootchain library.
*
* The onerootchain is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the Li... |
package scc
import (
"bytes"
"fmt"
"math"
"strings"
"github.com/thiagopnts/caps"
)
type Writer struct{}
type codeMetadata struct {
Code string
Start *float64
End *float64
}
func (w *Writer) Write(captionSet *caps.CaptionSet) ([]byte, error) {
output := bytes.NewBufferString(header)
output.WriteString(... |
package command
import (
"flag"
"fmt"
"strings"
"github.com/hashicorp/consul/command/agent"
"github.com/mitchellh/cli"
)
// KeyringCommand is a Command implementation that handles querying, installing,
// and removing gossip encryption keys from a keyring.
type KeyringCommand struct {
Ui cli.Ui
}
func (c *Key... |
package mysql
import (
"context"
"fmt"
"math"
"math/rand"
"strings"
"testing"
"time"
"github.com/fleetdm/fleet/v4/server/fleet"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func slowStats(t *testing.T, ds *Datastore, id uint, percentile int, table, column string) float64 {
... |
package aorm
import (
"errors"
"fmt"
"reflect"
"strings"
)
// JoinTableForeignKey join table foreign key struct
type JoinTableForeignKey struct {
DBName string
AssociationField *StructField
}
// JoinTableSource is a struct that contains model type and foreign keys
type JoinTableSource struct {
Model... |
package e2e
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io"
"os"
"path"
"path/filepath"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2019-06-01/insights"
"github.com/Azure/go-autorest/autorest/azure/auth"
"github.com/Azure/go-autorest/autorest/to"
"github.com/a... |
// Package binio provides high-performance functionality for binary IO.
//
// The package is currently thread-unsafe, even when writing to different
// writers.
package binio
// TODO(amit): Make the package thread-safe.
import (
"fmt"
"io"
)
var (
// TODO(amit): This renders the package thread-unsafe.
buf = make... |
/**
* Copyright 2020 Appvia Ltd <<EMAIL>>
*
* 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 ... |
/*
Copyright 2017 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, ... |
package remoteclient
//go:generate mockgen -source=./remoteclient.go -destination=./mock/remoteclient_generated.go -package=mock
import (
"context"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"sigs.k8s.io/controller... |
package kubepkg
import (
"archive/tar"
"compress/gzip"
"context"
"encoding/json"
"io"
"strings"
"github.com/octohelm/kubepkg/pkg/ioutil"
"github.com/distribution/distribution/v3"
"github.com/distribution/distribution/v3/reference"
"github.com/distribution/distribution/v3/registry/storage"
"github.com/dist... |
package entrypoint
import (
"log"
"strings"
amb "github.com/datawire/ambassador/pkg/api/getambassador.io/v2"
"github.com/datawire/ambassador/pkg/kates"
)
func (s *AmbassadorInputs) ReconcileSecrets() {
var resources []kates.Object
for _, a := range s.annotations {
if include(GetAmbId(a)) {
resources = app... |
/*---------------------------------------------------------------------------------------------
* Copyright (c) IBAX. All rights reserved.
* See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
package api
import ... |
// Package compiler is the backend compiler package for Kubeflow Pipelines v2.
//
// KFP pipeline DSL in python are first compiled by KFP SDK (the frontend compiler)
// to pipeline spec in JSON format. KFP SDK / frontend compiler is not part of
// this package.
// Then, the backend compiler (this package) compiles pipe... |
package graphql
import (
"fmt"
"github.com/vektah/gqlparser/v2/ast"
)
// CollectedField is a representations of a field with the list of selection sets that
// must be merged under that field.
type CollectedField struct {
*ast.Field
NestedSelections []ast.SelectionSet
}
// CollectedFieldList is a list of Collec... |
// Copyright Project Harbor 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 t... |
package generator
import (
"github.com/pkg/errors"
. "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Netpol helps us to avoid the To/From Ingress/Egress dance. By splitting a NetworkPolicy into
// Target and Peers, it makes them easier to manipulate.
type Netpol struct {
Name ... |
package captcha
import (
"github.com/lexkong/log"
"github.com/satori/go.uuid"
"groot/comm/constk"
"groot/proto/cserr"
"groot/proto/ssmsg"
"groot/service/captcha/model"
"groot/sfw/crypto"
"groot/sfw/util"
"strconv"
"strings"
"time"
)
type (
ApplyCodeOptions struct {
Data string
MaxLength int... |
package renderer
import (
"github.com/PucklaMotzer09/GoHomeEngine/src/gohome"
gl "github.com/PucklaMotzer09/android-go/gles31"
"image"
"image/color"
)
type OpenGLES31CubeMap struct {
name string
oglName uint32
width int
height int
shadowMap bool
}
func (this *OpenGLES31CubeMap) GetName() strin... |
package alfred
// an implementation of an A.L.F.R.E.D. server
import (
"bufio"
"github.com/tv42/topic"
"log"
"net"
"sync"
"time"
)
const (
// slave mode: regularly forward local data
SERVER_MODE_SLAVE = iota
// master mode: receive and cache data from slaves, local data, and sync it all to all other known m... |
// Copyright (c) 2021 Terminus, Inc.
//
// 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 agree... |
// Copyright 2013 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package straps implements a simple way to store application settings and set environment
variable in an XML document.
Configuration
Straps expects a file name stra... |
package util
import (
"strconv"
"strings"
)
func CalculateTemplate(expression string, material map[string]string) (int, error) {
if a, err := Calculate(parse1(expression, material)); err != nil {
return 0, err
} else {
return a, nil
}
}
func CalculateTemplateBool(expression string, material map[string]strin... |
package main
import (
"fmt"
"github.com/abhinav/tmux-fastcopy/internal/fastcopy"
"github.com/abhinav/tmux-fastcopy/internal/log"
"github.com/abhinav/tmux-fastcopy/internal/tmux"
"github.com/abhinav/tmux-fastcopy/internal/ui"
tcell "github.com/gdamore/tcell/v2"
)
// app implements the main fastcopy application ... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
package flare
import (
"fmt"
"io"
"github.com/fatih/color"
"github.... |
/*
Copyright 2015 The Kubernetes Authors 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 required by applicable law or ag... |
// Copyright © 2022 BoxBoat <EMAIL>
//
// 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 ... |
//go:build linux
// +build linux
package raspberrypi_pinout_status
import (
"bytes"
"errors"
"fmt"
"log"
"os/exec"
"regexp"
"strconv"
"strings"
"syscall"
"time"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
type PinOutStatus struct {
GPIO int
Level int
FSel... |
// Based on https://github.com/kubernetes-retired/heapster/blob/master/metrics/util/util.go
// Diff against master for changes to the original code.
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance... |
package sdktests
import (
"fmt"
"time"
h "github.com/launchdarkly/sdk-test-harness/framework/helpers"
"github.com/launchdarkly/sdk-test-harness/framework/ldtest"
o "github.com/launchdarkly/sdk-test-harness/framework/opt"
"github.com/launchdarkly/sdk-test-harness/servicedef"
m "github.com/launchdarkly/go-test-... |
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"path/filepath"
"regexp"
"strings"
"time"
)
type LineInfo struct {
seq string
lineNo int64
line string
}
type FindInfo struct {
filename string
lines []LineInfo
}
type Post struct {
Body ... |
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"math"
"strconv"
)
// GameBox is a gorm model for database table `gameboxes`.
type GameBox struct {
gorm.Model
ChallengeID uint
TeamID uint
IP string
Port string
Description string
Visible bool
Score... |
// _ _
// __ _____ __ ___ ___ __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
// \ V V / __/ (_| |\ V /| | (_| | || __/
// \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
// Copyright © 2016 - 2022 SeMI Technologies B.V. All rights reserved.
//
// CONTACT: <EMAIL>... |
/*
Copyright 2019 The OpenEBS 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... |
package keyseq
import (
"testing"
"unicode/utf8"
"github.com/nsf/termbox-go"
)
func TestKeymapStrToKeyValue(t *testing.T) {
expected := map[string]termbox.Key{
"F1": termbox.KeyF1,
"F2": termbox.KeyF2,
"F3": termbox.KeyF3,
"F4": termbox.KeyF4,
"F5": termbox.... |
package base
import (
"crypto/md5"
"fmt"
"reflect"
"time"
"github.com/hudgit2019/leafboot/msg"
"github.com/name5566/leaf/chanrpc"
"github.com/name5566/leaf/gate"
"github.com/name5566/leaf/module"
)
var (
Skeleton *module.Skeleton
PlayerList *PlayerNodeList
//Curgamenum int64 //当前牌局计数,初始化为时间戳
//GameT... |
package server
import (
"bytes"
"context"
"fmt"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/go-x-pkg/log"
"github.com/go-x-pkg/memstats"
"github.com/go-x-pkg/servers"
daemon "github.com/sevlyar/go-daemon"
"github.com/spf13/pflag"
)
type App struct {
flags flags
daemonCtx *daemon.Context
... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package glue
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages a Glue Trigger resource.
//
// > This conten... |
// Code generated by go-swagger; DO NOT EDIT.
package textbots
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.