text stringlengths 3.08k 10.4k |
|---|
package colfer
import (
"bytes"
"fmt"
"go/ast"
"go/format"
"go/parser"
"go/token"
"io/ioutil"
"path"
)
// FormatFile normalizes the structure.
// The content is expected to be syntactically correct.
func FormatFile(path string) (changed bool, err error) {
orig, err := ioutil.ReadFile(path)
if err != nil {
... |
package logrus_mail
import (
"bytes"
"encoding/json"
"fmt"
"net"
"net/mail"
"net/smtp"
"strconv"
"time"
"runtime"
"github.com/Philoinc/logrus"
)
const (
format = "20060102 15:04:05"
MAX_DEPTH = 100
)
// MailHook to sends logs by email without authentication.
type MailHook struct {
AppName string
c ... |
// Copyright 2018 The Cockroach 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 ag... |
package main
import (
"bufio"
"errors"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"github.com/gin-gonic/gin"
"github.com/moqmar/go-gitignore"
"github.com/spf13/viper"
)
func main() {
viper.SetConfigName("gook")
viper.AddConfigPath("/etc/")
viper.AddConfigPath("$HOME/.config")
viper.... |
/*
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, ... |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"encoding/json"
"fmt"
"strings"
"github.com/facebookincubator/ent/dialect/sql"
"github.com/minskylab/collecta/ent/domain"
"github.com/minskylab/collecta/uuid"
)
// Domain is the model entity for the Domain schema.
type Domain struct {
config `json:... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
)
type pexelsData struct {
Page int `json:"page"`
PerPage int `json:"per_page"`
Photos []struct {
ID int `json:"id"`
Width int `json:"width"`
Height int `json:"height"`
URL ... |
package alicloud
import (
"regexp"
"github.com/aliyun/alibaba-cloud-sdk-go/services/slb"
"github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
func dataSourceAlicloudSlbServe... |
/*
The MIT License (MIT)
Copyright (c) 2013 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publis... |
// Copyright DataStax, Inc.
// Please see the included license file for details.
package upgrade_operator
import (
"fmt"
"testing"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/k8ssandra/cass-operator/tests/kustomize"
ginkgo_util "github.com/k8ssandra/cass-operator/tests/util/ginkg... |
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package hcp
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The Packer Image data source iteration gets the most rece... |
package rpc
import (
"context"
"errors"
"fmt"
"net"
middleware "github.com/grpc-ecosystem/go-grpc-middleware"
recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
grpc_opentracing "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-... |
package lexer
import (
"strings"
"unicode"
"gitlab.com/bark-lang/bark/token"
)
type Lexer interface {
Scan() token.Token
}
type lexer struct {
pos int
nextPos int
src []rune
ch rune
}
func New(input string) Lexer {
l := &lexer{src: []rune(input)}
l.readChar()
return l
}
func (l *lexer) Sca... |
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-opena... |
package driver
import (
"crypto/md5"
"encoding/hex"
"fmt"
"github.com/google/uuid"
"github.com/jinzhu/gorm"
"github.com/tomoyane/grant-n-z/gnz/entity"
"github.com/tomoyane/grant-n-z/gnz/log"
)
var srInstance ServiceRepository
type ServiceRepository interface {
// FindAll
// Find all Service
FindAll() ([]*... |
package gonat
import (
"sync"
"sync/atomic"
"syscall"
"time"
"github.com/getlantern/ops"
)
// StatsTracker tracks statistics for one or more gonat servers.
type StatsTracker struct {
acceptedPackets int64
invalidPackets int64
droppedPackets int64
numServers int64
numServersClosing int64
num... |
package util
import (
"encoding/base64"
"errors"
"io"
"log"
"math/rand"
"strings"
)
// A Universal Type to represent any function that only returns an error.
// This is an old predecessor of ServerTask
type ErrorRunnable func() error
// Clears a given data slice provided to the input using an iterative loop.
f... |
// Copyright 2019 Samaritan 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... |
// Evernote2md is a cli tool to convert Evernote notes exported in *.enex format
// to a directory with markdown files.
//
// Usage:
// evernote2md <file> [-o <outputDir>]
//
// If outputDir is not specified, current workdir is used.
package main
import (
"bytes"
"fmt"
"log"
"os"
"path/filepath"
"github.com/c... |
/*Package histogram provides basic histogram types and functions to analyze RGBA images.*/
package histogram
import (
"image"
"github.com/anthonynsimon/bild/clone"
)
// RGBAHistogram holds a sub-histogram per RGBA channel.
// Each channel histogram contains 256 bins (8-bit color depth per channel).
type RGBAHistog... |
package schema
import (
"errors"
"fmt"
"sort"
"github.com/hashicorp/terraform/terraform"
)
// Provider represents a resource provider in Terraform, and properly
// implements all of the ResourceProvider API.
//
// By defining a schema for the configuration of the provider, the
// map of supporting resources, and... |
// Copyright 2020 Booking.<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 to... |
// glua with preload libs
// original: https://raw.githubusercontent.com/yuin/gopher-lua/master/cmd/glua/glua.go
package main
import (
"flag"
"fmt"
"os"
"runtime/pprof"
readline "github.com/chzyer/readline"
lua "github.com/yuin/gopher-lua"
parse "github.com/yuin/gopher-lua/parse"
libs "github.com/alexjx/goph... |
/*
Copyright 2018 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, ... |
/*
Copyright 2019 The Crossplane 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 main
/**
* v1 shows the use of Range functions
**/
import (
// For printing messages on console
"fmt"
// The shim package
"github.com/hyperledger/fabric/core/chaincode/shim"
// peer.Response is in the peer package
"github.com/hyperledger/fabric/protos/peer"
// KV Interface
"github.com/hyperledger... |
/*
* Minio Client, (C) 2015 Minio, 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 ag... |
package docker
import (
"context"
"io"
"os"
"strings"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
"github.com/skanehira/docui/common"
"githu... |
package input
import (
"encoding/json"
"errors"
"fmt"
"github.com/fluent/fluent-operator/apis/fluentd/v1alpha1/plugins"
"github.com/fluent/fluent-operator/apis/fluentd/v1alpha1/plugins/params"
)
// InputCommon defines the common parameters for input plugins
type InputCommon struct {
// The @id parameter specif... |
package tax
import (
"errors"
"fmt"
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/invopop/gobl/cal"
"github.com/invopop/gobl/currency"
"github.com/invopop/gobl/i18n"
"github.com/invopop/gobl/l10n"
"github.com/invopop/gobl/num"
)
// Region defines the holding structure for a regions categorie... |
// Copyright 2020 Insolar Network Ltd.
// All rights reserved.
// This material is licensed under the Insolar License version 1.0,
// available at https://github.com/insolar/insolar/blob/master/LICENSE.md.
package lazyhead
import (
"sort"
)
type LessFunc func(v1, v2 interface{}) bool
type HeadedLazySortedList stru... |
package base
import (
"encoding/json"
"fmt"
"github.com/gogo/protobuf/proto"
"go.uber.org/zap"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go... |
package style
import (
"strconv"
"strings"
"github.com/pirmd/text"
)
var (
_ Styler = (*TextSyntax)(nil) //Makes sure that TextSyntax implements Styler
)
// NewPlaintext is a pre-defined style.TextSyntax Styler to write plain text. It
// allows for maximum 80 chars per line, indenting is made of 4 spaces and li... |
package kconfig
import (
"flag"
"github.com/enfabrica/enkit/lib/cache"
"github.com/enfabrica/enkit/lib/kflags"
"github.com/enfabrica/enkit/lib/khttp/downloader"
"github.com/enfabrica/enkit/lib/khttp/ktest"
"github.com/enfabrica/enkit/lib/logger"
"github.com/stretchr/testify/assert"
"io/ioutil"
"log"
"testing... |
package main
import (
"os"
"strconv"
"os/exec"
"strings"
"fmt"
"syscall"
"github.com/mattn/go-runewidth"
"github.com/rickdejager/termbox-go"
"github.com/sinomoe/gosnake"
"time"
)
type color termbox.Attribute
const (
cyan = color(termbox.ColorCyan)
black = colo... |
// Copyright (c) The Tellor Authors.
// Licensed under the MIT License.
package config
import (
"encoding/hex"
"encoding/json"
"io/ioutil"
"os"
"path"
"strings"
"time"
"github.com/joho/godotenv"
"github.com/pkg/errors"
)
// Unfortunate hack to enable json parsing of human readable time strings
// see https... |
package codegen
import (
"fmt"
"unicode/utf8"
)
// Grid is a colection of cells arranged into rows.
type Grid [][]string
// Append adds a new row to the end of the grid.
func (g *Grid) Append(cells ...string) {
*g = append(*g, cells)
}
func (g *Grid) Insert(beforerow int, cells ...string) {
old := *g
n := Grid... |
package state
import (
acm "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/account"
. "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/common"
ptypes "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/permission/... |
package model
import (
"database/sql"
"time"
"github.com/guregu/null"
"github.com/satori/go.uuid"
)
var (
_ = time.Second
_ = sql.LevelDefault
_ = null.Bool{}
_ = uuid.UUID{}
)
/*
DB Table Details
-------------------------------------
CREATE TABLE `spawn_condition_values` (
`id` int(10) unsigned NOT NUL... |
// Copyright 2009 <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 sqlite3
import (
"db";
"fmt";
"http";
"os";
"strconv";
)
// These constants can be or'd together and passed as the
// "flags" option to Open(). Some of t... |
// Package wecom implements the qrConnect protocol for authenticating users through WeCom.
// Reference: https://work.weixin.qq.com/api/doc/90000/90135/90988
package wecom
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"time"
"github.com/markbates/goth"
"golang.org/x/oauth2"
)
var (
Auth... |
// Copyright 2020 Google LLC
//
// 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 ... |
package tests
import (
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"syscall"
"time"
"github.com/stretchr/testify/require"
"golang.org/x/sys/unix"
"github.com/zrepl/zrepl/platformtest"
"github.com/zrepl/zrepl/util/nodefault"
"github.com/zrepl/zrepl/zfs"
)
func sendStreamTest(ctx *platformtest.Context) ... |
package main
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
"unicode"
"github.com/jhunt/go-ansi"
"github.com/starkandwayne/safe/prompt"
)
func warn(warning string, args ...interface{}) {
ansi.Fprintf(os.Stderr, "warning: @Y{%s}\n", fmt.Sprintf(warning, args...))
}
func fail(err error) {
if err != nil ... |
// Copyright 2017-2019 <NAME> (<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 agr... |
package main
import (
"context"
"flag"
"fmt"
"os"
"runtime"
"strings"
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
"github.com/amadeusitgroup/kubernetes-kafka-connect-operator/pkg/apis"
"github.com/amadeusitgroup/kubernetes-kafka-connect-operator/pkg/controller"
"github.com/a... |
package mqserver
/*
* Copyright 2022 ConsenSys Software 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 applic... |
package file
import (
"io/ioutil"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
"time"
"github.com/randlabs/server-watchdog/console"
"github.com/randlabs/server-watchdog/settings"
)
//------------------------------------------------------------------------------
type Module struct {
shutdownSignal chan ... |
//go:generate mockgen -package mock -destination=mock/caller.go github.com/mymmrac/telego/telegoapi Caller
//go:generate mockgen -package mock -destination=mock/request_constructor.go github.com/mymmrac/telego/telegoapi RequestConstructor
package telegoapi
import (
"bytes"
stdJson "encoding/json"
"fmt"
"io"
"mim... |
package main
import (
"context"
"encoding/hex"
"os"
"path/filepath"
"sort"
"strings"
"github.com/fragments/fragments/internal/client"
"github.com/fragments/fragments/internal/model"
"github.com/fragments/fragments/internal/server"
"github.com/golang/sync/errgroup"
"github.com/pkg/errors"
"github.com/spf13... |
package main
import (
"fmt"
"strings"
md "github.com/fbiville/markdown-table-formatter/pkg/markdown"
lua "github.com/yuin/gopher-lua"
"github.com/dstmodders/mod-cli/modinfo"
)
type Info struct {
Compatibility bool
Configuration bool
ConfigurationMarkdown bool
Description bool
Fie... |
package polyhedra
import (
"errors"
"github.com/MichaelMauderer/polyhedra/r3"
)
// Geodesic represents a geodesic Polyhedron.
// More information on geodesic polyhedra can be found at https://en.wikipedia.org/wiki/Geodesic_polyhedron
type Geodesic struct {
Polyhedron
m, n int
}
// IcosahedralGeodesic represents ... |
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
var (
// basic stats
trackerUptime = prometheus.NewDesc(
"tracker_uptime_total",
"Second the tracker has b... |
package zookeeper_test
import (
"io"
. "launchpad.net/gocheck"
zk "launchpad.net/gozk/zookeeper"
"log"
"net"
"time"
)
// requestFuncs holds all the requests that take a read lock
// on the zk connection except those that don't actually
// make a round trip to the server.
var requestFuncs = []func(conn *zk.Conn,... |
package websocket
import (
"errors"
"fmt"
"strings"
"sync"
"time"
"github.com/GregoryDosh/game-server/pkg/event"
namesgenerator "github.com/moby/moby/pkg/namesgenerator"
log "github.com/Sirupsen/logrus"
"github.com/gorilla/websocket"
uuid "github.com/satori/go.uuid"
)
type User struct {
id st... |
package main
//<NAME>
//from: https://stackoverflow.com/questions/15879136/how-to-calculate-sha256-file-checksum-in-go
// Looks like the %x in the sprintf will also print out the leading 0s
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/sha256"
"fmt"
"golang.org/x/crypto/chacha20poly1305"
"gol... |
package gpsd
import "time"
// Mode is the NMEA mode of a TimePositionVelocity report.
type Mode byte
const (
// NoValueSeen indicates no data has been received yet.
NoValueSeen Mode = 0
// NoFix indicates fix has not been required yet.
NoFix Mode = 1
// Mode2D represents quality of the fix.
Mode2D Mode = 2
//... |
/**
* Created by GoLand.
* User: 姜伟
* Date: 2020/1/14 0014
* Time: 10:06
*/
package pay
import (
"crypto/tls"
"encoding/xml"
"io/ioutil"
"os"
"regexp"
"time"
"github.com/a07061625/gompf/mpf"
"github.com/a07061625/gompf/mpf/api"
"github.com/a07061625/gompf/mpf/api/wx"
"gith... |
// Copyright 2022 Antrea 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 ... |
package cache
import (
"github.com/Madongming/resource-tree/model"
)
func newLRU(size int64) *LRU {
lru := new(LRU)
lru.Index = make(map[int]*CacheNode, size)
// Make double link.
dummy := new(CacheNode)
p := dummy
for i := 0; i < int(size); i++ {
node := new(CacheNode)
p.Next = node
node.Pre = p
p = ... |
// 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 ... |
package fetch
import (
"context"
"errors"
"fmt"
"github.com/hashicorp/go-retryablehttp"
"github.com/tkellen/memorybox/pkg/file"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"time"
)
// Do eases the process of locating data r... |
// Copyright 2022 The CubeFS 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 agree... |
// Copyright 2020 SAP SE
//
// 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 writ... |
// Copyright 2020 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package kconfig
import (
"bytes"
"fmt"
"strings"
)
// parser is a helper for parsing simple text protocols tailored for kconfig syntax.
type parser st... |
package review_test
import (
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/heppu/go-review"
"github.com/stretchr/testify/require"
"golang.org/x/build/gerrit"
)
func TestLinesToReviewCommentsSuccess(t *testing.T) {
tests := []struct {
na... |
// Copyright 2020 dfuse Platform 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 agre... |
package db
import (
"path"
"strings"
"time"
"github.com/contiv/errored"
"github.com/contiv/volplugin/errors"
"github.com/contiv/volplugin/merge"
"github.com/contiv/volplugin/storage"
"github.com/contiv/volplugin/storage/backend"
)
// NewVolume constructs a new volume given the policy and volume parameters.
f... |
package datastruc
import (
"crypto/ecdsa"
"crypto/elliptic"
crand "crypto/rand"
"crypto/x509"
"encoding/pem"
"log"
"math/rand"
"fmt"
)
const KeyNumber = 10
type KeyPair struct {
publicKey *ecdsa.PublicKey
privateKey *ecdsa.PrivateKey
}
type Wallet struct {
WalletKeyList []KeyPair
MainPubKey string
... |
package clientutil
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"time"
"github.com/dchest/blake2b"
"github.com/tsileo/blobsnap/chunker"
)
var (
MinBlobSize = 64 << 10 // 64Kb
MaxBlobSize = 1 << 20 // 1MB
)
func (up *Uploader) writeReader(f io.Reader, meta *Meta) (*WriteResult, error) {
writeResult ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package chime
import (
"context"
"fmt"
"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 CreateVoiceConnectorGroupInput struct {
_ struct{} `type:"struct... |
// Copyright © 2018, Goomba project Authors. All rights reserved.
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with this
// work for additional information regarding copyright ownership. The ASF
// licenses this file to you... |
// Copyright 2015-2018 <NAME>, All rights reserved.
//
// Use of this source code is governed by an Apache 2.0 license
// that can be found in the LICENSE file in the root of the source tree.
package config
import (
"encoding/json"
"fmt"
"os"
"github.com/freetaxii/libstix2/resources/apiroot"
"github.com/freetax... |
package dao
import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"log"
"strconv"
"time"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
var (
debug bool
mongoAddr string
mongoMdCollection string
mongoTsCollection string
mongoDB string
)
const (
MINS int = ... |
/*
* Copyright 2019 The Baudtime 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 e2e
import (
"context"
"testing"
"time"
"github.com/jenkinsci/kubernetes-operator/internal/try"
"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2"
"github.com/jenkinsci/kubernetes-operator/pkg/client"
"github.com/jenkinsci/kubernetes-operator/pkg/configuration/base/resources"
"github... |
package main
import (
"context"
"net/http"
"strings"
"github.com/jackc/pgx/v4"
"github.com/nbutton23/zxcvbn-go"
"github.com/rs/xid"
jwt "github.com/appleboy/gin-jwt/v2"
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
"golang.org/x/crypto/bcrypt"
)
// user is representation of a registered account. Thi... |
package index
import (
"context"
"fmt"
"github.com/aaronland/go-sqlite"
"github.com/tidwall/gjson"
"github.com/whosonfirst/go-reader"
"github.com/whosonfirst/go-whosonfirst-feature/geometry"
"github.com/whosonfirst/go-whosonfirst-feature/properties"
wof_tables "github.com/whosonfirst/go-whosonfirst-sqlite-feat... |
// Code generated by SQLBoiler 3.6.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package models
import "testing"
// This test suite runs each operation test in parallel.
// Example, if your database has 3 tables, the suite wi... |
package article
import (
"bufio"
"bytes"
"fmt"
"hash/crc32"
"io"
"os"
pathpkg "path"
"reflect"
"strconv"
"strings"
"time"
"github.com/astaxie/beego/logs"
)
const (
ARTICLE = "article"
DIR = "dir"
)
const (
START = iota
NO_META
META_BEGIN
META_END
)
const (
TIME_LAYOUT = "2006-01-02 15:04:05"... |
/*
* Copyright 2019 The NATS 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... |
/*
*
* Copyright 2020-present Arpabet, 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 ... |
package bootstrap
import (
"context"
"errors"
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
"github.com/why444216978/go-util/sys"
"golang.org/x/sync/errgroup"
"github.com/why444216978/gin-api/app/config"
"github.com/why444216978/gin-api/app/module/test/job/grpc"
"github.com/why444216978/gin-api/... |
// Copyright 2018 Google Inc. 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... |
// -*- coding: utf-8 -*-
// Copyright (C) 2019 Nippon Telegraph and Telephone Corporation.
//
// 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... |
package main
import (
"bytes"
"fmt"
"log"
"os"
"strconv"
"time"
"text/template"
owm "github.com/briandowns/openweathermap"
ui "github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
)
var apiKey = os.Getenv("OWM_API_KEY")
var locale = os.Getenv("WEATHER_LOCALE")
var countryCode = os.Getenv("WEAT... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: echo.proto
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
echo.proto
It has these top-level messages:
EchoReq
EchoRsp
*/
package proto
import proto1 "github.com/golang/protobuf/proto"
import fmt "fmt"
import m... |
/*
*
* k6 - a next-generation load testing tool
* Copyright (C) 2020 Load Impact
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your o... |
//(C) Copyright [2020] Hewlett Packard Enterprise Development LP
//
//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 a... |
package drivers
import (
"encoding/json"
"net/http"
"strings"
"github.com/gorilla/mux"
"github.com/reef-pi/reef-pi/controller/utils"
)
func (d *Drivers) LoadAPI(r *mux.Router) {
// swagger:route GET /api/drivers Driver driverList
// List all Drivers.
// List all Drivers in reef-pi.
// responses:
// 200:... |
package main
import (
"fmt"
"os"
"os/signal"
"strings"
"sync"
"syscall"
"time"
"github.com/kapitanov/go-cube"
"github.com/mxk/go-imap/imap"
"github.com/ttacon/chalk"
)
var imapLogMask = imap.LogConn | imap.LogState | imap.LogCmd | imap.LogRaw
var imapSafeLogMask = imap.LogConn | imap.LogState
var numberS... |
// Copyright (C) 2021 ScyllaDB
package cri
import (
"context"
"encoding/json"
"fmt"
"net"
"net/url"
"sync"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
apierrors "k8s.io/apimachinery/pkg/util/errors"
pb "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
"k8s.io/... |
package main
import (
"flag"
"os"
"os/signal"
"strings"
"syscall"
"time"
logrus "github.com/sirupsen/logrus"
nats "github.com/nats-io/go-nats"
moleculer "github.com/roytan883/moleculer-go"
"github.com/roytan883/moleculer-go/protocol"
)
func init() {
initLog()
}
var log *logrus.Logger
func initLog() {
... |
/*
Copyright NetApp Inc, 2021 All rights reserved
This file contains helper functions and methods for Poller,
AbstractCollector and collectors
@TODO: review which functions really belong here
@TODO: review which methods should actually be functions
(e.g. ImportSubTemplate is not abstract enough to be a method
... |
package metatx
// ----- ---- --- -- -
// Copyright 2019, 2020 The Axiom Foundation. All Rights Reserved.
//
// Licensed under the Apache License 2.0 (the "License"). You may not use
// this file except in compliance with the License. You can obtain a copy
// in the file LICENSE in the source distribution or at
// ht... |
package deployer
import "strings"
type State struct {
// Version is the state file protocol version.
Version int `json:"version"`
// TFVersion is the version of Terraform that wrote this state.
TFVersion string `json:"terraform_version,omitempty"`
// Serial is incremented on any operation that modifies
// the... |
package snowflake
import (
"context"
"database/sql"
"fmt"
gosnowflake "github.com/snowflakedb/gosnowflake"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
)
//// TABLE DEFINITION
// https://docs.snowflake.com/en/sql-reference/ddl-user-security.html#lab... |
// Copyright © 2019 <NAME> <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish... |
// Package mailer is a simple e-mail sender for the Go Programming Language.
package mailer
import (
"bytes"
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"net/mail"
"net/smtp"
"os/exec"
"strings"
"github.com/valyala/bytebufferpool"
)
const (
// Version current version semantic number of the "go-mailer" packag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.