text stringlengths 3.08k 10.4k |
|---|
// Copyright 2019 PingCAP, 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... |
// +build v2ray
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"net"
"runtime"
"strings"
"github.com/miekg/dns"
vcore "v2ray.com/core"
vproxyman "v2ray.com/core/app/proxyman"
vbytespool "v2ray.com/core/common/bytespool"
vdice "v2ray.com/core/common/dice"
vnet "v2ray.com/core/common/net"
vinte... |
package sap_api_input_reader
type EC_MC struct {
ConnectionKey string `json:"connection_key"`
Result bool `json:"result"`
RedisKey string `json:"redis_key"`
Filepath string `json:"filepath"`
Reservation struct {
Reservation string `json:"document_no"`
DeliverTo ... |
package tenz
import (
"archive/tar"
"archive/zip"
"compress/gzip"
"fmt"
"io"
"log"
"os"
"path"
"github.com/UangDesign/filetype"
)
type ITenZ interface {
// 解压缩
DeCompress(scrFile string, dirName string) error
// 压缩
Compress() error
}
type TenZ struct {
}
func NewTenZ() ITenZ {
return &TenZ{}
}
const... |
package http
import (
"context"
"encoding/json"
"fmt"
"net/http"
"time"
"unicode/utf8"
"github.com/influxdata/flux"
"github.com/influxdata/flux/ast"
"github.com/influxdata/flux/csv"
"github.com/influxdata/flux/lang"
"github.com/influxdata/flux/semantic"
"github.com/influxdata/flux/values"
"github.com/inf... |
// Copyright 2018 The Fuchsia 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 main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io"
"os"
"time"
"go.fuchsia.dev/fuchsia/tools/debug/symbolize/lib"
"go.fuchsia.dev... |
package hippo
import (
"fmt"
"strings"
)
//字段类型
type FType byte
//类型定义
const (
URL FType = iota
STRING
INT
DOUBLE
BOOLEAN
DATE
DATETIME
)
func (this FType) ToString() string {
switch this {
case URL:
return "U"
case STRING:
return "S"
case INT:
return "I"
case DOUBLE:
return "D"
case BOOLEAN:... |
package client_test
import (
"fmt"
"path/filepath"
"runtime"
"testing"
rancher "github.com/canhnt/rancher-go/client"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
)
func Test_SaveYAML(t *testing.T) {
project := rancher.Project{
Name: "canh-test-project",
Description: "Test project creat... |
// Copyright 2016 <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 agreed to in... |
package conf
import (
"flag"
"os"
"strconv"
"time"
xtime "github.com/Terry-Mao/goim/pkg/time"
"github.com/bilibili/discovery/naming"
"github.com/BurntSushi/toml"
)
var (
confPath string
region string
zone string
deployEnv string
host string
weight int64
// Conf config
Conf *Config
)... |
// 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 value_test
import (
"testing"
"github.com/jamestunnell/go-setting/value"
"github.com/stretchr/testify/assert"
)
func TestStringSlice(t *testing.T) {
s := value.NewStringSlice()
assert.Equal(t, value.TypeString, s.Type())
assert.True(t, s.IsSlice())
assert.Equal(t, []string{}, s.Slice())
assert.Equal... |
// The MIT License (MIT)
//
// Copyright (c) 2017-2020 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 right... |
package main
import (
"fmt"
"log"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/transip/gotransip/v6/repository"
"github.com/transip/gotransip/v6/vps"
)
... |
package file
import (
"os"
"testing"
"log"
"net/url"
"strings"
"fmt"
"github.com/hydronica/trial"
minio "github.com/minio/minio-go"
"github.com/pcelvng/task-tools/file/s3"
)
var (
// minio test server credentials
//
// see:
// https://docs.minio.io/docs/golang-client-api-reference
testEndpoint = "pl... |
// vi:nu:et:sts=4 ts=4 sw=4
// See License.txt in main repository directory
// Generate Tasks
// Notes:
// 1. The html and text templating systems require that
// their data be separated since it is not identical.
// So, we put them in separate files.
// 2. The html and text templating systems access generic
// st... |
package view
import (
"fmt"
"html/template"
"io/ioutil"
"net/http"
"path/filepath"
"time"
"golang.org/x/text/message"
e "kellnhofer.com/work-log/error"
"kellnhofer.com/work-log/loc"
"kellnhofer.com/work-log/log"
"kellnhofer.com/work-log/view/model"
)
const dateFormat = "02.01.2006"
const dateFormatShort ... |
package main
import (
"context"
"fmt"
"image"
"io/ioutil"
"path/filepath"
"sort"
"strings"
sourcepath "github.com/GeertJohan/go-sourcepath"
"github.com/anthonynsimon/bild/imgio"
"github.com/anthonynsimon/bild/transform"
"github.com/k0kubun/pp"
"github.com/rai-project/config"
"github.com/rai-project/dlfra... |
// Copyright 2017 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package messages
import (
"encoding/binary"
"fmt"
"github.com/FactomProject/factomd/common/constants"
"github.com/FactomProject/factomd/common/interfaces"
"github.com/FactomPro... |
package artifacts
import (
"io/fs"
"os"
"path/filepath"
"reflect"
"testing"
log "github.com/sirupsen/logrus"
)
const (
errMsg = "Not equal. Expected: %d. Actual: %d."
errMsgTxt = "Incorrect. Expected: %v. Actual: %v"
testFileJar100 = testDirHome + testDirDownload + "/maven-releases/file1/file1/... |
/*
MIT License
Copyright (c) 2018 <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, ... |
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/nnqq/td/bin"
"github.com/nnqq/td/tdp"
"github.com/nnqq/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt... |
/*
* Copyright 2018 <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 metrics
import (
"fmt"
"regexp"
"strconv"
"strings"
"text/scanner"
"time"
"github.com/djthorpe/gopi/v3"
)
////////////////////////////////////////////////////////////////////////////////
// TYPES
type measurement struct {
name string
ts time.Time
metrics []gopi.Field
tags []gopi.Field
... |
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"runtime"
"strings"
"sync"
"syscall"
"time"
"github.com/boltdb/bolt"
"github.com/miekg/dns"
"github.com/pressly/chi"
"github.com/pressly/chi/middleware"
)
// DB represents the Bolt DB instance
type DB struct {
*bolt.DB
}
... |
package jinxlib
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
)
func checkTLSCert(conf *config) (bool, bool, error) {
keyExists := false
// Check if the client key exists
if _, err := os.Stat(conf.SSLKeyFile); os.IsNotExist(... |
package types
import (
"time"
"github.com/ysugimoto/falco/ast"
"github.com/ysugimoto/falco/token"
)
type Type int
const (
// https://developer.fastly.com/reference/vcl/types/
NeverType Type = 0x000000000000000
AclType Type = 0x000000000000001
BackendType Type = 0x000000000000010
BoolType ... |
// Copyright 2014, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package planbuilder
import (
"encoding/json"
"fmt"
"io/ioutil"
"sort"
)
// Schema represents the denormalized version of SchemaFormal,
// used for building r... |
/*
Package ds implements useful data structures for sprig.
*/
package ds
import (
"fmt"
"sort"
"sync"
forest "git.sr.ht/~whereswaldon/forest-go"
"git.sr.ht/~whereswaldon/forest-go/fields"
"git.sr.ht/~whereswaldon/forest-go/store"
)
// CommunityList holds a sortable list of communities that can update itself
//... |
package droid
import (
"fmt"
"github.com/bogosj/advent-of-code/2019/computer"
"github.com/bogosj/advent-of-code/intmath"
)
type state struct {
// Whether these directions have been explored.
eN, eS, eW, eE bool
isWall bool
isO2 bool
}
// Droid represents a repair droid.
type Droid struct {
... |
package forum
import (
"github.com/google/go-github/github"
"golang.org/x/net/context"
"time"
)
const MaxPageSize = 100
const IssueSort = "updated"
type Github struct {
client *github.Client
ctx context.Context
configuration
}
type configuration struct {
accountName string
owner string
repo ... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
// statemgr package implements object which is responsible for the smart contract
// ledger state to be synchronized and validated
package statemgr
import (
"fmt"
"time"
"github.com/iotaledger/goshimmer/packages/ledgerstate"
"github.com/iotaledger/h... |
//Author: <NAME>
//Adapted from:
//https://web.microsoftstream.com/video/68a288f5-4688-4b3a-980e-1fcd5dd2a53b
//https://web.microsoftstream.com/video/bad665ee-3417-4350-9d31-6db35cf5f80d
package files
type state struct {
//store letter with state. Value is 0
symbol rune
//the two arrows that come from the state. p... |
package replication
import (
"context"
"fmt"
"log"
"strings"
"time"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
)
const defaultTimeout = 10 * time.Second
// State is a wrapper around the persistent key-value storage
// used to store information about the replication state.
type State struct {
l... |
// Copyright (c) 2015 <NAME>. All rights reserved.
//
// Use of this source code is governed by the ISC
// license that can be found in the LICENSE file.
package acd
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
const (
// LibraryVersion is the current ve... |
package run
import (
"fmt"
"log"
ctx "context"
convertcmd "github.com/helm/helm-2to3/cmd"
"github.com/helm/helm-2to3/pkg/common"
"github.com/mongodb-forks/drone-helm3/internal/env"
"github.com/pkg/errors"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/cli"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apim... |
package main
import (
"errors"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apilabels "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg... |
package views
import (
"fmt"
"strings"
"github.com/acaloiaro/di-tui/components"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
)
// ViewContext holds references to all the top-level UI elements in the application
type ViewContext struct {
App *tview.Application
ChannelList *tview.List
FavoriteL... |
// Package ex implements a tool for managing multiple connections to different
// systems and performing actions with them.
package ex
import (
"container/list"
"context"
"io"
"io/ioutil"
"net"
"os"
"sync"
"github.com/pkg/errors"
"github.com/rwool/ex/ex/internal/recorder"
"github.com/rwool/ex/ex/internal/s... |
/**
* Copyright (c) 2018-present, MultiVAC Foundation.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package mvvm
import (
"fmt"
"math"
"github.com/perlin-network/life/exec"
)
const resolverSize = 1 << 8
// defaultResolver i... |
package core
import (
"bytes"
"crypto/sha256"
"fmt"
"reflect"
cborutil "github.com/filecoin-project/go-cbor-util"
"github.com/filecoin-project/go-fil-markets/storagemarket"
"github.com/filecoin-project/go-fil-markets/storagemarket/migrations"
"github.com/filecoin-project/go-fil-markets/storagemarket/network"
... |
package utils
import (
"crypto/rand"
"fmt"
"strconv"
"strings"
)
const (
DEFAULT_PORT = 9999
DEFAULT_HOST = ""
DEFAULT_UNIX = "/var/run/wormhole"
)
func Uuid() string {
b := make([]byte, 16)
rand.Read(b)
b[6] = (b[6] & 0x0f) | 0x40
b[8] = (b[8] & 0x3f) | 0x80
return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], ... |
package injectgo
import (
"fmt"
"reflect"
)
const injectTag = "inject"
// FuncLabelSelector is used to decide a label is selected or not.
type FuncLabelSelector interface {
IsLabelAllowed(string) bool
}
// Container receive all provided objects and function then inject all of them.
type Container struct {
graph... |
package main
import (
"log"
"math/rand"
rl "github.com/zaklaus/raylib-go/raylib"
"github.com/zaklaus/rurik/src/core"
"github.com/zaklaus/rurik/src/system"
)
const (
frameWidth = 52
frameHeight = 20
frameSrcPosX = 0
frameSrcPosY = 0
frameDestPosX = 5... |
package log
import (
"bytes"
"fmt"
"io"
"os"
"runtime"
"strings"
"sync"
"time"
)
type logfmtEncoder struct {
*Encoder
buf bytes.Buffer
}
func (l *logfmtEncoder) Reset() {
l.Encoder.Reset()
l.buf.Reset()
}
var logfmtEncoderPool = sync.Pool{
New: func() interface{} {
var enc logfmtEncoder
enc.Encoder... |
package orca
import (
"errors"
"io"
"log"
"os"
"github.com/nuvo/orca/pkg/utils"
"github.com/spf13/cobra"
)
type chartCmd struct {
name string
version string
releaseName string
packedValues []string
set []string
kubeContext string
namespace string
tls bool
helmTLSSt... |
// Copyright 2019 <NAME> and <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 db contains Firestore-related constants, types, and helper functions.
package db
import (
"context"
"fmt"
"cloud.google.com/go/firestore"
)
... |
/*
* Copyright 2019 The Knative 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 a... |
package mockingjay
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"gopkg.in/yaml.v2"
"io"
"io/ioutil"
"log"
"net/http"
"os"
)
const debugModeOff = false
type mjLogger interface {
Println(...interface{})
}
type endpointValidatorError struct {
EndpointName string
Message string
}
type endpointsVali... |
// Copyright 2014 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 main
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"time"
log "github.com/sirupsen/logrus"
"go.mongodb.org/mongo-driver/bson"
"github.com/troydota/modlogs/src/api"
"github.com/troydota/modlogs/src/auth"
"github.com/troydota/modlogs/src/bot"
... |
// Copyright 2014 The Dename 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 help contains help message listing all commands available in
// dpcmder and how to setup external commands. Help message can be shown from
// command line (if flag "-help" is given) or inside dpcmder application when
// key "h" or any unrecognized key is pressed.
package help
// Version (shoud be git tag), ... |
/*
Copyright 2018-2019 <NAME>, S.A.
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-2021 Wargaming Group Limited
*
* 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 model
import (
"context"
"regexp"
"strings"
"sync/atomic"
"time"
backoff "github.com/cenkalti/backoff/v4"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/dao"
"github.com/rs/zerolog/log"
"github.com/sahilm/fuzzy"
)
// Values tracks Helm values representations.
type Value... |
/*
Copyright 2021 KubeCube 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 comment
package models
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"math/rand"
"time"
)
type (
Word struct {
//Key int "k"
Word string "w"
}
/*
WordRepo struct {
Collection *mgo.Collection
}
*/
CodeRequest struct {
reply chan string
}
)
// Database Collection i... |
package imgapi
import (
"fmt"
"github.com/MerlinDMC/dsapid"
"github.com/MerlinDMC/dsapid/converter"
"github.com/MerlinDMC/dsapid/storage"
)
type imgadmDecoder struct {
provider dsapid.SyncProvider
users storage.UserStorage
}
func NewDecoder(provider dsapid.SyncProvider, users storage.UserStorage) (decoder *... |
package search
import (
"context"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/Bnei-Baruch/archive-backend/consts"
"github.com/Bnei-Baruch/archive-backend/es"
"github.com/Bnei-Baruch/archive-backend/utils"
"github.com/pkg/errors"
"gopkg.in/olivere/elastic.v6"
)
func (e *ESEngine) LessonsSeries(query ... |
// 文件数据记录类
// create by gloomy 2017-04-06 10:11:35
package gutil
import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
)
const maxFileDataRecordingBytes = 1000000 // 默认文件大小
// 文件数据记录对象
// create by gloomy 2017-04-06 10:15:00
type FileDataRecording struct {
sync.Mutex /... |
// Copyright 2019 Authors of Hubble
//
// 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 ... |
package backups
import (
"reflect"
"github.com/chnsz/golangsdk"
"github.com/chnsz/golangsdk/pagination"
)
// ListOpts allows the filtering and sorting of paginated collections through
// the API. Filtering is achieved by passing in struct field values that map to
// the backup attributes you want to see returned.... |
package server
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"strings"
ipfs "github.com/miguelmota/ipdr/ipfs"
regutil "github.com/miguelmota/ipdr/regutil"
log "github.com/sirupsen/logrus"
)
// Server is server structure
type Server struct {
debug bool
listener net.Listener
host ... |
package main
import (
"context"
"flag"
"fmt"
"io"
"log"
"os"
"path/filepath"
"cloud.google.com/go/storage"
"github.com/awbraunstein/gophish"
"github.com/awbraunstein/setlist-search/index"
"github.com/awbraunstein/setlist-search/searcher"
"github.com/pkg/errors"
)
var usageMessage = `usage: indexer
index... |
/*
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 writing, software
dist... |
package log
import (
"fmt"
"os"
"runtime/debug"
"strings"
"time"
)
// assert interface compliance.
var _ Interface = (*Entry)(nil)
// Now returns the current time.
var Now = time.Now
// Entry represents a single log entry.
type Entry struct {
Logger *Logger `json:"-"`
Fields Fields `json:"context"... |
package main
import (
"bytes"
"context"
"crypto/rand"
"encoding/json"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/cdproto/network"
"github.com/chromedp/chromedp"
"io/ioutil"
"log"
"math/big"
"mime/multipart"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
)
ty... |
package etcdclient
import (
"errors"
log "github.com/sirupsen/logrus"
"github.com/coreos/etcd/client"
"github.com/tidwall/gjson"
"golang.org/x/net/context"
"regexp"
"strconv"
"strings"
"time"
)
type Etcd struct {
client client.KeysAPI
}
type App struct {
App string `App`
Component string `Component... |
package config
import (
"fmt"
"os"
"reflect"
"strings"
)
// ModelConfig represents model configurations.
//
// https://docs.getdbt.com/reference/model-configs
type ModelConfig struct {
GeneralConfig
Materialized string
}
// GeneralConfig represents common 'general' configurations.
//
// https://docs.getdbt.com... |
/*
Copyright The ORAS 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, software
distrib... |
// Package di provides dependency injection for the Iris Hero and Iris MVC new features.
// It's used internally by "hero" and "mvc" packages.
package di
import (
"reflect"
"github.com/kataras/iris/v12/context"
)
type (
// ErrorHandler is the optional interface to handle errors per hero func,
// see `mvc/Applica... |
// Copyright 2017 alertmanager-github-receiver 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 applic... |
package main
import (
"bytes"
"fmt"
"go/ast"
"go/format"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"strings"
"text/template"
)
// CmdImport generates a new candyjs.PackagePusher function for the given
// Package, the package can be any builtin or any other third party one.
type Cmd... |
package ledger
import (
"fmt"
"sync"
"github.com/abchain/fabric/core/db"
"github.com/abchain/fabric/protos"
"golang.org/x/net/context"
)
/*
** YA-fabric 0.9 **
We have divided the ledger into two parts: the "global" part which just wrapped the
"globalDB" is kept being a singleton while the "sole" part which ... |
// Copyright 2017 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.
// package nest supports nested transactions allowing a common querier
// to be defined.
package nest
import (
"context"
"database/sql"
"database/sql/driver... |
//
// Author:: <NAME> (<<EMAIL>>)
// Copyright:: Copyright 2021, Lacework Inc.
// License:: Apache License, Version 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://ww... |
package tools
import (
"testing"
"reflect"
)
func TestTextReq_Pt(t *testing.T) {
s := `
As in the hurricane that sweeps the plain, men fly the neighborhood of some.
`
m := `
"Stop your grinning," shouted I, "and why didn't you tell me that that infernal harpooneer was a cannibal?" "I thought ye know'd it;&mda... |
package models
import (
"bufio"
"encoding/json"
"github.com/intervention-engine/fhir/models"
"github.com/pebbe/util"
. "gopkg.in/check.v1"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"os"
"strings"
)
type PipelineSuite struct {
Session *mgo.Session
Query *models.Query
}
var _ = Suite(&PipelineSuite{})
fun... |
package main
import (
"fmt"
"github.com/andlabs/ui"
"github.com/jpki/myna/libmyna"
"github.com/spf13/cobra"
"os"
)
var window *ui.Window
var rootCmd = &cobra.Command{
Use: "mynaui",
Short: fmt.Sprintf("マイナクライアント(GUI) - %s", libmyna.Version),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
lib... |
// 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... |
// Copyright 2017 <NAME> <<EMAIL>>
// Licensed under the BSD, see LICENSE file for details.
package httphelper // import "dmitryfrank.com/geekmarks/server/httphelper"
import (
"context"
"encoding/json"
"net/http"
"github.com/dimonomid/interrors"
"dmitryfrank.com/geekmarks/server/middleware"
"github.com/golang... |
package chunk
import (
"dbsync/sync/contract"
"dbsync/sync/contract/strategy"
"dbsync/sync/core"
"dbsync/sync/criteria"
"dbsync/sync/dao"
"dbsync/sync/diff"
"dbsync/sync/jobs"
"dbsync/sync/merge"
"dbsync/sync/shared"
"dbsync/sync/transfer"
"fmt"
)
//Service represents a chunk service
type Service interface... |
package call
import (
"bytes"
"io"
"reflect"
"strings"
"testing"
)
var (
nilValues = []interface{}{
(*interface{})(nil), (**interface{})(nil), (***interface{})(nil),
(func())(nil), (*func())(nil), (**func())(nil), (***func())(nil),
(chan int)(nil), (*chan int)(nil), (**chan int)(nil), (***chan int)(nil),
... |
// Copyright 2020 The Vanadium 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 security
import (
"context"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"fmt"
"os"
"path"
"path/filepath"
"time"
"v.io/v23/security... |
// Copyright (c) 2019 Uber Technologies, 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 o... |
package codec
import (
"bytes"
"database/sql"
"encoding/base64"
"encoding/json"
"fmt"
"reflect"
"strconv"
"strings"
"time"
"github.com/paulmach/orb"
"github.com/paulmach/orb/encoding/wkt"
"github.com/si3nloong/sqlike/reflext"
"github.com/si3nloong/sqlike/spatial"
"github.com/si3nloong/sqlike/jsonb"
)
... |
package main
import (
"bytes"
"encoding/pem"
"io/ioutil"
"os"
"github.com/Azure/azure-sdk-for-go/management"
"github.com/Azure/azure-sdk-for-go/storage"
"github.com/codegangsta/cli"
"golang.org/x/crypto/pkcs12"
log "github.com/sirupsen/logrus"
)
var (
// GitSummary contains version info, provided by govvv... |
package gora
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
"path"
"strings"
"testing"
"time"
)
// RewriteTransport is an http.RoundTripper that rewrites requests
// using the provided URL's Scheme and Host, and its Path as a prefix.
// The Opaque field is untouched.
// If Transp... |
package rest
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"io"
"math/big"
"net"
"net/mail"
"net/url"
"os"
"time"
)
const (
defaultValidFor = 24 * 365 * time.Hour
defaultRASBits = 4096
)
var (
defaultKeyOut = func() (io.WriteCloser, error) {
return os.Op... |
package ui
import (
"log"
"sort"
"time"
"github.com/bbathe/golog/config"
"github.com/bbathe/golog/models/qso"
"github.com/bbathe/golog/models/spot"
"github.com/lxn/walk"
"github.com/lxn/walk/declarative"
)
var (
dxclustermodel *DXClusterModel
)
// DXClusterModel is used to display cluster spots in the mai... |
/*
Copyright © 2019 The Nature of Software Nordic AB <<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, me... |
package ondemand
import (
"context"
"encoding/json"
"errors"
"os"
"strconv"
"github.com/project-flogo/core/action"
"github.com/project-flogo/core/data"
"github.com/project-flogo/core/data/expression"
"github.com/project-flogo/core/data/mapper"
"github.com/project-flogo/core/data/metadata"
"github.com/proje... |
package shopify
import (
"context"
"fmt"
"strconv"
"time"
log "github.com/sirupsen/logrus"
api "github.com/mxc-foundation/lpwan-app-server/api/m2m-serves-appserver"
"github.com/mxc-foundation/lpwan-app-server/internal/api/external/user"
"github.com/mxc-foundation/lpwan-app-server/internal/auth"
errHandler "... |
/*
* Copyright 2020 F5 Networks
*
* 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... |
/*
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 writing, software
distrib... |
package dktest
import (
"context"
"io/ioutil"
"strings"
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/jsonmessage"
)
var (
// DefaultPullTimeo... |
/*******************************************************************************
*
* Copyright 2017 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 should have received a copy of the License along with this
* program. If... |
package skillz
import (
"context"
"time"
"github.com/volatiletech/null"
)
type CharacterSkillRepository interface {
memberAttributesRepository
memberSkillsRepository
memberSkillQueueRepository
memberFlyableShipRepository
}
type memberAttributesRepository interface {
CharacterAttributes(ctx context.Context, ... |
//
// k2hdkc_go
//
// Copyright 2018 Yahoo Japan Corporation.
//
// Go driver for k2hdkc that is a highly available and scalable distributed
// KVS clustering system. For k2hdkc, see
// https://github.com/yahoojapan/k2hdkc for the details.
//
// For the full copyright and license information, please view
// the license... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.