text stringlengths 3.08k 10.4k |
|---|
package begonia
import (
"encoding/json"
"github.com/MashiroC/begonia-rpc/conn"
"github.com/MashiroC/begonia-rpc/entity"
"github.com/MashiroC/begonia-rpc/util/log"
uuid "github.com/satori/go.uuid"
"time"
)
// handler有三种 分别是
// 本地cli请求远程
// 本地cli请求响应
// 处理远程请求
type Client struct {
addr string
signCache [... |
// Copyright 2019-2020 Kosc Telecom.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
// Copyright (c) 2011-2017, HL7, Inc & The MITRE Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, ... |
/*
Copyright (c) 2022 Murex
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, sublicens... |
package wow
import (
"archive/zip"
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"strings"
)
func GuessPath() (string, bool) {
paths := []string{
"${PROGRAMW6432}\\World of Warcraft\\_retail_",
"${PROGRAMFILES(X86)}\\World of Warcraft\\_retail_",
"${HOME}/Games/world-of-warcr... |
package resumable_test
import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/gphotosuploader/google-photos-api-client-go/v2/uploader/resumable"
)
func TestNewResumableUploader(t *testing.T) {
s := &MockedSessionStorer{}
t.Run("WithoutOptions", func(t *testing.T) {
_, err := resumab... |
// Copyright 2019 The gaego-sandbox Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command gaego-sandbox is the sample logging-quickstart writes a log entry to Stackdriver Logging.
package main
import (
"context"
"fmt"
"log"
... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package healthcare
import (
"fmt"
//"encoding/base64"
"encoding/json"
//"strings"
"log"
//"crypto/sha256"
//"hash"
"time"
"github.com/hyperledger/fabric-contract-api-go/contractapi"
//"github.com/golang/protobuf/ptypes"
"h... |
//go:generate go run pkg/codegen/cleanup/main.go
//go:generate go run pkg/codegen/main.go
package main
import (
"context"
"flag"
"os"
"os/signal"
"syscall"
"time"
"github.com/cnrancher/ack-operator/controller"
ackv1 "github.com/cnrancher/ack-operator/pkg/generated/controllers/ack.pandaria.io"
"github.com/g... |
package pinger
import (
"database/sql"
"fmt"
"ispcp/internal/host"
"ispcp/internal/model"
"ispcp/internal/store"
"ispcp/internal/store/file"
"ispcp/internal/store/mysql"
"os"
"time"
mynet "github.com/RomanAvdeenko/utils/net"
//"github.com/j-keck/arping"
"ispcp/internal/arping"
"github.com/rs/zerolog"
... |
// 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... |
package models
import (
"time"
"github.com/interuss/dss/pkg/api/v1/scdpb"
dsserr "github.com/interuss/dss/pkg/errors"
dssmodels "github.com/interuss/dss/pkg/models"
"github.com/golang/geo/s2"
"github.com/golang/protobuf/ptypes"
"github.com/interuss/stacktrace"
)
const (
// maxSubscriptionDuration is the lar... |
package model
import (
"encoding/json"
)
type ModelVersion struct {
Version string `json:"version"`
}
type ModelVersionSummary struct {
ID string `json:"modelId"`
LatestVersion string `json:"latestVersion"`
Versions SortedVersions `json:"versions"`
}
type ModelDetailsTimeout str... |
// Package health implements a node health checker which can emit events when a
// node goes unhealthy.
package health
import (
"fmt"
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/rfratto/croissant/internal/api"
"github... |
// Written by https://xojoc.pw. GPLv3 or later.
// Package useragent parses a user agent string.
package useragent // import "xojoc.pw/useragent"
import (
"fmt"
"net/url"
"regexp"
"strings"
"github.com/blang/semver"
)
type Type int
const (
Unknown Type = iota
Browser
Crawler
LinkChecker
Validator
FeedRe... |
/*
Copyright (c) 2014 <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, sublicen... |
package main
import (
"flag"
"fmt"
"net/http"
"os"
"strings"
"time"
"github.com/andybons/hipchat"
"github.com/gorilla/mux"
"github.com/hpcloud/tail"
"github.com/prometheus/client_golang/prometheus/promhttp"
logger "github.com/sirupsen/logrus"
)
var t0 = time.Now()
var totallines = 0
// RemoteToken ... us... |
package api_test
import (
"bytes"
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/labstack/echo"
"github.com/lottotto/todo-app/api"
"github.com/lottotto/todo-app/model"
"github.com/stretchr/testify/assert"
"github.com/DATA-DOG/go-sqlmock"
)
func TestHelloHandler(t *testing.T) ... |
package podcast
import (
podownloader "PoDownloader"
"PoDownloader/logger"
"PoDownloader/util"
"encoding/json"
"fmt"
"net/http"
"path"
)
// Podcast contains all information about a podcast
type Podcast struct {
RSS string `json:"rss,omitempty"`
Title string `json:"ti... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2020-present Datadog, Inc.
package traps
import (
"strings"
"testing"
"github.com/gosnmp/gosnmp... |
package bucket_api
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
//"net/http"
"encoding/gob"
"os"
"os/signal"
"strings"
"syscall"
log "github.com/sirupsen/logrus"
// "github.com/aws/aws-sdk-go/aws"
// "github.com/aws/aws-sdk-go/service/S3"
// "github.com/aws/aws-sdk-go/aws/session"
"github.com/confl... |
package http
import (
"context"
"fmt"
"net/http"
"os"
"os/signal"
"strings"
"time"
"github.com/gin-gonic/gin"
"github.com/sbreitf1/errors"
log "github.com/sirupsen/logrus"
ginprometheus "github.com/zsais/go-gin-prometheus"
)
var (
// ErrGraceShutdown is returned when the server has been gracefully shut d... |
package main
import (
_ "log"
"net"
_ "os"
)
var glnum int64 = 0
var gsnum string = "start"
var workernum int = 1
var masters []chan *ReqData
var workers []chan *ReqData
var quotas []chan *RspData
var nets []chan []byte
var workermaps []map[string]*QUOTA
var quotamaps []map[string]*LOCALDATA
var setnow int64 = 0
... |
// Copyright (c) 2016 Western Digital Corporation or its affiliates. All rights reserved.
// SPDX-License-Identifier: MIT
package evilblb
import (
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/westerndigitalcorporation/blb/internal/evilblb/failimpl"
"github.com/westerndigitalcorporation/blb/internal/evilb... |
/*
* Copyright The Dragonfly 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 agr... |
// 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 godax
import (
"encoding/json"
"io/ioutil"
"net/http"
)
// Order represents a trading account for a coinbase pro profile.
/*
{
"id": "d0c5340b-6d6c-49d9-b567-48c4bfca13d2",
"price": "0.10000000",
"size": "0.01000000",
"product_id": "BTC-USD",
"side": "buy",
... |
package main
import (
"github.com/in4it/ecs-deploy/api"
"github.com/in4it/ecs-deploy/provider/ecs"
"github.com/in4it/ecs-deploy/util"
"github.com/juju/loggo"
"github.com/spf13/pflag"
"fmt"
"os"
)
func startup_checks() {
mandatoryEnvVars := []string{
"AWS_REGION",
"JWT_SECRET",
"DEPLOY_PASSWORD",
}
pa... |
package types
import (
"encoding/json"
"errors"
"fmt"
"time"
"github.com/lib/pq"
"github.com/gbl08ma/sqalx"
sq "github.com/Masterminds/squirrel"
)
// PPPlayerAchievement contains data about a PosPlay achievement for one user
type PPPlayerAchievement struct {
DiscordID uint64
Achievement *PPAchievement
... |
package ui
import (
"gioui.org/layout"
"gioui.org/text"
"gioui.org/unit"
"gioui.org/widget"
"github.com/raedahgroup/godcr/ui/decredmaterial"
"github.com/raedahgroup/godcr/wallet"
)
const PageWalletAccounts = "walletAccounts"
type walletAccountPage struct {
walletID int
wallet *wall... |
package server
import (
"../context"
"../logger"
"../model"
"../validator"
"../workpool"
"bytes"
"encoding/json"
"fmt"
"github.com/google/uuid"
"github.com/gorilla/mux"
"gopkg.in/yaml.v2"
"io/ioutil"
"net/http"
)
//signature of the validation function which you can inject to handler to validate your requ... |
package konghcl
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"strings"
"github.com/alecthomas/kong"
"github.com/hashicorp/hcl"
"github.com/pkg/errors"
)
// Resolver resolves kong Flags from configuration in HCL.
type Resolver struct {
config map[string]interface{}
}
var _ kong.ConfigurationLoader ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: destinations/http.proto
package destinations
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
// T... |
// 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 network
import (
"context"
"github.com/golang/protobuf/ptypes/empty"
"chromiumos/tast/common/crypto/certificate"
"chromiumos/tast/common... |
package ipset
import (
"crypto/rand"
"encoding/hex"
"fmt"
"log"
"os/exec"
"strings"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/types"
)
type Name string
type Type string
const (
ListSet = Type("list:set")
HashIP = Type("hash:ip")
HashNet = Type("hash:net")
)
type Interface interface {
Create(ip... |
package redisWrapper
import (
"encoding/json"
"fmt"
"log"
"testing"
"time"
"github.com/go-redis/redis/v7"
"github.com/sirupsen/logrus"
)
var clusterClient *redis.ClusterClient
func init() {
log.SetFlags(log.Llongfile | log.Lshortfile)
slots := []redis.ClusterSlot{
// First node with 1 master and 1 slave... |
package server
import (
"crypto/md5"
"fmt"
"github.com/Jeffail/tunny"
"github.com/nfnt/resize"
"go-drive/common"
"go-drive/common/drive_util"
"go-drive/common/errors"
"go-drive/common/i18n"
"go-drive/common/registry"
"go-drive/common/task"
"go-drive/common/types"
"go-drive/common/utils"
"image"
_ "image/... |
package polygol
import (
"testing"
)
func TestGeomInRingIn(t *testing.T) {
var ringIn *ringIn
var err error
var ring [][]float64
op := newOperation("")
// create exterior ring
ring = [][]float64{
{0, 0},
{1, 0},
{1, 1},
}
expectedPt1 := &point{x: 0, y: 0}
expectedPt2 := &point{x: 1, y: 0}
expectedP... |
package odoo
import (
"fmt"
)
// AccountInvoiceTax represents account.invoice.tax model.
type AccountInvoiceTax struct {
LastUpdate *Time `xmlrpc:"__last_update,omptempty"`
AccountAnalyticId *Many2One `xmlrpc:"account_analytic_id,omptempty"`
AccountId *Many2One `xmlrpc:"account_id,omptempty"`
... |
package module
import (
"github.com/v4lproik/no-name/data"
"net/url"
"github.com/v4lproik/no-name/util"
"strconv"
"github.com/v4lproik/no-name-domain"
)
type bruteforceModule struct {
credentials *data.Credentials
htmlSearchValues []string
stopFirstFound bool
next Module
}
func NewBruteforceModule(credenti... |
package controller
import (
"encoding/base64"
"fmt"
"net/http"
"os"
"strconv"
"time"
echosession "github.com/go-session/echo-session"
"github.com/labstack/echo"
)
type LoginInfo struct {
Username string
NameSpace string
}
type CredentialInfo struct {
Username string
Password string
}
type CommonURL str... |
// The code in this file were adapted from the following original source to verify signature on YAML files.
// The original source: https://github.com/sigstore/cosign/blob/main/cmd/cosign/cli/verify.go
package cli
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"github.com/peterbourgon/ff/v3/ffcli"
"gith... |
package app_test
import (
"bytes"
"context"
"errors"
"fmt"
"math/rand"
"os"
"sync"
"testing"
"github.com/aphistic/gomol"
"github.com/stretchr/testify/assert"
"github.com/demosdemon/golang-app-framework/app"
)
func newApp(environ []string, args ...string) *app.App {
return &app.App{
Arguments: args,
... |
package client
import (
"archive/tar"
"bytes"
"compress/gzip"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"strings"
"github.com/docker/cli/cli/compose/loader"
"github.com/docker/cli/cli/compose/types"
"github.com/sirupsen/logrus"
)
func NewComposeUpdater(notaryUrl, cac... |
// Copyright 2012 The LevelDB-Go and Pebble 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 pebble
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"reflect"
"strings"
"testing"
"github.com/kr/pretty"
"github.com/pete... |
package raft
import (
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/raft"
raftboltdb "github.com/hashicorp/raft-boltdb"
"github.com/integration-system/gds/config"
"github.com/pkg/errors"
"net"
"os"
"path/filepath"
"time"
)
const (
defaultSyncTimeout = 3 * time.Second
dbFile = "raft_db"
... |
/*
* Copyright 2020 The Magma Authors.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
*... |
// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
/**
Copyright 2022 DataStax, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionByoipCidrRequest
type ProvisionBy... |
// Copyright 2016 The nvim-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 nvimutil
import (
"fmt"
"go/token"
"path/filepath"
"strconv"
"strings"
"github.com/neovim/go-client/nvim"
"github.com/zchee/nvim-go/pkg/c... |
package logh
import (
"bytes"
"encoding/json"
"errors"
"io"
"net/http"
"strings"
"time"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// ErrPostOne: you could not post one
var ErrPostOne = errors.New("post one error")
var ErrGetStat = errors.New("get stat error")
// HTTPLogger holds api server's url
type Requ... |
package cloudscale_slb_controller
import (
"context"
"fmt"
log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"time"
)
const ControllerAnnotation = "linkyard.ch/slb-controller-id"
type ControllerConfig struct {
CloudscaleTo... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package iotsitewise
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource schema for AWS::IoTSiteWise::Ac... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: item.proto
package scene
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type SceneItemDat... |
package gloo
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"text/template"
"github.com/pkg/errors"
"github.com/solo-io/thetool/pkg/common"
"github.com/solo-io/thetool/pkg/downloader"
"github.com/solo-io/thetool/pkg/feature"
"github.com/solo-io/thetool/pkg/util"
)
func Build(enabled []feature.Fea... |
package controllers
import (
"github.com/astaxie/beego"
"encoding/json"
"github.com/astaxie/beego/orm"
"time"
"strings"
"strconv"
"fmt"
"meal/models"
"meal/enums"
"meal/utils"
)
type MealUserOrderController struct {
BaseController
}
//Prepare 参考beego官方文档说明
func (c *MealUserOrderController) Prepare() {
//... |
package main
import (
"bufio"
"fmt"
"github.com/codegangsta/cli"
"github.com/fatih/color"
"golang.org/x/crypto/ssh"
"io/ioutil"
"net/url"
"os"
"strings"
"time"
)
// Colors
var labelColor = color.New(color.FgMagenta).Add(color.Bold).SprintFunc()
var hostColor = color.New(color.FgCyan).SprintFunc()
// Clean ... |
package design
import (
"io"
"github.com/gregoryv/draw"
"github.com/gregoryv/draw/shape"
)
// NewDiagram returns a diagram with present font and padding values.
//
// TODO: size and padding affects eg. records, but is related to the
// styling
func NewDiagram() *Diagram {
return &Diagram{
Style: draw.NewStyle(... |
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"regexp"
"strings"
"github.com/Masterminds/semver/v3"
)
type Module struct {
Name string
FromVersion *semver.Version
ToVersion *semver.Version
PatchUpgrade bool
MinorUpgrade bool
}
type HTTPClient interface {
Do(req *http.Requ... |
package eth
import (
"context"
"fmt"
"math/big"
"sync"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
"go.uber.org/atomic"
"go.uber.org/multierr"
"github.com/DCMMC/chainlink/core/logger"... |
// Package circuit 实现了 Circuit-breaker pattern.
package circuit
import (
"math/rand"
"sync/atomic"
"time"
"sync"
)
// Breaker ...
type Breaker struct {
option *Options
bucket *Bucket
TripperTime int64 // 上次tripper时间
HalfopenFail int64 // 上次halfopen时失败次数
consecFailures int64 // 连续错误次数
... |
// Copyright (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (... |
package backend
import (
"encoding/json"
"fmt"
"net/http/cookiejar"
"net/url"
"strconv"
"time"
"github.com/tstromberg/campwiz/pkg/cache"
"github.com/tstromberg/campwiz/pkg/campwiz"
"k8s.io/klog/v2"
)
// RAmerica handles RAmerica queries
type RAmerica struct {
store cache.Store
jar *cookiejar.Jar
}
// N... |
package metricCollector
import (
"sync"
"time"
)
// Registry is the default metricCollectorRegistry that circuits will use to
// collect statistics about the health of the circuit.
var Registry = metricCollectorRegistry{
lock: &sync.RWMutex{},
registry: []func(name string) MetricCollector{
newDefaultMetricColle... |
package objects
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// RemoteSyslog is a generated struct representing the Sophos RemoteSyslog Endpoint
// GET /api/nodes/remote_syslog
type RemoteSyslog struct {
Buffer int64 `json:"buffer"`
Logs []interface{} `json:"logs"`
Status int64 `json:"statu... |
/*
Copyright (C) 2017 Verizon. 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... |
package chain
import (
"context"
"fmt"
"regexp"
"strings"
"time"
codebaseApi "github.com/epam/edp-codebase-operator/v2/pkg/apis/edp/v1alpha1"
"github.com/epam/edp-codebase-operator/v2/pkg/util"
jenkinsApi "github.com/epam/edp-jenkins-operator/v2/pkg/apis/v2/v1alpha1"
"github.com/go-logr/logr"
"github.com/pk... |
package djinn
import (
"bytes"
"html/template"
"strings"
"testing"
)
var m1 map[string]string = map[string]string{
"vars.html": `<title>{{.Title}}</title> Key={{ .Data.Key }}`,
"Folder/Main-file_name.html.dji": tplMain,
"sub1.html": tplSub1,
"sub2.html": ... |
package game
import (
"github.com/oakmound/oak/collision"
"github.com/oakmound/oak/entities"
"github.com/oakmound/oak/event"
"github.com/oakmound/oak/physics"
"github.com/oakmound/oak/render"
)
type Entity struct {
entities.Interactive
physics.Mass
Dir physics.Vector
speedMax float... |
// Copyright 2015 <NAME>. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package stack
import (
"reflect"
"sort"
)
// Similarity is the level at which two call lines arguments must match to be
// considered similar enough ... |
// Copyright 2015 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 gl
import "unsafe"
type call struct {
args fnargs
parg unsafe.Pointer
blocking bool
}
type fnargs struct {
fn glfn
a0 uintptr
a1 uint... |
package main
import (
"fmt"
"net/http"
"os"
"strings"
"github.com/gorilla/pat"
"github.com/markbates/goth"
"github.com/markbates/goth/gothic"
"github.com/markbates/goth/providers/bitbucket"
"github.com/markbates/goth/providers/github"
"github.com/markbates/goth/providers/gitlab"
)
var (
host = "localhost:... |
/*
This file was converted from C++ to Go. The following is the original author's
file comment:
Performs 'discrete online rectangle packing into a rectangular bin' by
maintaining a binary tree of used and free rectangles of the bin. There are
several variants of bin packing problems, and this packer is characterized b... |
package integration
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io"
"os"
"os/exec"
"strings"
"sync"
"testing"
)
type KafkaCluster struct {
// cluster size == number of kafka nodes
size int
kafkaDockerDir string
verbose bool
mu sync.Mutex
containers []*Container
}
type Co... |
package dialogs
import (
"strings"
"github.com/containers/podman-tui/ui/utils"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
"github.com/rs/zerolog/log"
)
// ConfirmDialog is a simple confirmation dialog primitive
type ConfirmDialog struct {
*tview.Box
layout *tview.Flex
textview *tview.T... |
/*
Copyright © 2020 <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 writing, softw... |
package hls
import (
"context"
"io"
"strconv"
"time"
"github.com/aler9/gortsplib"
"github.com/asticode/go-astits"
"github.com/aler9/rtsp-simple-server/internal/aac"
"github.com/aler9/rtsp-simple-server/internal/h264"
)
type tsFile struct {
videoTrack *gortsplib.Track
name string
buf... |
package controller
import (
"context"
"fmt"
"net/url"
"strings"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/apimachinery/pkg/types"
gyaml "github.com/ghodss/yaml"
"github.com/pomerium/pomerium-operator/internal/configmanager"
yaml "gopkg.in/yaml.v2"
corev1 "k8s.io/api/core/v1"
pomeriumconfig "github.... |
package schedules
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"os/user"
"path/filepath"
"time"
"github.com/spf13/viper"
"github.com/ubiquitous-signage/hamster/multiLanguageString"
"github.com/ubiquitous-signage/hamster/panel"
"github.com/ubiquitous-signage/hamster/util"
"... |
package nightfall
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"runtime/debug"
"time"
)
const (
APIURL = "https://api.nightfall.ai/"
DefaultFileUploadConcurrency = 1
DefaultRetryCount = 5
)
// Client manages communication with the Nightfall API
... |
// Copyright 2016 Attic Labs, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
package main
import (
"fmt"
"os"
"path"
"time"
"github.com/attic-labs/noms/go/config"
"github.com/attic-labs/noms/go/datas"
"github.com/attic-labs/noms/go/sp... |
package memory
import (
"bytes"
"log"
"path"
"strings"
"time"
"fmt"
bolt "github.com/coreos/bbolt"
"github.com/pkg/errors"
"github.com/tsocial/tessellate/storage/types"
)
// MakeBoltStore returns a new BoltStore for a given path.
func MakeBoltStore(bucket, path string) *BoltStore {
db, err := bolt.Open(... |
/*
* Minio Cloud Storage, (C) 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*******************************************************************************
*
* Copyright 2020 SAP SE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You should have received a copy of the License along with this
* program. If... |
// 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 pkgfs
import (
"fmt"
"log"
"path/filepath"
"strings"
"thinfs/fs"
"time"
"fuchsia.googlesource.com/pmd/allowlist"
)
type packagesRoot stru... |
// Copyright © 2018 <NAME> <EMAIL ADDRESS>
//
// 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 recorder
import (
"bytes"
"encoding/binary"
"os"
"time"
"github.com/exoscale/vncproxy/common"
"github.com/exoscale/vncproxy/logger"
"github.com/exoscale/vncproxy/server"
)
type Recorder struct {
RBSFileName string
writer *os.File
startTime int
buffer byt... |
// Copyright 2015 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
package quic
import (
"bytes"
"context"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
"math/big"
"net"
"time"
quicGo "github.com/lucas-clemente/quic-go"
"github.com/yomorun/yomo/logger"
)
type quicGoServer struct {
handler Server... |
package main
import (
"flag"
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"os"
"os/exec"
_path "path"
"strings"
"time"
)
const (
indexFile = "index.html"
rootDir = "repo"
)
var (
pullInterval = flag.Duration("pullInterval", 15*time.Minute, "Interval git repos are pulled at.")
)
// Turns https://git... |
package main
import (
"fmt"
"log"
"strconv"
"time"
"github.com/FrankLeeC/Aurora/orm"
_ "github.com/go-sql-driver/mysql"
)
type Test struct {
Fa int `column:"A"`
Fb string `column:"B"`
Fc time.Time `column:"C"`
}
func init() {
orm.SHOWSQL = true
// err := orm.RegisterDataSource("default", "root:... |
package log
import (
"bufio"
"bytes"
"fmt"
"io"
"time"
"github.com/gin-gonic/gin"
)
type bufferedWriter struct {
gin.ResponseWriter
out *bufio.Writer
Buffer bytes.Buffer
}
func (g *bufferedWriter) Write(data []byte) (int, error) {
g.Buffer.Write(data)
return g.out.Write(data)
}
var (
green = strin... |
package backend
import (
"encoding/base64"
"net/http"
"time"
keyManager "github.com/Bit-Nation/panthalassa/keyManager"
bpb "github.com/Bit-Nation/protobuffers"
proto "github.com/gogo/protobuf/proto"
gws "github.com/gorilla/websocket"
log "github.com/ipfs/go-log"
)
var wsTransLogger = log.Logger("ws transport... |
package ssh
import (
"fmt"
sshkeys "github.com/ScaleFT/sshkeys"
"io/ioutil"
"os"
"os/user"
"regexp"
"strings"
"github.com/blacknon/lssh/common"
"golang.org/x/crypto/ssh"
)
// Create ssh.Signer into r.AuthMap. Passwords is not get this function.
func (r *Run) createAuthMap() {
r.AuthMap = map[AuthKey][]ssh.... |
package querydigest
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"strconv"
"strings"
"unsafe"
"github.com/stuartcarnie/go-simd/unicode/utf8"
"github.com/akito0107/querydigest/internal/dart"
)
type SlowQueryScanner struct {
reader *bufio.Reader
line string
currentInfo SlowQueryInfo
err ... |
//: Copyright Verizon Media
//: Licensed under the terms of the Apache 2.0 License. See LICENSE file in the project root for terms.
package influxdb
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"strings"
"time"
influxdb2 "github.com/influxdata/influxdb-client-go/v2"
"github.com/influxdata/influ... |
package main
import (
"log"
"strings"
"sync"
"time"
"github.com/0x19/goesl"
)
// All 3 of the below functions are run within goroutines (in parallel) from main()
// Just act as a /dev/null event channel receiver.
func nullEventChannelReceiver(wg *sync.WaitGroup, event_channel <-chan struct{}) {
defer wg.Done(... |
package main
import (
"bytes"
"context"
"encoding/json"
"net"
"net/http"
"strings"
"github.com/casbin/casbin/v2"
"github.com/casbin/casbin/v2/model"
"github.com/casbin/casbin/v2/persist"
)
var accessControlPrefix = []byte("/access/")
var accessControlModelPrefix = []byte("/access/model")
type accessAllowed... |
package traefik_plugin_rawdata
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/url"
"strings"
"time"
"github.com/traefik/genconf/dynamic"
)
// Config the plugin configuration.
type Config struct {
PollInterval string `json:"pollInterval,omitempty"`
Endpoint string `json:"endpo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.