text stringlengths 3.08k 10.4k |
|---|
//
// Go-FTL
//
// Copyright (C) <NAME>, 2014-2018.
//
package OriginToCustomerId
import (
"fmt"
"net/http"
"os"
"github.com/pschlump/Go-FTL/server/cfg"
"github.com/pschlump/Go-FTL/server/goftlmux"
"github.com/pschlump/Go-FTL/server/lib"
"github.com/pschlump/Go-FTL/server/mid"
JsonX "github.com/pschlump/JSON... |
package core
import (
"bytes"
"errors"
"io"
"strings"
"testing"
"github.com/open-machine/assembler/utils"
"github.com/open-machine/assembler/config"
"github.com/open-machine/assembler/helper"
)
type testInfoAssembleFile struct {
//input
lines []string
fileName string
execFileName *string
ope... |
package db
import (
"fmt"
"simple-chatroom/pkg/pb"
"simple-chatroom/pkg/util"
"strconv"
"time"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)
// Message 消息
type Message struct {
Id int64 `gorm:"not null; PRIMARY_KEY; AUTO_INCREMENT"` // 自增主键
UserId int64 // 所属类型id
Requ... |
// Copyright © 2022 Meroxa, 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 ... |
// Copyright 2016 <NAME> <<EMAIL>>. All rights reserved.
// Use of this source code is governed by a MIT license that can
// be found in the LICENSE file.
package termui
import (
"regexp"
"strings"
)
// TextBuilder is a minial interface to produce text []Cell using sepcific syntax (markdown).
type TextBuilder inte... |
package sipparser
import (
//"bytes"
//"fmt"
"unsafe"
)
type SipHeaderContact struct {
isStar bool
addr SipAddr
params SipGenericParams
}
func NewSipHeaderContact(context *ParseContext) AbnfPtr {
addr := context.allocator.Alloc(uint32(unsafe.Sizeof(SipHeaderContact{})))
if addr == ABNF_PTR_NIL {
return A... |
package writer
import (
"database/sql"
"encoding/json"
"fmt"
"sync"
"time"
"git.aqq.me/go/nanachi"
"git.aqq.me/go/app/appconf"
"git.aqq.me/go/app/applog"
"git.aqq.me/go/app/event"
"git.aqq.me/go/retrier"
"github.com/iph0/conf"
jsoniter "github.com/json-iterator/go"
"github.com/kak-tus/corrie/message"
"... |
// Package codel implements the Controlled Delay
// (https://queue.acm.org/detail.cfm?id=2209336) algorithm for
// overload detection, providing a mechanism to shed load when
// overloaded. It optimizes for latency while keeping throughput high,
// even when downstream rates dynamically change.
// It keeps latency low ... |
package main
import (
"bytes"
"encoding/base64"
"html/template"
"io"
"log"
"strings"
"sync"
"github.com/golang/freetype/truetype"
"golang.org/x/image/font"
)
type color string
var colorScheme = map[string]string{
"brightgreen": "#4c1",
"green": "#97ca00",
"yellow": "#dfb317",
"yellowgreen": ... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package workmail
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/t... |
package exchango
import (
"errors"
"fmt"
"log"
"math"
)
var (
// Tax added on every trade to ensure Bank's stability.
Tax float64 = 0.01
// Maximum allowed exchange rate change (from InitTrade price to ExecuteTrade price).
AllowChange float64 = 0.05
)
type TradeOffer struct ... |
package server
import (
"bytes"
"encoding/json"
"io"
"net/http"
"net/http/httptest"
"sync"
"testing"
"github.com/ikawaha/kagome-dict/dict"
"github.com/ikawaha/kagome/v2/tokenizer"
)
const testDictPath = "../../testdata/ipa.dict"
var (
onece sync.Once
testDict *dict.Dict
)
func loadTestDict(t *testing... |
package adder
import (
"runtime"
"sync/atomic"
)
var maxCells int
func init() {
maxCells = normalizeMaxCell(runtime.NumCPU() << 2)
}
func normalizeMaxCell(v int) int {
switch {
case v > (1 << 11):
return (1 << 11)
case v < 64:
return 64
default:
return v
}
}
type cells []atomic.Value
type cell struc... |
package crdhandler
import (
"context"
"errors"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/giantswarm/microerror"
"github.com/giantswarm/micrologger"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstruc... |
package dnstrace
import (
"fmt"
"os"
"sort"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/HdrHistogram/hdrhistogram-go"
"github.com/fatih/color"
"github.com/miekg/dns"
"github.com/olekukonko/tablewriter"
)
var (
errPrint = color.New(color.FgRed).Fprint
successPrint = color.New(color.FgGreen).... |
package job
// SPDX-License-Identifier: BSD-3-Clause
//
// Authors: <NAME> <<EMAIL>>
//
// Copyright (c) 2020, Lancaster University. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. R... |
package http
import (
"bytes"
"context"
"encoding/csv"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"reflect"
"go-common/app/admin/main/mcn/model"
"go-common/library/ecode"
"go-common/library/log"
"go-common/library/net/http/blademaster"
"go-common/library/net/http/blademaster/binding"
"go-common/librar... |
package emit
import (
"github.com/bazo-blockchain/lazo/checker/symbol"
"github.com/bazo-blockchain/lazo/generator/il"
"github.com/bazo-blockchain/lazo/generator/util"
"math/big"
)
// Label contain an unsigned int. They are used to jump to certain points within the byte code.
type Label uint
// ILAssembler create... |
// Copyright 2019 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 a... |
package models
import (
"fmt"
"strings"
"time"
"crypto/tls"
"crypto/x509"
"io/ioutil"
macaron "gopkg.in/macaron.v1"
"github.com/go-sql-driver/mysql"
"github.com/go-xorm/core"
"github.com/go-xorm/xorm"
_ "github.com/lib/pq"
"github.com/ouqiang/gocron/internal/modules/app"
"github.com/ouqiang/gocron/inte... |
package result
import (
"context"
"reflect"
proto "github.com/rgraphql/rgraphql"
)
// MaxBatchSize is the maximum size of a batch, in bytes
// 8192 minus some margin for boxing
var MaxBatchSize uint32 = 8110
// ResultMultiplexer manages multiple result trees and merges them into one connection
type ResultTreeMul... |
package packets
import (
"bytes"
"compress/zlib"
"encoding/binary"
"errors"
"io"
"net"
"time"
)
var (
ErrNegativeLength = errors.New("kyubu: packet has negative length")
ErrUnknownPacket = errors.New("kyubu: packet has unknown id")
ErrLostSync = errors.New("kyubu: lost sync on packets")
ErrNotCompre... |
package apprunner
import (
"context"
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/apprunner"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"gith... |
package main
import (
"log"
"math/rand"
"time"
"github.com/sirupsen/logrus"
"github.com/streadway/amqp"
)
// Consumer is a message queue consumer
type Consumer interface {
Deliver(do func(amqp.Delivery)) Consumer
Begin() error
End() error
}
func NewRabbitmqConsumer(qname string, open func(bool) (*amqp.Conne... |
package recursos_morse
import (
"os"
"fmt"
"log"
"bufio"
"os/exec"
"strings"
)
// Funcion que devuelve un Slice de strings con lo que ha leido del fichero
// Recive nombre del fichero
func Guardar_fichero(nombre string) string {
// Abrimos el fichero y guardamos en el descriptor_de_fichero
fd, err := os.Open(... |
// 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 health
import (
"context"
"fmt"
"github.com/google/go-cmp/cmp"
"chromiumos/tast/errors"
"chromiumos/tast/local/bundles/cros/health/pci"... |
package contcrypter
import (
"log"
"github.com/declan94/cfcryptfs/internal/tlog"
)
// IntraBlock identifies a part of a file block
type IntraBlock struct {
// BlockNo is the block numccr in the file
BlockNo uint64
// Skip is an offset into the block payload
// In forwared mode: block plaintext
// In reverse m... |
package snippet
import (
"bytes"
"encoding/json"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"text/template"
templateparse "text/template/parse"
"github.com/kataras/iris-cli/parser"
"github.com/kataras/iris-cli/utils"
)
const supportedType = "file" // ignore dirs.
// ListFiles returns a github reposit... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT License.
// This product includes software developed at Guance Cloud (https://www.guance.com/).
// Copyright 2021-present Guance, Inc.
package collector
import (
"time"
"gitlab.jiagouyun.com/cloudcare-tools/datakit"
d... |
package googledns
// Partially based on https://github.com/xenolf/lego/blob/master/providers/dns/gcloud/googlecloud.go
import (
"context"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"time"
"github.com/spf13/viper"
"golang.org/x/oauth2/google"
dns "google.golang.org/api/dns/v1"
)
// Config... |
package relay
import (
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/influx6/flux"
)
func BenchmarkRouter(t *testing.B) {
t.ResetTimer()
for i := 0; i < t.N; i++ {
router := NewRoutes("")
req, _ := http.NewRequest("GET", "http://localhost:3000/boo/bat", nil)
req2, _ := http.NewRequest("P... |
// Package jsonflag is for configuration settings. It extends Go's flag
// package, designed for cli flags, with json config files and environmental
// variables. It does not replace any part of flag.
//
// Order of precedence for set config values:
//
// 1. Command line flags. (cli Example: `--flag1=flag1Value`)
//... |
// (c) 2022 <NAME>
// This code is licensed under MIT license (see LICENSE for details)
package adaptertest
import (
"context"
"errors"
"io"
"strings"
"testing"
"time"
"github.com/elgopher/yala/logger"
"github.com/stretchr/testify/assert"
)
// Subject is configuration of logger.Adapter under test.
type Subj... |
package clickhouse_test
import (
"encoding/xml"
"fmt"
"github.com/ClickHouse/clickhouse-diagnostics/internal/collectors/clickhouse"
"github.com/ClickHouse/clickhouse-diagnostics/internal/platform"
"github.com/ClickHouse/clickhouse-diagnostics/internal/platform/config"
"github.com/ClickHouse/clickhouse-diagnostic... |
package threatstack
import (
"bytes"
"crypto/sha256"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"time"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
hawk "github.com/tent/hawk-go"
)
// A Request represents a Threat Stack API request.
type Request struct {
... |
package cluster
import (
"context"
"encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
appv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
typev1 "k8s.io/client-go/kubernetes/typed/core/v1"
// imports all auth methods for kubernetes... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/signal"
"path"
"path/filepath"
"strings"
"syscall"
"github.com/fsnotify/fsnotify"
)
func contains(s []interface{}, e string) bool {
for _, a := range s {
if a.(string) == e {
return true
}
}
return false
}
func... |
// Package invoice 电子发票
package invoice
import (
"github.com/huimingz/wechatgo/wecom"
)
const (
urlGetInfo string = "/cgi-bin/card/invoice/reimburse/getinvoiceinfo"
urlGetInfoBatch string = "/cgi-bin/card/invoice/reimburse/getinvoiceinfobatch"
urlUpdateStatus string = "/cgi-bin/card/invoice/re... |
/*-
* Copyright © 2017, <NAME> <<EMAIL>>
* All rights reserved.
*
* Use of this source code is governed by a 2-clause BSD license
* that can be found in the LICENSE file.
*/
package legacy // import "github.com/solnx/legacy"
import (
"encoding/json"
"net"
"os"
"time"
"github.com/mjolnir42/erebos"
metrics... |
package main
import (
"context"
"crypto/tls"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/rs/cors"
"golang.org/x/crypto/acme/autocert"
_ "github.com/r-cbb/cbbpoll/docs"
"github.com/r-cbb/cbbpoll/internal/app"
"github.com/r-cbb/cbbpoll/internal/auth"
"github.com/r-cbb... |
package service
import (
"fmt"
"gitea.com/ha666/sync-mysql/plugin/kafka"
"github.com/ha666/golibs"
"strings"
"gitea.com/ha666/sync-mysql/config"
_ "github.com/go-sql-driver/mysql"
"github.com/ha666/logs"
"xorm.io/xorm"
"xorm.io/xorm/schemas"
)
var (
sourceEngine *xorm.Engine //源库
... |
/*
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, Version 2.0
(the "License"); you may not use this fi... |
// TODO
// 1. Add spots data to MongoDB
// 2. Create API to return the Spot given wind and tide direction
// TODO Some examples:
// https://thenewstack.io/make-a-restful-json-api-go/
// https://medium.com/@maumribeiro/a-fullstack-epic-part-i-a-rest-api-in-go-accessing-mongo-db-608b46e969cd
// https://medium.com/@thed... |
package main
import (
"os"
"os/exec"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/log"
)
func cmdMain(w *currentWorker) *cobra.Command {
var mainCmd = &cobra.Command{
Use: "worker",
Short: "CDS Worker",
Run: mainCommandRun(w),
}
pflags := mai... |
package main
import (
"log"
"net"
"net/http"
"net/http/httputil"
"net/url"
"os"
"encoding/json"
"fmt"
"time"
"sync"
"hash/crc32"
"io"
"crypto/md5"
"encoding/hex"
)
type Client struct {
time int64
count int
}
type handle struct {
Lhost string ... |
package main
import (
"fmt"
"io"
"log"
"net/http"
"net/url"
"strings"
"github.com/labstack/echo/v4"
"github.com/lestoni/html-version"
"golang.org/x/net/html"
)
type (
FormData struct {
URL string `json:"url"`
}
Heading struct{
Type string `json:"type"`
Count int `json:"count"`
}
HtmlConten... |
/*
Copyright 2021 The Dapr 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
d... |
package resource
import (
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ecs"
)
// Project ...
type Project struct {
Name string `yaml:"name"`
Region ... |
// Copyright 2019 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 game
import (
"encoding/json"
"flag"
"strings"
"time"
msg "github.com/abdelq/lode-runner/message"
)
var tick = flag.String("tick", "250ms", "duration of game tick")
type Game struct {
room string
level *level
runner *Runner
guards map[*Guard]struct{}
ticker chan bool
broadcast c... |
package detect
import (
"encoding/json"
"fmt"
"github.com/analogj/scrutiny/collector/pkg/common"
"github.com/analogj/scrutiny/collector/pkg/config"
"github.com/analogj/scrutiny/collector/pkg/models"
"github.com/analogj/scrutiny/webapp/backend/pkg/models/collector"
"github.com/sirupsen/logrus"
"os"
"strings"
)... |
// Code generated by lark_sdk_gen. DO NOT EDIT.
package lark
import (
"context"
)
// CreateDepartment 该接口用于向通讯录中创建部门。接口只会返回应用有数据权限的字段,具体的数据权限与字段的关系请参考[应用权限](https://open.feishu.cn/document/ukTMukTMukTM/uQjN3QjL0YzN04CN2cDN)
//
// 只可在应用的通讯录权限范围内的部门下创建部门。若需要在根部门下创建子部门,则应用通讯录权限范围需要设置为“全部成员”。应用商店应用无权限调用此接口。
//
// doc: ... |
// 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 t... |
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
// Copyright © 2015, The T Authors.
// Copied from go/test/bench/go1/regexp_test.go,
// which has the following notice:
//
// Copyright 2013 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 edit
import (
"bytes"
"ma... |
// nozzle is a package for building your CloudFoundry(CF) nozzle.
// nozzle is a program which consume data from the Loggregator firehose
// (https://github.com/cloudfoundry/loggregator) and then select,
// buffer, and transform data and forward it to other applications,
// components or services.
//
// This pacakge pr... |
package rpcz_test
import (
"context"
"sync"
"testing"
"time"
should "github.com/stretchr/testify/assert"
must "github.com/stretchr/testify/require"
"github.com/golocron/rpcz"
"github.com/golocron/rpcz/internal/echo"
)
func TestServer_Full_Protobuf_0K(t *testing.T) {
testServer_full(t, "tcp", "127.0.0.1:100... |
package site
import (
"database/sql"
"fmt"
"net"
"os"
"os/user"
"runtime"
"syscall"
"time"
"github.com/garyburd/redigo/redis"
"github.com/kapmahc/fly/web"
"github.com/spf13/viper"
gin "gopkg.in/gin-gonic/gin.v1"
)
func (p *Engine) _osStatus() (gin.H, error) {
var mem runtime.MemStats
runtime.ReadMemSta... |
package votable
import (
"encoding/xml"
)
type xmlVO struct {
XMLName xml.Name `xml:"VOTABLE"`
Version string `xml:"version,attr"`
Resources []xmlResource `xml:"RESOURCE"`
Description string `xml:"DESCRIPTION,omitempty"`
Infos []xmlInfo `xml:"INFO,omitempty"`
}
type xmlRe... |
package gen
import (
"fmt"
"log"
"os"
"strings"
"github.com/samkhud/go-kit-code-generator/model"
)
type endpointsGenerator struct {
outputFile string
s model.Service
code string
}
func (eg *endpointsGenerator) run(outputPath string) {
eg.generateCode()
eg.generateFile(outputPath)
}
func cre... |
package main
import (
"bytes"
"fmt"
"sort"
"strconv"
"github.com/pkg/errors"
)
// LogFormat is the default parsing format
// Apache-Style: "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\""
// AccessLog represents the info embedded in a log line.
type AccessLog struct {
// %h
RemoteHostname strin... |
// Copyright 2019 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
package rapid
import (
"fmt"
"reflect"
"strings"
)
const tryLabel = "try"... |
package main
import (
"fmt"
"net/http"
"os"
"os/exec"
"strconv"
"sync"
"github.com/derickr/streamdeck-goui/addons"
streamdeck "github.com/magicmonkey/go-streamdeck"
"github.com/magicmonkey/go-streamdeck/buttons"
_ "github.com/magicmonkey/go-streamdeck/devices"
"github.com/rs/zerolog"
"github.com/rs/zerolo... |
package query
import (
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
"time"
"github.com/hashicorp/go-multierror"
"github.com/seventv/common/mongo"
"github.com/seventv/common/redis"
"github.com/seventv/common/structures/v3"
"github.com/seventv/common/structures/v3/aggregations"
"go.mongodb.org/m... |
package server
import (
"context"
"fmt"
"net/http"
"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/go-logr/logr"
"github.com/google/go-github/v45/github"
"go.seankhliao.com/svcrunner"
"go.seankhliao.com/svcrunner/envflag"
"golang.org/x/oauth2"
)
var defaultConfig = map[string]github.Repository{
"e... |
////////////////////////////////////////////////////////////////////////////
//
// Summit Route End Point Protection
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
/////////////////////////////////////////////////////////////////... |
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux
package spi
import (
"fmt"
"os"
"syscall"
"unsafe"
"golang.org/x/exp/io/spi/driver"
)
const (
devfs_MAGIC = 107
devfs_NRBITS = 8
... |
package types
import (
"encoding/json"
"errors"
"math/big"
"github.com/Proofsuite/amp-matching-engine/utils/math"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/sha3"
"github.com/go-ozzo/ozzo-validation"
)
// NewOrderPayload is the s... |
package chess
import (
"fmt"
"strconv"
"strings"
)
// Decodes FEN notation into a GameState. An error is returned
// if there is a parsing error. FEN notation format:
// rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
func decodeFEN(fen string) (*Position, error) {
fen = strings.TrimSpace(fen)
parts :... |
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package assistant supports interaction with Assistant service.
package assistant
import (
"context"
"path/filepath"
"chromiumos/tast/errors"
"... |
/*
* Copyright (C) 2018 The ontology Authors
* This file is part of The ontology library.
*
* The ontology is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (a... |
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... |
package lib
import (
"fmt"
"strings"
"github.com/csdjywyq/aliyun-oss-go-sdk/oss"
)
var specChineseBucketVersioning = SpecText{
synopsisText: "设置、查询bucket的versioning配置",
paramText: "bucket_url [versioning_parameter] [options]",
syntaxText: `
ossutil bucket-versioning --method put oss://bucket versioning_... |
package main
import (
"fmt"
"log"
"net/url"
"os"
"path"
"path/filepath"
"reflect"
"strings"
"github.com/sourcegraph/go-langserver/pkg/lsp"
"github.com/pkg/errors"
)
func (p *cloneProxy) cloneWorkspaceToCache(globs []string) error {
fs := &remoteFS{conn: p.client, traceID: p.sessionID.String()}
err := fs... |
package distribution
import (
"bufio"
"compress/gzip"
"fmt"
"io"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution/reference"
"github.com/docker/docker/distribution/metadata"
"github.com/docker/docker/pkg/progress"
"github.com/docker/docker/registry"
"golang.org/x/net/context"
)
// Pusher is an ... |
package reports
import (
"encoding/csv"
"fmt"
"github.com/nsip/dev-nrt/helper"
"github.com/nsip/dev-nrt/records"
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
)
//
// capture the connected graph of any
// detected codeframe issue
//
type studentresultsCodeframeIssue struct {
eor *records.Ev... |
// Copyright (c) 2019 The BFE Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
// Copyright (C) MongoDB, Inc. 2017-present.
//
// 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
package wiremessage
import (
"errors"
"fmt"
"s... |
// Copyright © 2016 Asteris, 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 ... |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package keeper
import (
"fmt"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
"github.com... |
package core
import (
"context"
"sync"
"github.com/ipfs/go-cid"
"github.com/pkg/errors"
"github.com/filecoin-project/go-filecoin/address"
"github.com/filecoin-project/go-filecoin/chain"
"github.com/filecoin-project/go-filecoin/metrics"
"github.com/filecoin-project/go-filecoin/types"
)
var mpSize = metrics.N... |
package echo
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"net/http"
"reflect"
"strconv"
"strings"
)
type (
// Binder is the interface that wraps the Bind method.
Binder interface {
Bind(interface{}, Context) error
}
binder struct{}
)
func (b *binder) Bind(i interface{}, c Context) (err erro... |
// Copyright 2020 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... |
// 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"
)
type CreateSubnetInput struct {
_ struct{} `type:"structure"`
// The Availability Zone or Local Zone for the subnet.
//
// ... |
// 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 sam implements SAM file format reading and writing. The SAM format
// is described in the SAM specification.
//
// http://samtools.github.io/hts-... |
// SPDX-License-Identifier: MIT
package loader
import (
"io/fs"
"strconv"
"time"
"github.com/issue9/localeutil"
"github.com/issue9/validation/is"
)
// Config 配置信息,用于从文件中读取
type Config struct {
Title string `yaml:"title"`
Subtitle string `yaml:"subtitle,omitempty"`
// 标题后缀分隔符,文章页面浏览器标题上会加上此后缀,如果为空,则表示不需要... |
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
package queue
import (
"runtime"
"sync"
"sync/atomic"
"time"
"github.com/tal-tech/go-zero/core/logx"
"github.com/tal-tech/go-zero/core/rescue"
"github.com/tal-tech/go-zero/core/stat"
"github.com/tal-tech/go-zero/core/threading"
"github.com/tal-tech/go-zero/core/timex"
)
const queueName = "queue"
type (
//... |
// Package hooks provides functions to invoke a directory of executable hooks,
// used to provide arbitrary handling of significant events.
package hooks
import (
"fmt"
deos "github.com/hlandau/degoutils/os"
"github.com/hlandau/xlog"
"os"
"os/exec"
"path/filepath"
"strings"
)
// Log site.
var log, Log = xlog.N... |
// 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 2016-present Datadog, Inc.
//go:build linux
// +build linux
package cgroups
import (
"path/filepa... |
// Copyright 2019 The OpenSDS Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
package cgroup
import (
"fmt"
"github.com/coroot/coroot-node-agent/common"
"github.com/coroot/coroot-node-agent/flags"
"io/ioutil"
"k8s.io/klog/v2"
"os"
"path"
"regexp"
"strings"
"time"
)
var (
cgRoot = *flags.CgroupRoot
dockerIdRegexp = regexp.MustCompile(`([a-z0-9]{64})`)
crioIdRegexp = re... |
package server
import (
"context"
"crypto/ecdsa"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"io"
mathrand "math/rand"
"net"
"net/http"
"regexp"
"time"
"github.com/alyx/x/autocert"
"golang.org/x/crypto/acme"
)
const stagingDirectoryURL = "https://acme-staging-v02.api.letsenc... |
// Copyright 2012 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 db encapsulates tsuru connection with MongoDB.
//
// The function Conn dials to MongoDB using data from the configuration file
// and returns a connec... |
package spud
import "log"
import "io/ioutil"
import "crypto/x509"
import "encoding/pem"
import "encoding/json"
import tlvCodec "github.com/chris-wood/spud/codec"
import "github.com/chris-wood/spud/tables/lpm"
import "github.com/chris-wood/spud/messages"
import "github.com/chris-wood/spud/messages/name"
import "githu... |
package main
import (
"crypto/md5"
"crypto/tls"
"flag"
"fmt"
"log"
"math/rand"
"net/http"
"net/url"
"strconv"
"strings"
"sync"
"time"
"github.com/corpix/uarand"
"golang.org/x/net/http2"
)
var (
TargetURL string
Method string
TargetsParam string
TargetPid int
TargetAid int
Targets ... |
// Copyright 2016 The etcd-operator 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... |
package main
import (
"net/http"
"io/ioutil"
"errors"
"log"
"encoding/json"
)
type ForecastInfo struct {
Time string
Temperature string
Description string
}
type WeatherInfo struct {
Error string
StationName string
Time string
WindSpeed string
WindDirection string
TopWindSpeed string
TopWindGust string... |
package center
import (
"context"
"github.com/ZhengHe-MD/agollo/v4"
"github.com/ZhengHe-MD/properties"
"github.com/opentracing/opentracing-go"
"github.com/shawnfeng/sutil/slog/slog"
"os"
"strings"
"sync"
)
const (
envApolloCluster = "APOLLO_CLUSTER"
envApolloHostPort = "APOLLO_HOST_PORT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.