text stringlengths 3.08k 10.4k |
|---|
// Copyright 2021 <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 xerrors
import (
"fmt"
"os"
"path"
"runtime"
"strconv"
"strings"
)
const (
numStackFramesToSkip = 3
stacktraceDepth = 32
unknown = ... |
// Copyright 2014 The fader 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 i... |
package collections
import (
"fmt"
"reflect"
"strings"
"unicode"
"unicode/utf8"
"github.com/Masterminds/sprig"
"github.com/coveooss/gotemplate/v3/errors"
)
var must = errors.Must
// CenterString returns string s centered within width
func CenterString(s string, width int) string {
l := utf8.RuneCountInStrin... |
package rgblog
import (
"log"
"sort"
"strconv"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)
// DBClient 是数据库操作类
type DBClient struct {
db *gorm.DB
}
var client DBClient
// GetDBClient 提供获取数据库操作类的客户端
func GetDBClient() *DBClient {
return &client
}
func init() {
db, err := gorm.Open("mysql"... |
package controllers
import (
"bbs/models"
"bbs/util"
"github.com/beego/beego/v2/core/logs"
beego "github.com/beego/beego/v2/server/web"
"math/rand"
"mime/multipart"
"os"
"path"
"time"
)
type ImageController struct {
beego.Controller
}
func (c *ImageController) URLMapping() {
logs.Trace("[URLMapping] mappi... |
package plugin
import (
"fmt"
"strings"
"time"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
kdb "github.com/sv/kdbgo"
)
const kdbEOF = "Failed to read message header:"
// wrappers for correct run-time evaluation of KdbHandle pointer and to enable un... |
/*
Copyright 2019 Cisco Systems
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
d... |
package main
import (
"encoding/json"
"fmt"
"time"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/kinesis"
"github.com/google/uu... |
package gosql
import (
"bytes"
"errors"
"fmt"
"reflect"
"strconv"
"strings"
"unicode"
)
//GetPreparedStatement 将传入的sql与params参数 整理成 prepare statement
func GetPreparedStatement(sql string, params map[string]interface{}) (string, []interface{}, error) {
//拼接参数
sql, params, err := getStatement([]byte(sql), par... |
package main
import (
"flag"
"log"
"net/url"
"os"
"path"
"time"
"github.com/temoto/robotstxt"
"github.com/guidj/manga-mirror/crawl"
"github.com/guidj/manga-mirror/storage"
"github.com/guidj/manga-mirror/utils"
)
// CrawlerQueue holds a sites and images channels
type CrawlerQueue struct {
Sites chan *url... |
package iab_tcf
import (
"github.com/LiveRamp/iabconsent"
)
// ConsentV2 is an implementation of the Consent interface used to retrieve
// consent information given a TCF 1.0 format.
type ConsentV2 struct {
ParsedConsent *iabconsent.V2ParsedConsent
}
// NewConsentV2 returns a consent interface from the reader rece... |
package exporter
import (
"bytes"
"context"
"fmt"
"path"
"strings"
"github.com/jmoiron/sqlx/types"
"github.com/pkg/errors"
)
func (m Exporter) Pages(ctx context.Context, fail func(error) error, out chan<- VFile) {
query, err := Asset("db/query-pages.sql")
if err != nil {
fail(errors.Wrap(err, "Error while... |
package cache
import (
"context"
"errors"
"io"
"time"
"github.com/znly/bazel-cache/utils"
"github.com/znly/bazel-cache/utils/hedged"
)
var (
ErrNotFound = errors.New("not found")
ErrInvalidSize = errors.New("invalid size")
)
type EntryKind string
const (
AC EntryKind = "ac"
CAS EntryKind = "cas"
)
t... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: message.proto
package api
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-ti... |
package proxy
import (
"context"
"fmt"
"log"
"net"
containerdv1 "github.com/kpture/server/api/services/containerd"
"github.com/kpture/server/api/services/discover"
"github.com/kpture/server/api/services/k8s"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
... |
// Copyright © 2021 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... |
// webmention project webmention.go
package webmention
import (
"net/http"
"net/url"
"strings"
"time"
"github.com/andyleap/microformats"
log "github.com/sirupsen/logrus"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
type WebMention struct {
inbox chan *mention
outbox chan *mention
inbo... |
package cmd
import (
"bufio"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"time"
"github.com/G1itchZero/ZeroGo/site_manager"
"github.com/G1itchZero/ZeroGo/utils"
log "github.com/Sirupsen/logrus"
"github.com/spf13/cobra"
)
// workingDir is the path we're executing from
var workingDi... |
package gofind
import (
"fmt"
"strings"
)
// FindSettings - the settings for the find session
type FindSettings struct {
ArchivesOnly bool
Debug bool
ExcludeHidden bool
InArchiveExtensions []string
InArchiveFilePatterns *FindPatterns
InDirPatterns *FindPatterns... |
package document
import "github.com/tim-online/go-exactonline/edm"
type Documents []Document
type Document struct {
ID edm.GUID `json:"ID,omitempty"` // Primary key
Account edm.GUID `json:"Account"` // ID of the related account... |
// Copyright 2022 anorm Author. 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 o... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"os/signal"
"strings"
"syscall"
"time"
)
var currentConfig config
type config struct {
General struct {
CheckIntervalSeconds uint `json:"checkIntervalSeconds"`
ContextPath string `json:"contextPath"`
} `js... |
package etcd
import (
"encoding/json"
"testing"
"github.com/coreos/go-etcd/etcd"
"github.com/st3v/discovery"
"github.com/st3v/discovery/etcd/fake"
)
func TestRegister(t *testing.T) {
var (
namespace = "namespace"
machines = []string{"foo", "bar"}
ttl = uint64(1234)
instance = discovery.Instance... |
/*
Package renderables processes package vm structs and bundles them with the
appropriate metadata, html templates, and scripts to create a fully functional
web page.
Generally, Revere pages are created out of a top-level "viewmodel" Renderable
interface that provides "sub-Renderables" out of the components it needs t... |
package service
import (
"context"
"flag"
"fmt"
"go-common/library/conf/env"
"go-common/library/queue/databus"
"reflect"
"time"
"go-common/app/job/bbq/video/conf"
"go-common/app/job/bbq/video/dao"
"go-common/library/log"
topic "go-common/app/service/bbq/topic/api"
"github.com/robfig/cron"
)
var (
srvN... |
/*
* untangle.go
* This is the main query handling code for the Untangle DNS filter proxy
* We lookup the reputation and categories for inbound queries and then
* consult the customer policy to make the allow or block decision.
*/
package untangle
import (
"bufio"
"context"
"encoding/json"
"fmt"
"net"
"tim... |
// Copyright 2015 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package filepath_test
import (
gofilepath "path/filepath"
"runtime"
"strings"
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"github.com/juju/utils/filepath"
)
// The tests he... |
package bot
import (
"context"
"github.com/almaznur91/splitty/internal/api"
"github.com/go-pkgz/syncs"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
"github.com/rs/zerolog/log"
"runtime/debug"
"strings"
)
const start string = "/start"
//actions
const (
joinRoom api.Action = "join_r... |
package server
import (
"bytes"
"encoding/json"
"fmt"
"io"
"log"
"net"
"net/http"
"net/url"
"strings"
"time"
"github.com/crewjam/saml/samlsp"
"github.com/patrickmn/go-cache"
)
const (
newTokenCacheExpiration = 5 * time.Second
newTokenCacheCleanupInterval = 1 * time.Minute
)
const (
HeaderAuthori... |
package vat
import (
"database/sql/driver"
"encoding/json"
"fmt"
"github.com/domonda/go-types/country"
"github.com/domonda/go-types/nullable"
)
// Ensure that NullableID implements StringGetter
var _ nullable.StringGetter = NullableID("")
// Null is an empty string and will be treatet as SQL NULL.
var Null Nul... |
package commands
import (
"fmt"
"os"
"path"
"sort"
"text/tabwriter"
"text/template"
"github.com/cirocosta/hugo-utils/hugo"
"gopkg.in/urfave/cli.v1"
)
var List = cli.Command{
Name: "list",
Usage: "lists all content under a given path.",
Description: `The 'list' command iterates over each content file (*.m... |
package components
import (
"sort"
"github.com/gabstv/ecs/v2"
"github.com/gabstv/primen/core"
"github.com/gabstv/primen/easing"
)
type TrTweenType int
const (
TrTweenX TrTweenType = 1
TrTweenY TrTweenType = 2
TrTweenRotation TrTweenType = 3
TrTweenScaleXY TrTweenType = 4
TrTweenScaleX TrTw... |
package commands
import (
"errors"
"fmt"
"os"
"strings"
"text/template"
"github.com/codegangsta/cli"
"github.com/docker/machine/libmachine/log"
)
const (
envTmpl = `{{ .Prefix }}DOCKER_TLS_VERIFY{{ .Delimiter }}{{ .DockerTLSVerify }}{{ .Suffix }}{{ .Prefix }}DOCKER_HOST{{ .Delimiter }}{{ .DockerHost }}{{ .Su... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
*/
// Implements the MetricExporter interface for saving to ODS
package exporters
import (
"bytes"
"encoding/json"
... |
/**
* Copyright 2021 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 w... |
// Code generated by go-swagger; DO NOT EDIT.
package ticketing
// 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.co... |
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (C) 2021 Renesas Electronics Corporation.
// Copyright (C) 2021 EPAM Systems, 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
/... |
package http_rest
import (
"reflect"
"strconv"
"strings"
pb "github.com/akitasoftware/akita-ir/go/api_spec"
"github.com/golang/glog"
"github.com/pkg/errors"
. "github.com/akitasoftware/akita-libs/visitors"
"github.com/akitasoftware/akita-libs/visitors/go_ast"
)
// Represents the "name" of an argument to a m... |
// SPDX-FileCopyrightText: 2021 The Go-SSB Authors
//
// SPDX-License-Identifier: MIT
package ssb
import (
"fmt"
"go.cryptoscope.co/margaret"
librarian "go.cryptoscope.co/margaret/indexes"
"go.cryptoscope.co/margaret/multilog"
"go.cryptoscope.co/ssb/internal/storedrefs"
refs "go.mindeco.de/ssb-refs"
"go.mind... |
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build icu
package cases
import (
"path"
"strings"
"testing"
"golang.org/x/text/internal/testtext"
"golang.org/x/text/language"
)
func TestICUConfor... |
package vibe
import (
"fmt"
"github.com/spf13/cast"
"reflect"
"strings"
)
func desensitizeMap(m map[string]interface{}) {
for key, val := range m {
switch val.(type) {
case map[interface{}]interface{}:
// nested map: cast and recursively unify
val = cast.ToStringMap(val)
desensitizeMap(val.(map[stri... |
package memorystorage
import (
"context"
"strings"
capsmodel "github.com/dantin/cubit/model/capabilities"
"github.com/dantin/cubit/model/serializer"
"github.com/dantin/cubit/xmpp"
"github.com/dantin/cubit/xmpp/jid"
)
// Presences represents an in-memory presences storage.
type Presences struct {
*memoryStorag... |
package db
import (
"context"
"database/sql"
"database/sql/driver"
"errors"
"time"
"github.com/zssky/log"
)
const (
DB_TYPE_SQLITE3 = "sqlite3"
DB_TYPE_MYSQL = "mysql"
DB_TYPE_MSSQL = "mssql"
DB_TYPE_OCI8 = "oci8"
DB_TYPE_DB2 = "db2-cli"
DB_TYPE_ADO = "adodb"
DB_TYPE_ODBC = "odbc"
DB_... |
// 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 writi... |
package server
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strconv"
"time"
"github.com/lukaszbudnik/auditor/model"
"github.com/lukaszbudnik/auditor/store"
"github.com/lukaszbudnik/migrator/common"
"gopkg.in/validator.v2"
)
const (
defaultPort string = "8080"
requestIDHead... |
// Copyright 2021 The Chromium OS 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 inputs
import (
"context"
"fmt"
"strings"
"time"
"chromiumos/tast/ctxutil"
"chromiumos/tast/local/bundles/cros/inputs/pre"
"chromiumos... |
// *** 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 v20160601
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type JobDefinition struct {
pulumi.Cust... |
package deeplink
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
type testCase struct {
link DeepLink
input string
wantErr bool
}
func join(arg string) DeepLink {
return DeepLink{
Type: Join,
Args: map[string][]string{
"invite": {arg},
},
}
}
func resolve(arg string) DeepLink ... |
/*
* gomacro - A Go interpreter with Lisp-like macros
*
* Copyright (C) 2017-2018 <NAME>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* ex... |
package heap
import (
"math"
"fmt"
)
/*******************************************************************************
* A min binary heap implements the Priority Queue ADT. It has constant access
* to the min element of the heap, with logarithmic insertions and deletions.
*
* add(element) - O(log n)
* poll() -... |
package main
import (
"bufio"
"errors"
"flag"
"fmt"
"io"
"log"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"unicode"
)
var newVersion int
var tokenFound bool
const verHi int = 1
const verLo int = 4
func genericUsage(out io.Writer) {
fmt.Fprintf(out, "BuildNumberInc v.%d.%d, Copyright (c) 2016, 20... |
package inspector
import (
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
// "github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/inspector"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-aws/internal/conns"
"github.com/hashicorp/terrafo... |
/**
* Created: 2019/4/19 0019
* @author: Jason
*/
package network
import (
"context"
"net"
"sync/atomic"
"github.com/lightning-go/lightning/defs"
"github.com/lightning-go/lightning/logger"
"github.com/lightning-go/lightning/module"
"github.com/lightning-go/lightning/utils"
uuid "github.com/satori/go.uuid"... |
package lazy
import (
"context"
"encoding/json"
"errors"
"strconv"
"strings"
"sync"
"time"
"github.com/go-redis/redis/v8"
"github.com/rs/zerolog/log"
)
func NewServer(cc redis.UniversalClient) *Server {
ctx, cancel := context.WithCancel(context.Background())
return &Server{
FetchTimeout: 10 * time.Secon... |
package commands
import (
"encoding/json"
"fmt"
"os"
"text/template"
"github.com/corestario/dkglib/lib/blsShare"
"github.com/spf13/cobra"
cfg "github.com/tendermint/tendermint/config"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/... |
/*
* Copyright 2019 the go-netty project
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
package clips
// #cgo CFLAGS: -I ../../clips_source
// #cgo LDFLAGS: -L ../../clips_source -l clips -lm
// #include <clips/clips.h>
//
// int queryFunction(void* env, const char* name);
// int printFunction(void* env, const char* name, const char* message);
// int getcFunction(void* env, const char* name);
// int unge... |
package coin
import (
"bufio"
"bytes"
"fmt"
"io"
"regexp"
"sort"
"github.com/mkobetic/coin/check"
)
type Rules interface {
AccountFor(payee string) *Account
Name() string
Write(w io.Writer, max int) error
}
type RuleIndex struct {
Accounts map[string]*AccountRules // Maps ID to a set of rules for that ... |
package engine
import (
"bytes"
"encoding/json"
"fmt"
"hps"
"strings"
"time"
)
// SimulationResult contains status and exit time of the simulation.
type SimulationResult struct {
Status int
Time float64
Events int
Duration time.Duration
}
// Environment is a top-level element of the simulation mach... |
package logger
import (
"bytes"
"encoding/json"
"fmt"
"hash/adler32"
"io"
"sort"
"strings"
"time"
"github.com/mitchellh/colorstring"
"github.com/rs/zerolog"
)
var colorize = colorstring.Colorize{
Colors: colorstring.DefaultColors,
Reset: true,
}
type PlainOutput struct {
Out io.Writer
}
const systemG... |
package main
import (
"flag"
"fmt"
"io"
"os"
"os/exec"
)
var (
changesOnly = []string{"--state-output", "changes"}
fullOutput = []string{"--state-output", "full"}
local = "--local"
logDebug = []string{"-l", "debug"}
logQuiet = []string{"-l", "warning"}
noColour = "--no-color"
outFile =... |
// Copyright 2016 Google 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 in ... |
//go:build darwin || linux
// +build darwin linux
package fuse
import (
"context"
"github.com/buildbarn/bb-remote-execution/pkg/cas"
"github.com/buildbarn/bb-storage/pkg/digest"
"github.com/buildbarn/bb-storage/pkg/filesystem/path"
"github.com/buildbarn/bb-storage/pkg/util"
"github.com/hanwen/go-fuse/v2/fuse"
... |
package main
import (
"bytes"
"encoding/base64"
"fmt"
"html/template"
"io/ioutil"
"os"
"path"
"path/filepath"
"regexp"
"strings"
)
// Font is a single font family and associated Base64 encoded font file.
type Font struct {
Family string
//CmdLineSet is set when the user specifies a particular font file on... |
package ds
import (
"errors"
"fmt"
"math"
"strconv"
"strings"
"github.com/gammban/numtow/internal/digit"
)
var (
ErrParse = errors.New("parse number error")
)
const (
base = 10
bitSize = 64
defaultExp = 0
defaultDecimalSeparator = '.'
minusSign ... |
// Package database provides an abstraction over getting and writing a
// database file.
package database
import (
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"time"
"github.com/maxmind/geoipupdate/v4/pkg/geoipupdate"
"github.com/maxmind/geoipupdate/v4/pkg/geoipupdate/internal"
... |
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package registration
import (
"context"
"fmt"
"io/ioutil"
"net"
"os"
"regexp"
"runtime"
"strings"
"github.com/jackpal/gateway"
"github.com/pkg/errors"
infrastructurev1beta1 "github.com/vmware-tanzu/cluster-api-provi... |
package stores
import (
"database/sql"
"strconv"
"time"
"../apperrors"
"../models"
_ "github.com/mattn/go-sqlite3"
)
// DelegationID is the type of a delegation identifier (in sqlite land)
type DelegationID int64
const (
statusNew = "new" // the delegation request has been submitted but it is... |
package cache
import (
"sync"
"github.com/containerd/containerd/mount"
"github.com/moby/buildkit/cache/metadata"
"github.com/moby/buildkit/identity"
"github.com/moby/buildkit/util/flightcontrol"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
type ImmutableRef interface {
Mountable
ID() string
Release... |
/*
Copyright 2022 The KCP 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, softwar... |
// Copyright (c) 2021 Uber Technologies, Inc.
//
// 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... |
package provider
import (
"encoding/json"
"github.com/cloudandthings/terraform-provider-gocd/internal/gocd"
"github.com/cloudandthings/terraform-provider-gocd/internal/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"strconv"... |
package models
import (
"github.com/go-pg/pg/v10/orm"
"time"
)
func init() {
// Register many to many model so ORM can better recognize m2m relation.
// This should be done before dependant models are used.
orm.RegisterTable((*OrderToAuthor)(nil))
orm.RegisterTable((*OrderToSeries)(nil))
orm.RegisterTable((*Us... |
package snapshots
import (
"fmt"
"io"
"strings"
"github.com/EmmettCorp/delorean/pkg/logger"
"github.com/EmmettCorp/delorean/pkg/ui/shared"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)
type rowAction int
const (
deleteItem rowAction =... |
package tcp
import (
"context"
"fmt"
"net"
"net/http"
"testing"
"time"
mynet "github.com/plod/osiris/pkg/net"
myhttp "github.com/plod/osiris/pkg/net/http"
"github.com/phayes/freeport"
"github.com/stretchr/testify/require"
)
func TestNewDynamicProxy(t *testing.T) {
var l7StartCalled bool
l7Start := func(*... |
// 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 copypaste
import (
"fmt"
"log"
"math"
"strings"
"time"
"github.com/BurntSushi/xgb"
"github.com/BurntSushi/xgb/xproto"
"github.com/jmigpin/editor/driver/xdriver/xutil"
"github.com/jmigpin/editor/util/syncutil"
"github.com/jmigpin/editor/util/uiutil/event"
)
type Paste struct {
conn *xgb.Conn
win ... |
package utils
import (
"fmt"
"github.com/duanlizhi/copier"
"github.com/imdario/mergo"
"github.com/stretchr/testify/assert"
"reflect"
"testing"
"time"
)
type ObjInner struct {
ID int
}
type ObjInner2 struct {
ID2 int
}
type _obj1 struct {
ObjInner
ID2 int
Attr1 string
Attr2 int
Attr3 bo... |
/*
Copyright © 2020 <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, distribute, ... |
package broker
import (
"errors"
"io/ioutil"
"reflect"
"github.com/operator-framework/operator-sdk/pkg/k8sutil"
monclientv1 "github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1"
"github.com/kubernetes-sigs/service-catalog/pkg/apis/servicecatalog/v1beta1"
"github.com/mackwong/clickho... |
package main
import (
"fmt"
"log"
"os"
"os/exec"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
)
const instanceStatusRunning = int64(16)
func terminateCluster(svc *ec2.EC2) error {
tagKey := "tag-key"
tagValue := "k8s-role"
statusKe... |
package pingme
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io"
"log"
"net"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"time"
"github.com/google/uuid"
)
var timeOpt string
var ping4Regexp, ping6Regexp *regexp.Regexp
func init() {
var regexp4Str, regexp6Str string
va... |
// Lack of explicitly namespaced enums in Go mean we simply hide this in another package, instead
package purpose
import (
"bytes"
"encoding/json"
"fmt"
"github.com/fatih/camelcase"
log "github.com/sirupsen/logrus"
"strconv"
"strings"
)
type PurposeSpecification int
const (
purposeUndefined PurposeSpecificat... |
// Copyright 2019 <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, publish, distribute... |
package workers
import (
"encoding/json"
"errors"
"fmt"
"strconv"
"sync"
"time"
"github.com/btcsuite/btcd/blockchain"
"github.com/btcsuite/btcd/rpcclient"
"github.com/incognitochain/go-incognito-sdk-v2/incclient"
"github.com/incognitochain/portal-workers/entities"
"github.com/incognitochain/portal-workers/... |
package main
import (
"flag"
"fmt"
"github.com/gleanerio/gleaner/internal/config"
"github.com/gleanerio/gleaner/pkg"
"log"
"os"
"path/filepath"
"github.com/spf13/viper"
bolt "go.etcd.io/bbolt"
"github.com/gleanerio/gleaner/internal/common"
"github.com/gleanerio/gleaner/internal/objects"
)
var viperVal, s... |
// Copyright 2022 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 language
import (
"fmt"
"time"
"tlan/planning"
"tlan/purpose"
"tlan/schedule"
"tlan/utils"
)
func Eval(context string, categories []*Category, items []*Item) {
switch context {
case "projects":
evalProject(items)
case "schedule":
evalSchedule(items)
case "goals":
evalGoals(categories, items)
... |
// Package clog (context logger) provides shared log configuration and helpers for building Cuvva HTTP services
package clog
import (
"context"
"errors"
"os"
"github.com/cuvva/cuvva-public-go/lib/cher"
"github.com/cuvva/cuvva-public-go/lib/servicecontext"
"github.com/sirupsen/logrus"
)
type contextKey string
... |
/*
Copyright 2014 Rohith 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 agreed to in writi... |
package main
import (
models "avanza/models"
printer "avanza/printing"
reports "avanza/reports"
requests "avanza/requests"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"sort"
"strings"
"sync"
"text/tabwriter"
)
var (
printCurrent bool
reportCurrent bool
report bool
)
func main() {
log.Print(... |
// Copyright 2020 The Chromium OS 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 wifi
import (
"context"
"time"
"chromiumos/tast/common/shillconst"
"chromiumos/tast/errors"
"chromiumos/tast/remote/bundles/cros/wifi/wi... |
package smc
import (
"errors"
"time"
"github.com/golang/glog"
pbJob "github.com/grandcat/flexsmc/proto/job"
"golang.org/x/net/context"
)
// Mock to demonstrate the API
const ParallelSessions int = 2
var (
ErrInvTransition = errors.New("invalid transition")
)
type smcConnectorMock struct {
readyWorkers chan... |
package openshift
import (
"fmt"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/util/sets"
kclientcmd "k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
"github.com/openshift/origin/pkg/oc/clus... |
// Copyright The OpenTelemetry 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 agre... |
package aoc2015
import (
"fmt"
"strconv"
"strings"
aoc "github.com/janreggie/aoc/internal"
"github.com/pkg/errors"
)
// racingReindeer is a reindeer that participates in the Reindeer Olympics
type racingReindeer struct {
name string
flyingSpeed uint
flyingTime uint
restingTime uint
}
// reindeerOly... |
/*
* Copyright (c) 2021 <NAME> and contributors. All right reserved.
* Licensed under the ISC license. See LICENSE file in project root for details.
*
*/
package main
import (
"context"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
"os"
"os/signal"
"strings"
"sync"
"golang.org/x/sys/unix"
)
const usageExit ... |
package routers
import (
"Cube-back/controllers/blog"
"Cube-back/controllers/common"
"Cube-back/controllers/draft"
"Cube-back/controllers/login"
"Cube-back/controllers/message"
"Cube-back/controllers/profile"
"Cube-back/controllers/register"
"Cube-back/controllers/talk"
"Cube-back/controllers/user"
"Cube-bac... |
package main
import (
"fmt"
"github.com/ccding/go-logging/logging"
"github.com/gtfierro/cs262-project/client"
"github.com/gtfierro/cs262-project/common"
"github.com/montanaflynn/stats"
"math/rand"
"os"
"sync"
"sync/atomic"
"time"
)
var log *logging.Logger
func init() {
log, _ = logging.WriterLogger("main"... |
package store
import (
"io"
"os"
"sync/atomic"
"sync"
"github.com/bwmarrin/snowflake"
"github.com/golang/glog"
)
const (
sizeBitLen = 32
)
var (
// PageSize of fielsystem
PageSize = 4096
)
// ===== File provider =====
// every superblock has one Index File
type FileProvider struct {
block *Superbl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.