text stringlengths 3.08k 10.4k |
|---|
// Copyright 2014 <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... |
// Copyright © 2019 Red Hat
//
// 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 main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
"regexp"
"strings"
)
var (
oldStr = ""
newStr = ""
xmlFile = ""
resPath = "./" // resource folder
overlayResPath = "" // overlay resource folder
isOverlayMode = false
manual = `Manual:
replace_android... |
package rules
import (
"encoding/json"
"fmt"
"reflect"
"strings"
hcl "github.com/hashicorp/hcl/v2"
"github.com/terraform-linters/tflint-plugin-sdk/terraform/configs"
"github.com/terraform-linters/tflint-plugin-sdk/tflint"
)
type awsIamStatement struct {
Action interface{} `json:"Action"`
Effec... |
// Copyright © 2019 The Homeport Team
//
// 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 2021 <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 ... |
package main
/* a minimal example of how to register C callbacks and calling them from go */
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"reflect"
"sync"
"time"
"unsafe"
)
// typedef void (*cb)();
// inline void _do_callback(cb f) {
// f();
// }
import "C"
/* callbacks into C-land */
var mut ... |
/*
* Copyright (C) 2019 IBM, 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 ofthe License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
// Copyright (c) 2019 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... |
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
/*
*
* Copyright 2017 gRPC 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... |
package main
import (
"fmt"
"strconv"
"strings"
)
func clusterSlotsInit(c Context) {
if SlotCache.CM.Get("0") == "" {
for i := 0; i <= 16383; i++ {
addr := SlotCache.Opts.RaftTCPAddress
addrSlice := strings.Split(addr, ":")
portStr := addrSlice[1]
port, err := strconv.Atoi(portStr)
if err != nil ... |
/*
Copyright 2016 - <NAME>
Author <NAME> - <EMAIL>
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 under the Apache License, V... |
package gorow
import (
"encoding/json"
"math"
)
// Rig holds boat rigging parameters and has methods to manipulate them
type Rig struct {
Lin float64
Mb float64
BladeLength float64
Lscull float64
Nrowers int32
RowOrScull string
Span float64
CatchAngle float64
DragForm ... |
// Code generated by go-swagger; DO NOT EDIT.
package post_mortems
// 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... |
package task
import (
"database/sql"
"strconv"
"userService/pkg/camunda"
"userService/pkg/camunda/pb"
"userService/pkg/common"
camundamodel "userService/pkg/model/camunda"
"github.com/robfig/cron"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
const (
addIns = "add_ins"
addMcht ... |
// Copyright (c) 2017, <NAME> <<EMAIL>>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package api // import "gopherpit.com/gopherpit/api"
import apiClient "resenje.org/web/client/api"
// MaxLimit is a default maximum number of elements... |
package parameters
import (
"net/url"
"github.com/AkihikoITOH/wrike.go/types"
)
const (
EqualTo Comparator = "EqualTo"
IsEmpty Comparator = "IsEmpty"
IsNotEmpty Comparator = "IsNotEmpty"
LessThan Comparator = "LessThan"
LessOrEqualTo Comparator = "LessOrEqualTo"
GreaterThan... |
package bigip
/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2017 Staples, 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 ... |
package model
import myappv1 "github.com/coolsun/cloud-app/k8s/crd/pkg/apis/app/v1"
//app部分
type AppCreateReq struct {
AppLittleCategory string `json:"app_little_category" binding:"required"` //app小类
ShowName string `json:"show_name" binding:"required"` //名称
VolumeSize string `json:"volum... |
// Copyright 2019 DxChain, All rights reserved.
// Use of this source code is governed by an Apache
// License 2.0 that can be found in the LICENSE file
package dpos
import (
"github.com/DxChainNetwork/godx/common"
"github.com/DxChainNetwork/godx/core/types"
"github.com/DxChainNetwork/godx/ethdb"
"github.com/DxCh... |
package main
import (
"log"
"time"
"go.ligato.io/cn-infra/v2/agent"
"go.ligato.io/cn-infra/v2/examples/model"
"go.ligato.io/cn-infra/v2/logging"
"go.ligato.io/cn-infra/v2/messaging"
"go.ligato.io/cn-infra/v2/messaging/kafka"
"go.ligato.io/cn-infra/v2/utils/safeclose"
)
//*************************************... |
// +build e2e
package e2e
import (
"context"
"io/ioutil"
"path/filepath"
"strings"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/signal"
"runtime"
"runtime/pprof"
"syscall"
"time"
)
var (
resultChan = make(chan Result)
abortChan = make(chan bool)
stopWaitLoop = false
tearDownInProgress = false
randomSource = rand.New(rand.NewS... |
package logs
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"sort"
"strings"
)
type EnforcementRule struct {
DstIP string
QoS string
ClassID TCHandle
}
type rulesAndRets struct {
rules []EnforcementRule
didRets []bool
}
func (r rulesAndRets) Len() int { return len(r.rules) }
func (r rulesAndRets) ... |
package auth
import (
"crypto/rsa"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
"code.cloudfoundry.org/lager"
"github.com/concourse/atc/dbng"
"net/url"
"golang.org/x/net/context"
"golang.org/x/oauth2"
)
type OAuthCallbackHandler struct {
logger lager.Logger
provider... |
// QuestionHandlerの共通部分定義
// 主にRedisに関するinterfaceやstructを定義
package handler
import (
"encoding/json"
"fmt"
"time"
"github.com/cndjp/qicoo-api/src/loglib"
"github.com/cndjp/qicoo-api/src/mysqlib"
"github.com/cndjp/qicoo-api/src/pool"
"github.com/go-gorp/gorp"
"github.com/gomodule/redigo/redis"
)
func init() ... |
package main
import (
"bytes"
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"net/mail"
"os"
"path/filepath"
"strings"
"time"
"github.com/fatih/color"
"github.com/mhale/smtpd"
)
var (
addr = flag.String("addr", "127.0.0.1:2525", "Listen address:port")
cert = flag.String("cert", "", "PEM-encoded... |
package reliable
import (
"github.com/lithdew/bytesutil"
"github.com/valyala/bytebufferpool"
"io"
"math/bits"
"time"
)
const ACKBitsetSize = 32
type (
Buffer = bytebufferpool.ByteBuffer
Pool = bytebufferpool.Pool
)
type writtenPacket struct {
buf *Buffer // pooled contents of this packet
acked bo... |
package main
import (
"bufio"
"bytes"
"fmt"
"github.com/cheggaaa/pb"
"github.com/kr/pty"
"github.com/mattn/go-isatty"
"io"
"os"
"os/exec"
"os/signal"
"regexp"
"strconv"
"syscall"
)
var (
ProgressTimeRegex = regexp.MustCompile(`\s+time=\s*((\d{2}):(\d{2}):(\d{2}))\.\d+`)
DurationRegex = regexp.MustC... |
package rabbitmqutils
import (
"encoding/json"
"runtime"
"time"
mapset "github.com/deckarep/golang-set"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/streadway/amqp"
)
var errUnknownQueue = errors.New("unknown queue")
//go:generate mockery --name=MessageBrokerConnection --inpackage --case=unde... |
/**
* Copyright (c) 2015 Intel 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-2.0
*
* Unless required by applicable law or ... |
// Package app contains functionality related to creating an integrated
// motki-server environment with all the necessary dependencies.
//
// The goal with this package is to provide a single, reusable base for
// getting a motki application server up and running.
//
// This package imports every other motki-server pa... |
package consumer
import (
"context"
"log"
"sync"
"time"
"github.com/go-playground/backoff-sys"
"github.com/go-playground/errors/v5"
errorsext "github.com/go-playground/pkg/v5/errors"
"github.com/go-playground/relay-client-go"
"golang.org/x/sync/errgroup"
)
// Processor represents a processor of Jobs
type Pr... |
package backend
import (
"context"
"errors"
"sort"
"strings"
"github.com/hashicorp/vault/sdk/framework"
"github.com/hashicorp/vault/sdk/logical"
"github.com/puppetlabs/leg/errmap/pkg/errmark"
"github.com/puppetlabs/vault-plugin-secrets-oauthapp/v3/pkg/persistence"
"github.com/puppetlabs/vault-plugin-secrets-... |
package httpserver
import (
"context"
"errors"
"fmt"
"net"
"net/http"
)
// HandleOption customizes the behavior of a Handle.
type HandleOption interface {
apply(*Handle)
}
type handleOptionFunc func(*Handle)
func (f handleOptionFunc) apply(h *Handle) { f(h) }
// ListenFunc is an option for Handle that allows... |
package wxpayslim
import (
"context"
"crypto/md5"
"encoding/xml"
"fmt"
"strconv"
)
const (
transferUrl = prefix + "/mmpaymkttransfers/promotion/transfers"
transferQueryUrl = prefix + "/mmpaymkttransfers/gettransferinfo"
)
// Transfer money to user. Docs:
// https://pay.weixin.qq.com/wiki/doc/api/tools/mc... |
// Copyright (c) 2015 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 service
import (
"context"
"errors"
"readingo/constant"
"readingo/dao"
"readingo/model"
"sort"
"strings"
)
func OperateRedis(ctx context.Context, req interface{}) (resp interface{}, code int, err error) {
request := req.(*model.OperateRedisReq)
request.Action = strings.ToUpper(request.Action)
role ... |
package main
import (
"flag"
"fmt"
"image"
"image/draw"
_ "image/jpeg"
_ "image/png"
"os"
"os/signal"
"runtime"
"github.com/faiface/pixel/pixelgl"
"github.com/pkg/profile"
"github.com/sirupsen/logrus"
"github.com/karlek/wasabi/blueprint"
"github.com/karlek/wasabi/buddha"
"github.com/karlek/wasabi/frac... |
// Copyright 2017 CNI 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 ... |
package adapters
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
u "net/url"
"path/filepath"
"strings"
"github.com/stts-se/rec"
"github.com/stts-se/rec/config"
)
type tflowResp struct {
Status bool `json:"status"`
RecognisedUtterance string `json:"recognised_utterance"`
Conf... |
package raftkv
import (
"crypto/rand"
"cs408/labrpc"
"math/big"
"strconv"
"strings"
)
var CONTEXTSEPARATOR = ":"
type Clerk struct {
servers []*labrpc.ClientEnd
// You will have to modify this struct.
lastLeader int
}
func nrand() int64 {
max := big.NewInt(int64(1) << 62)
bigx, _ := rand.Int(rand.Reader,... |
// Copyright 2013 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package ssh
import (
"bytes"
"fmt"
"io"
"os"
"os/exec"
"strings"
"github.com/juju/errors"
"github.com/juju/utils"
)
// default identities will not be attempted if
// -i is specified and they are not explcitly
// inc... |
package wire
import (
"encoding/binary"
"fmt"
"io"
"reflect"
"github.com/golang/protobuf/proto"
"github.com/itchio/savior"
"github.com/pkg/errors"
)
var (
// ErrFormat is returned when we find a magic number that isn't the one we expected
ErrFormat = fmt.Errorf("wrong magic (invalid input file)")
)
// Read... |
/*
* Copyright 2018 INS Ecosystem
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
package apigateway_adapter
import (
"bytes"
"context"
"encoding/base64"
"io"
"net/http"
"strings"
"unicode/utf8"
"github.com/aws/aws-lambda-go/events"
)
// Adapt returns lambda handler that passes processing to http.Handler.
//
// Adapt converts received API Gateway event to *http.Request instance, invokes
/... |
package manager
import (
"log"
"github/itzaname/oblivion_player/oblivion"
"github.com/veandco/go-sdl2/sdl"
)
const (
BoxWidth = int32(400)
BoxHeight = int32(195)
InputWidth = int32(360)
InputHeight = int32(35)
)
var (
UsernameInput = false
PasswordInput = false
TextInput = false
UsernameBuf... |
package textures
import (
"fmt"
"strings"
"github.com/emily33901/forgery/core/filesystem"
"github.com/emily33901/vtf"
"github.com/g3n/engine/gls"
"github.com/g3n/engine/math32"
"github.com/g3n/engine/texture"
"github.com/go-gl/gl/v2.1/gl"
)
type Texture struct {
filePath string
fileSystem *filesystem.Fil... |
package rpcx
import (
"context"
"errors"
"github.com/gen-iot/liblpc/v2"
"github.com/gen-iot/std"
"io"
"log"
"reflect"
"sync"
"sync/atomic"
)
var Debug = true
var gRpcSerialization = std.MsgPackSerialization
type Core interface {
Loop() *liblpc.IOEvtLoop
RegFunc(f interface{}, m ...MiddlewareFunc)
RegFunc... |
package logic
import (
"fmt"
"strconv"
"strings"
"github.com/sergi/go-diff/diffmatchpatch"
)
// Output に結果を渡してくれればあとは処理をします
func Output(result Booster) {
statusCodeMatched := result.Checker.StatusCode && needsStatusCodeMatched(result.ResultMap)
headerMatched := result.Checker.Header && needsHeaderMatched(resul... |
/*
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package main
/*
Definition for the main Gangplank command. This defined the "human"
interfaces for `run` and `run-steps`
*/
import (
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
"time"
"github.com/coreos/coreos-assembler-schema/cosa"
jobspec "github.com/coreos/gangplank/internal/spec"
log "github.com/si... |
/* (c) 2019, Blender Foundation - <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, pub... |
package config
import (
"crypto"
"crypto/x509"
"fmt"
"github.com/SpencerBrown/mongodb-tls-certs/mx509"
"gopkg.in/yaml.v3"
"os"
"path/filepath"
)
// defaults for directories and extensions
const (
defaultPublicDirectory = "tls"
defaultPrivateDirectory = "tls/private"
defaultExtensionKey = "key"
default... |
package main
import (
"os"
"errors"
"strings"
"strconv"
_ "net/http/pprof"
"github.com/Financial-Times/factset-uploader/factset"
"github.com/Financial-Times/factset-uploader/loader"
"github.com/Financial-Times/factset-uploader/rds"
"github.com/jawher/mow.cli"
log "github.com/sirupsen/logrus"
)
const app... |
package main
import (
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"mime"
"net/http"
"os"
"path/filepath"
"sync"
"time"
"github.com/ancientlore/kubismus"
"github.com/google/uuid"
)
func doHTTP(ctx context.Context, name string, cfg *FolderCfg, ch <-chan os.FileInfo) {
var wg sync.WaitGroup
// crea... |
package storages
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"path/filepath"
"strconv"
"strings"
"github.com/ali-furkqn/stona/config"
"github.com/ali-furkqn/stona/images"
"github.com/ali-furkqn/stona/tools/messages"
"cloud.google.com/go/storage"
"github.com/gofiber/fiber/v2"
"github.com/goog... |
/**
* @project let-sGo
* @Author 27
* @Description //TODO
* @Date 2021/7/24 01:31 7月
**/
package main
import (
"context"
"fmt"
pb "fzkprac/prac_grpc/learn_20210724/grpc_demo/route"
"google.golang.org/grpc"
"google.golang.org/protobuf/proto"
"io"
"log"
"math"
"net"
"time"
)
type routeGuideServer struct ... |
// Copyright ©2012 The bíogo 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 mafft implements interaction with the MAFFT multiple alignment tool.
// MAFFT is available from http://mafft.cbrc.jp/alignment/software/
package ... |
package explainer
import (
"fmt"
"time"
"github.com/myrteametrics/myrtea-engine-api/v4/internals/explainer/issues"
"github.com/myrteametrics/myrtea-engine-api/v4/internals/fact"
"github.com/myrteametrics/myrtea-engine-api/v4/internals/models"
"github.com/myrteametrics/myrtea-engine-api/v4/internals/reader"
"gi... |
package util
import (
"fmt"
"io"
"os"
"os/exec"
"bufio"
"bytes"
"strings"
"github.com/alexcesaro/log"
"github.com/alexcesaro/log/golog"
)
func Panicf(msg string, args ...interface{}) {
panic(fmt.Sprintf(msg, args...))
}
func LookPathOrAbort(binaryName string) string {
var binary, lookErr = exec.LookPat... |
package actions
import (
"os"
"github.com/guumaster/cligger"
"github.com/spf13/cobra"
)
var (
version = "dev"
)
// NewRootCmd creates the base command for hostctl.
func NewRootCmd() *cobra.Command {
rootCmd := &cobra.Command{
Use: "hostctl",
Short: "Your dev tool to manage /etc/hosts like a pro",
V... |
package main
//
// This example will show you how to port a shader you find from shadertoy.com
// to Pixel. See ../assets/shaders/fastblur.frag.glsl for more details and comments
//
import (
"image/color"
"math"
"time"
"github.com/faiface/pixel"
"github.com/faiface/pixel/imdraw"
"github.com/faiface/pixel/pixel... |
// Copyright 2016-2019, Pulumi 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-2.0
//
// Unless required by applicable law o... |
package speedtestclient
import (
"encoding/xml"
"fmt"
"github.com/iikira/BaiduPCS-Go/pcstable"
"github.com/iikira/speedtest/speedtestutil/xmlhelper"
"io"
"strconv"
"unsafe"
)
type (
speedtestConfigClient struct {
XMLName xml.Name `xml:"client"`
IP string `xml:"ip,attr"`
Lat float64 `xm... |
// Copyright 2018 The TigLabs raft 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... |
// Copyright 2019 Yunion
//
// 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... |
// Copyright 2020 tsuru 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 version
import (
"encoding/json"
"fmt"
"regexp"
"strings"
"github.com/pkg/errors"
provTypes "github.com/tsuru/tsuru/types/provision"
)
var (
pr... |
/*
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 writing,... |
package secure_test
import (
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/sysdiglabs/harbor-scanner-sysdig-secure/pkg/secure"
)
const (
user = "a user"
password = "<PASSWORD>"
)
var _ = Describe("Sysdig Secure Client", func() {
var (
client secure.Client
)
BeforeEach(func(... |
package kinesis
import (
"fmt"
"io"
"github.com/fastly/cli/pkg/cmd"
"github.com/fastly/cli/pkg/commands/compute/manifest"
"github.com/fastly/cli/pkg/config"
"github.com/fastly/cli/pkg/errors"
"github.com/fastly/cli/pkg/text"
"github.com/fastly/go-fastly/v3/fastly"
)
// CreateCommand calls the Fastly API to c... |
package main
import (
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"os/signal"
"strings"
"time"
sr "github.com/TheSmallBoat/carlo/streaming_rpc"
"github.com/TheSmallBoat/fiesta"
)
const (
ServicePublish = "Publish-Service"
ServiceSubscribe = "Subscribe-Service"
ActionHeader = "Action"
TopicHeader... |
/*
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner 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
http://www.apache.org/licenses/LICENSE-2.0
Unless requ... |
package entity
import (
"context"
"gxt-park-assets/internal/app/schema"
"time"
"github.com/jinzhu/gorm"
)
// GetProjIncomeCalculationDB 项目收益测算
func GetProjIncomeCalculationDB(ctx context.Context, defDB *gorm.DB) *gorm.DB {
return getDBWithModel(ctx, defDB, ProjIncomeCalculation{})
}
// SchemaProjIncomeCalculat... |
// Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance 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 main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"strings"
"github.com/Myra-Security-GmbH/myra-shell/api"
"github.com/Myra-Security-GmbH/myra-shell/command"
_ "github.com/Myra-Security-GmbH/myra-shell/command/impl"
"github.com/Myra-Security-GmbH/myra-shell/console"
"github.com/Myra-Security-GmbH/myra-sh... |
package nitro
import (
"fmt"
"io"
"os"
"path/filepath"
"sync"
"sync/atomic"
"syscall"
)
var useLinuxHolePunch = false
// TODO: Reopen fds on error
type BlockManager interface {
DeleteBlock(bptr blockPtr) error
WriteBlock(bs []byte, shard int) (blockPtr, error)
ReadBlock(bptr blockPtr, buf []byte) error
}
... |
package parse
import (
"reflect"
"testing"
. "github.com/wkhere/colt/lex"
)
// shorter syntax
type b = []byte
type tg = [][]Token
type ts = []Token
func t(tt TokenType, data string) Token {
return Token{Type: tt, Val: b(data)}
}
var (
sep = t(TokenSep, ";")
d1 = t(TokenData, "a")
d2 = t(TokenData, "bb... |
package provision
import (
"fmt"
"github.com/mainflux/mainflux/errors"
"github.com/mainflux/mainflux/logger"
mfSDK "github.com/mainflux/mainflux/sdk/go"
provSDK "github.com/mainflux/provision/sdk"
)
const (
ExternalID = "externalID"
Active = 1
)
var (
errFailedToCreateToken = errors.New("failed to creat... |
package cert
import (
"crypto"
"crypto/x509"
"fmt"
"time"
"github.com/fatih/color"
"github.com/pkg/errors"
"k8s.io/klog"
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
kubeadmpkiutil "k8s.io/kubernetes/cmd/kubeadm/app/util/pkiutil"
... |
package app
import (
bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/gov"
"github.com/cosmos/... |
package docker
import (
"bufio"
"bytes"
_docker "github.com/fsouza/go-dockerclient"
"github.com/golang/glog"
"io"
"time"
)
// Endpoint and file paths
func NewTLSClient(endpoint string, cert, key, ca string) (c *Docker, err error) {
c = &Docker{Endpoint: endpoint, Cert: cert, Ca: ca, Key: key}
c.docker, err = ... |
package cmd
import (
"fmt"
"math"
"os"
"os/signal"
"strings"
"sync"
"syscall"
"unsafe"
)
// PBar is the progress bar model
type PBar struct {
Total uint16 // Total number of iterations to sum 100%
Header uint16 // Header length, to be used to calculate the bar width "Progress: [100%... |
package golexa
import (
"errors"
"strings"
"time"
"github.com/robsignorelli/golexa/speech"
"github.com/sirupsen/logrus"
)
// NewResponse create a bare-bones response instance that you can continue to expand on
// with additional instructions for Alexa like `Speak()` or `SimpleCard()`.
func NewResponse(request R... |
// 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... |
package main
import (
"encoding/json"
"fmt"
"log"
"strings"
"time"
"net/http"
"github.com/k0kubun/pp"
"github.com/parnurzeal/gorequest"
)
type InputMedia struct {
Type string `json:"type"`
Media string `json:"media"`
Caption string `json:"caption"`
ParseMode string `json:"parse_mode"`
}
... |
package binance
import (
json2 "encoding/json"
"fmt"
"github.com/ty0924/goex"
"github.com/ty0924/goex/internal/logger"
"os"
"strings"
"sync"
"time"
)
type req struct {
Method string `json:"method"`
Params []string `json:"params"`
Id int `json:"id"`
}
type resp struct {
Stream string ... |
// Copyright 2021 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package assembler
import (
"encoding/csv"
"errors"
"fmt"
"strconv"
"strings"
)
type Node interface {
offset(uint16) uint8
size() uint
}
type labelNode struct {
content string
address uint16
}
func (l labelNode) offset(dest uint16) uint8 {
return uint8(l.address - dest)
}
func (l *labelNode) String() stri... |
package sql
import (
"fmt"
"strings"
"github.com/jmoiron/sqlx"
"github.com/yaoapp/xun/dbal"
"github.com/yaoapp/xun/utils"
)
// Quoter the database quoting query text SQL type
type Quoter struct {
DB *sqlx.DB
DBPrimary *sqlx.DB
DBReadOnly *sqlx.DB
Prefix string
}
//Bind make a new Quoter intefa... |
package internal
import (
"bufio"
"bytes"
"errors"
"fmt"
"runtime"
"runtime/pprof"
"strings"
"time"
"github.com/stackimpact/stackimpact-go/internal/pprof/profile"
)
type CPUProfiler struct {
agent *Agent
profile *BreakdownNode
profWriter *bufio.Writer
profBuffer *bytes.Buffer
startNano int64
}... |
/* JOB: Fetch Images and Save to File
*/
package main
import (
"fmt"
"image"
"image/color"
"log"
"net/http"
"time"
mjpeg "GoCamCapture/mjpeg"
)
type computeBlock struct {
stamp time.Time
lum uint8
computeImg *image.Gray
diffImg *image.Gray
srcImg image.Image
diffVal int
}
const... |
package doc
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"sort"
"strings"
"github.com/hoisie/mustache"
"hawx.me/code/vodka/parser"
)
type FunctionDoc struct {
name string
doc string
src string
grp string
}
func (f *FunctionDoc) String() string {
sig, _ := regexp.Compile("^[a-z]+:")
s := ""
for _, lin... |
package crypto
import (
"context"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
"os"
"github.com/andrewneudegg/delta/pkg/events"
"github.com/andrewneudegg/delta/pkg/relay"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
type encryptionDirection int
const (
encryptDirec... |
package main
import (
"charly/db"
"charly/git"
"charly/scripts"
"charly/types"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/robfig/cron/v3"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/alecthomas/kingpin.v2"
)
var (
debug = kingpin.Flag("debug", "enable debug mode").Bool()
con... |
package agin
import (
"errors"
"fmt"
"github.com/gorilla/websocket"
"math/rand"
"sync"
"time"
)
// oauth websocket connection pool
type ConnectionPool struct {
Pool map[string]*Connection
uuidGenerator SceneID
}
// create connection pool
func NewConnectionPool() ConnectionPool {
//fmt.Println("create conn... |
package commands
import (
"fmt"
"log"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
"github.com/fsnotify/fsnotify"
"github.com/gutenye/gnote/gnote.go/src/utils"
"github.com/yargevad/filepathx"
)
type Tags struct {
NoteDir string `default:"${noteDir}" help:"Note directory"`
NoteExtension string `default... |
/*
Copyright 2018 Nexinto
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 container_backend
import (
"fmt"
"io"
)
type BuildStapelStageOptionsInterface interface {
SetBaseImage(baseImage string) BuildStapelStageOptionsInterface
AddLabels(labels map[string]string) BuildStapelStageOptionsInterface
AddVolumes(volumes []string) BuildStapelStageOptionsInterface
AddExpose(expose [... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.