text stringlengths 3.08k 10.4k |
|---|
/* */
package main
type GameMap struct {
Width int
Height int
Tiles [][]*Tile
}
type Wall struct {
X int
Y int
Nei int
Dir string
}
type Feature struct {
Width int
Height int
}
type Room struct {
X int
Y int
Width int
Height int
}
const (
ROOM_TRIES = 1000
ROOMS ... |
// Copyright 2015 The Azul3D 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 amd64,!gles2 386,!gles2
package gl2
import (
"unsafe"
"github.com/slimsag/gfx"
"github.com/slimsag/gfx/internal/gl/2.0/gl"
)
// Buffer imple... |
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package https contains helpers for starting an HTTP/HTTPS server.
package https // import "golang.org/x/build/internal/https"
import (
"context"
"crypto/e... |
// Package gogo/build provides functions for building Go packages.
package build
import (
"go/build"
"os/exec"
"path/filepath"
"runtime"
"strings"
"github.com/davecheney/gogo/log"
)
// A Future represents the result of a build operation.
type Future interface {
// Result returns the result of the work as an e... |
package signature_test
import (
"bytes"
"net/http"
"net/url"
"reflect"
"testing"
"time"
"github.com/WICG/webpackage/go/bundle"
. "github.com/WICG/webpackage/go/bundle/signature"
"github.com/WICG/webpackage/go/bundle/version"
"github.com/WICG/webpackage/go/signedexchange"
"github.com/WICG/webpackage/go/sign... |
package record
import (
"encoding/binary"
"errors"
"fmt"
"os"
"strings"
"github.com/golang/protobuf/proto"
"loki/config"
"loki/crypto"
"loki/log"
pb "loki/storage"
"loki/utils"
)
// This is the basic binary header of every loki-file
//
// Magic : 4c 4f 4b 49 : 4 : "LOKI" Magic Header
// Version ... |
package internal
import (
"context"
discord "github.com/WelcomerTeam/Sandwich-Daemon/discord/structs"
structs "github.com/WelcomerTeam/Sandwich-Daemon/structs"
"github.com/savsgio/gotils/strconv"
"github.com/savsgio/gotils/strings"
"golang.org/x/xerrors"
"sync"
)
// List of handlers for gateway events.
var gat... |
// This package adds the log rotation functionality for the apps which use logrus,
// and which need to run for a long time (daemons).
package logrusrotate
import (
"fmt"
"os"
"path/filepath"
"strconv"
"time"
"github.com/sirupsen/logrus"
)
type Logrotate struct {
// only perform rotation when we're active
a... |
package sidecarserv
import (
"context"
"fmt"
"net/http"
"os"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"go.uber.org/zap"
"inspr.dev/inspr/cmd/insprd/memory/brokers"
"inspr.dev/i... |
package sink
import (
"context"
"fmt"
"log"
"time"
"github.com/olivere/elastic"
"github.com/sirupsen/logrus"
)
//InitElasticClient is a construct function for Client
func InitElasticClient(url string) (*elastic.Client, error) {
var (
err error
elasticClient *elastic.Client
)
for {
elasticCli... |
/*
* Copyright (c) 2013-2017, <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 ... |
package transip
import (
"fmt"
"log"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
"github.com/transip/gotransip/v6/repository"
"github.com/transip/gotransip/v6/vps"... |
package oauth
import (
"context"
"errors"
"net/http"
"time"
"github.com/gin-gonic/gin"
"github.com/go-oauth2/oauth2/v4"
"github.com/go-oauth2/oauth2/v4/manage"
"github.com/go-oauth2/oauth2/v4/server"
"go.uber.org/zap"
"github.com/erikbos/gatekeeper/cmd/authserver/metrics"
"github.com/erikbos/gatekeeper/pk... |
package sqlite3perf
import (
"database/sql"
"fmt"
"log"
"time"
"go.uber.org/atomic"
"github.com/spf13/pflag"
_ "github.com/go-sql-driver/mysql" // import mysql driver
_ "github.com/mattn/go-sqlite3" // import sqlite3 driver
"github.com/spf13/cobra"
)
// GenerateCmd is the struct representing generate s... |
package datatable
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/cespare/xxhash"
"github.com/datasweet/datatable/serie"
"github.com/pkg/errors"
)
// GroupBy defines the group by configuration
// Name is the name of the output column
// Type is the type of the output column
// Keyer is our main function to ... |
package news
import (
"context"
"fmt"
"io"
"net/http"
"strconv"
"strings"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/mmcdole/gofeed"
"go.uber.org/zap"
"golang.org/x/net/html"
)
const (
cbcRefreshRate = time.Minute * 10
)
// CBCFeed is a news feed provided by CBC News
type CBCFeed struct {
l... |
package main
import (
"bufio"
"encoding/xml"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
"os"
"strings"
"sync"
"syscall"
"time"
"github.org/illicitonion/matrix-rssbot/bridge"
"github.org/illicitonion/matrix-rssbot/event"
"github.org/illicitonion/matrix-rssbot/rss"
yaml "gopkg.in/ya... |
package uyuniapi
import (
"crypto/tls"
"fmt"
"github.com/kolo/xmlrpc"
"net/http"
"net/url"
"strconv"
)
type RPCClient struct {
conn *xmlrpc.Client
user string
password string
port int
host string
uri string
skipSslCheck bool
tls bool
sid st... |
// Copyright 2017 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package olive
import (
"net/http"
"reflect"
"strconv"
"strings"
"github.com/go-martini/martini"
"github.com/goji/param"
log "github.com/inconshreveable/log15"
)
func unmarshalMiddleware(decoders map[string]Decoder, inputParam interface{}) martini.Handler {
return func(r *http.Request, c martini.Context, e *e... |
package dbutils
import (
"database/sql"
"errors"
"fmt"
"io/ioutil"
"log"
FP "path/filepath"
FU "github.com/fbaube/fileutils"
L "github.com/fbaube/mlog"
SU "github.com/fbaube/stringutils"
XU "github.com/fbaube/xmlutils"
)
// NewContentityRecord works for directories and symlinks too.
// It used to SetError(... |
package kube
import (
"context"
"errors"
"fmt"
"log"
"time"
appsv1 "k8s.io/api/apps/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/... |
package cmd
import (
"fmt"
"os"
"io/ioutil"
"strconv"
"flag"
"time"
"syscall"
"strings"
"net/url"
gdn "code.cloudfoundry.org/cfdev/garden"
"code.cloudfoundry.org/cfdev/network"
"code.cloudfoundry.org/cfdev/process"
"code.cloudfoundry.org/garden"
"code.cloudfoundry.org/garden/client"
"code.cloudfoundry.o... |
package convert
import (
"crypto/md5"
"encoding/hex"
"fmt"
"sort"
"strconv"
"strings"
"time"
)
// Convert string to specify type.
type StrTo string
func (f StrTo) Exist() bool {
return string(f) != string(0x1E)
}
func (f StrTo) Uint8() (uint8, error) {
v, err := strconv.ParseUint(f.String(), 10, 8)
return... |
// Copyright 2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute... |
/*
Copyright 2018 Turbine Labs, 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, softw... |
/*
Copyright (C) 2018 Yahoo Japan Corporation Athenz team.
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 bot
import (
"context"
"errors"
"io"
"io/ioutil"
"log"
"mime"
"mime/multipart"
"net/http"
"os"
"strings"
"time"
hps "github.com/michurin/cnbot/pkg/helpers"
)
const gracefulShutdownInterval = time.Second
type Handler struct {
BotName string
Token string
AccessCtl hps.AccessCtl
}
func pa... |
package policy
import (
"encoding/json"
"fmt"
"net/url"
)
// Document ... is a generic structure that is used by UnmarshalPolicy
type Document struct {
Version string
Statement []*Statement
}
// Statement ... is a generic structure to hold an AWS policy statement
type Statement struct {
Sid string
Eff... |
// Code generated by ../../gen/docs_json. DO NOT EDIT.
package BuildablePipeline
import (
"fmt"
)
type FGBuildablePipeline struct {
Name string
ClassName string
MAllowColoring bool
MAttachmentPoints string
MBuildEffectS... |
package arango
import (
"context"
"fmt"
driver "github.com/arangodb/go-driver"
"github.com/arangodb/go-driver/vst"
arngin "github.com/sudo-suhas/play-arngin"
)
// Client implements the arngin.Engine interface using ArangoDB.
type Client struct {
db driver.Database
}
// ClientConfig is the parameters required ... |
package main
import (
"crypto/tls"
"flag"
"fmt"
"log"
"net/http"
"os"
"strconv"
kclib "code.it4i.cz/lexis/wp4/keycloak-lib"
"github.com/lexis-project/lexis-backend-services-userorg-service.git/models"
"github.com/lexis-project/lexis-backend-services-userorg-service.git/restapi"
"github.com/lexis-project/le... |
// Copyright 2012-present <NAME>. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
import (
"context"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/sahil311289/elastic.git/uritemplates"
)
// CatField... |
// Copyright 2010 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 msgplens
import (
"fmt"
"math"
"strconv"
"unicode/utf8"
)
func (j *JSONEncoder) writeJSONString(s string) {
j.buf.WriteByte('"')
start := 0
for... |
/*
Copyright 2020 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, ... |
/*
Copyright 2015 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 writing, softwa... |
package p11
import (
"fmt"
"github.com/fritzr/advent2020/util"
)
type SeatMap struct {
seats [][]byte
width int
nEmpty int
nOccupied int
nFloor int
}
const SEAT_ERROR = byte(' ')
const SEAT_FLOOR = byte('.')
const SEAT_EMPTY = byte('L')
const SEAT_OCCUPIED = byte('#')
func BCount(arr []byte, c byte) (... |
// Copyright ©2016 The gonum 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 combin
import (
"math/big"
"testing"
"github.com/gonum/floats"
)
// intSosMatch returns true if the two slices of slices are equal.
func intSo... |
package logger
import (
"fmt"
"github.com/denisbrodbeck/machineid"
"io/ioutil"
"net"
"os"
"path"
"runtime"
"runtime/debug"
"strings"
"time"
)
const (
Debug = "DEBUG"
Info = "INFO "
Warn = "WARN "
Error = "ERROR"
Fatal = "FATAL"
)
const (
loggerPathPrefix = "utils/log/logger/logger.go"
errorsFile ... |
package cmd
import (
"errors"
"io/fs"
"io/ioutil"
"os"
"path"
"github.com/operator-framework/api/pkg/manifests"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
)
var (
bundleImage string
productsInstallationPath string
productKey string
channel string
bundleDir ... |
package document_test
import (
"testing"
"github.com/asdine/genji/document"
"github.com/stretchr/testify/require"
)
func TestScan(t *testing.T) {
doc := document.NewFieldBuffer().
Add("a", document.NewBytesValue([]byte("foo"))).
Add("b", document.NewStringValue("bar")).
Add("c", document.NewBoolValue(true)... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: kafmesh/discovery/v1/sink.proto
package discoveryv1
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.In... |
/*
* Copyright 2020-2021 Huawei Technologies Co., Ltd.
*
* 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 appli... |
package main
import (
"fmt"
"github.com/go-on/router"
"github.com/go-on/sessions"
// "gopkg.in/go-on/wrap.v2-contrib-testing/wrapstesting"
"github.com/go-on/context"
// "gopkg.in/go-on/router.v2"
// "gopkg.in/go-on/router.v2/route"
"net/http"
"net/http/httptest"
"github.com/go-on/wrap"
"github.com/go-on/w... |
/*
Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
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 (
"flag"
"fmt"
"log"
"net/http"
"os"
"path/filepath"
"strings"
"github.com/kohirens/stdlib"
)
const (
PS = string(os.PathSeparator)
DIR_MODE = 0774
)
var (
appConfig = &Config{}
flagStore *flagStorage
errMsgs = [...]string{
"please specify a path (or URL) to a template",
... |
// Copyright 2021 <NAME>
// Copyright 2019 <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 applic... |
package main
import (
"container/list"
"math/rand"
"sort"
"github.com/jangler/oracles-randomizer/graph"
"github.com/jangler/oracles-randomizer/logic"
"github.com/jangler/oracles-randomizer/rom"
)
// returns true iff the node is in the list.
func nodeInList(n *graph.Node, l *list.List) bool {
for e := l.Front(... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pb/moby/filters/filters.proto
/*
Package filters is a generated protocol buffer package.
It is generated from these files:
pb/moby/filters/filters.proto
It has these top-level messages:
Args
*/
package filters
import proto "github.com/gogo/protobuf/pro... |
package bulkinsert
import (
"database/sql"
"errors"
"time"
"github.com/rs/zerolog/log"
"github.com/lib/pq"
)
type BulkInsert struct {
maxBatchSize int
maxBatchAge int
db *sql.DB
table string
firstInsertTimestamp int64
columnNames []string
values... |
package test
import (
"bytes"
"context"
"strconv"
"sync"
"time"
"github.com/oklog/ulid/v2"
"github.com/quintans/eventsourcing"
"github.com/quintans/eventsourcing/encoding"
"github.com/quintans/eventsourcing/eventid"
"github.com/quintans/eventsourcing/player"
"github.com/quintans/eventsourcing/sink"
"gith... |
/*
Copyright 2021 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, ... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package persistence
import (
"encoding/hex"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"github.com/mcc-github/blockchain/common/chaincode"
"github.com/mcc-github/blockchain/common/flogging"
"github.com/mcc-github/blockc... |
package retable
import (
"context"
"errors"
"fmt"
"reflect"
)
type Cell struct {
View View
Row int
Col int
Value reflect.Value
}
// CellFormatter is an interface for formatting reflected values as strings.
type CellFormatter interface {
// FormatCell formats a cell as string
// or returns a wrapped Er... |
package main
import (
"database/sql"
"database/sql/driver"
"errors"
"fmt"
"github.com/erikstmartin/go-testdb"
"github.com/miekg/dns"
"strings"
"testing"
)
var resolv resolver
var server *dns.Server
type resolver struct {
server string
}
func (r *resolver) lookup(host string, qtype uint16) ([]dns.RR, error)... |
package orm
// Copyright (c) 2018 Bhojpur Consulting Private Limited, India. All rights reserved.
// 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 l... |
// oidc package was originally obtained from https://github.com/maximRnback/gin-oidc/. It remains to be seen how the changes made are provided to the original package.
package oidc
import (
"context"
"crypto/rand"
"encoding/base64"
"errors"
"log"
"net/http"
"net/url"
"github.com/coreos/go-oidc/v3/oidc"
"git... |
/*
* 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 ... |
package json
import (
"go-hexagonal/internal"
"go-hexagonal/internal/domain/errormessage"
"go-hexagonal/internal/domain/language"
"log"
"strings"
jsoniter "github.com/json-iterator/go"
"github.com/valyala/fasthttp"
)
type Answer struct {
CodeToError map[language.Code]map[string]errormessage.Error
jsonStr... |
package static
import (
"bytes"
"html/template"
"io/ioutil"
"net/http"
"os"
"path"
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
)
// TemplateFS returns a http.FileSystem for embedded assets and templates. This
// filesystem wraps the `github.com/mjibson/esc` API to provide a ... |
// 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... |
// Copyright © 2022 buildah.
//
// 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://github.com/containers/buildah/blob/main/LICENSE
//
// Unless required by applicable law or a... |
package cmd
import (
"fmt"
"math"
"code.cloudfoundry.org/bytefmt"
"github.com/dmolesUC3/cos/pkg"
. "github.com/dmolesUC3/cos/internal/suite"
"github.com/spf13/cobra"
"github.com/dmolesUC3/cos/internal/logging"
)
type SuiteFlags struct {
CosFlags
Size bool
SizeMax string
Count bool
CountMax uint64... |
package stream_test
import (
"encoding/json"
"fmt"
"testing"
"github.com/genjidb/genji/document"
"github.com/genjidb/genji/internal/environment"
"github.com/genjidb/genji/internal/expr"
"github.com/genjidb/genji/internal/sql/parser"
"github.com/genjidb/genji/internal/stream"
"github.com/genjidb/genji/interna... |
package main
import ("os"
"fmt"
//"time"
//"strings"
"strconv"
"os/exec"
//"flag"
//"encoding/json"
//"io/ioutil"
)
type App_Data struct {
workers float64
days float64
holidays float64
vacations float64
maintenance float64
points float64
capacity fl... |
package service
import (
"context"
"time"
coinrpc "go-common/app/service/main/coin/api/gorpc"
memrpc "go-common/app/service/main/member/api/gorpc"
pointrpc "go-common/app/service/main/point/rpc/client"
"go-common/app/service/main/usersuit/conf"
inviteDao "go-common/app/service/main/usersuit/dao/invite"
medalD... |
package nullable_test
import (
"testing"
"github.com/Thor-x86/nullable"
"gorm.io/gorm/utils/tests"
)
func TestScanBytes(t *testing.T) {
nullableBytes := nullable.NewBytes(nil)
nullableBytes.Scan([]byte{})
tests.AssertEqual(t, nullableBytes.Get(), []byte{})
nullableBytes.Scan([]byte{0x0, 0x7f, 0xff})
tests.... |
package looli
import (
"encoding"
"encoding/json"
"encoding/xml"
"fmt"
"net/http"
"reflect"
"strconv"
)
const (
MIMEJSON = "application/json"
MIMEXML = "application/xml"
MIMEXML2 = "text/xml"
MIMEPOSTForm = "application/x-www-form-urlencoded"
MIMEMultipartP... |
package web
import (
"math"
"testing"
"github.com/google/go-cmp/cmp"
)
func testArithmeticFuncs(t *testing.T) {
cases := []struct {
name string
f func(a, b interface{}) (interface{}, error)
a interface{}
b interface{}
expect interface{}
wantErr bool
}{
{"addInt2", addFunc, in... |
// Package gpgga contains data structures and functions related to NMEA sentences
// of type "GPGGA".
package gpgga // import "gopkg.in/mab-go/nmea.v0/sentence/gpgga"
import (
"gopkg.in/mab-go/nmea.v0/sentence"
)
// GPGGA represents an NMEA sentence of type "GPGGA".
type GPGGA struct {
// FixTime is the time at whi... |
package data
import (
"errors"
"fmt"
"log"
"os"
"reflect"
"testing"
"github.com/philgal/jtl/validation"
"github.com/stretchr/testify/assert"
)
func init() {
validation.InitValidator()
}
var okCsvRecord = CsvRecord{
ID: "1",
StartedTs: "14 Apr 2020 11:30",
Comment: "Row with ID",
TimeSpent: "10... |
// Copyright 2017 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 appl... |
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// Copyright (c) 2015, <NAME> <<EMAIL>>
// See LICENSE for licensing information
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"regexp"
"strings"
"mvdan.cc/gibot/site/gitlab"
api "github.com/xanzy/go-gitlab"
)
type dscPayload struct {
Topic dscTopic `json:"topic"`
}
type dscTopic str... |
/*
* // Copyright (c) 2019 Cisco and/or its affiliates.
* //
* // 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 box2d
/// A chain shape is a free form sequence of line segments.
/// The chain has one-sided collision, with the surface normal pointing to the right of the edge.
/// This provides a counter-clockwise winding like the polygon shape.
/// Connectivity information is used to create smooth collisions.
/// @warnin... |
package producer
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
"sync"
"github.com/Shopify/sarama"
)
type Config struct {
// "The broker address can be found in https://cloud.baidu.com/doc/Kafka/QuickGuide.html#.E7.BB.BC.E8.BF.B0")
broker string
// "Required, the topic to ... |
package http
import (
"go-common/app/admin/main/workflow/service"
"go-common/library/conf/paladin"
"go-common/library/log"
bm "go-common/library/net/http/blademaster"
"go-common/library/net/http/blademaster/middleware/permit"
)
var (
authSvc *permit.Permit
wkfSvc *service.Service
)
// Init http server
func I... |
package top
import (
"strconv"
"strings"
"github.com/PuerkitoBio/goquery"
"github.com/rl404/go-malscraper/pkg/malscraper/config"
"github.com/rl404/go-malscraper/pkg/malscraper/constant"
"github.com/rl404/go-malscraper/pkg/malscraper/model/common"
model "github.com/rl404/go-malscraper/pkg/malscraper/model/top"
... |
package main
import (
"bytes"
"reflect"
"testing"
)
func TestMainOutput(t *testing.T) {
var buf bytes.Buffer
mainout = &buf
main()
expected := `a:2
b:1`
actual := buf.String()
if expected != actual {
t.Errorf(expected, actual, "Unexpected output in main()")
}
}
var lettersCases = map[string]struct {
inp... |
package cmd
import (
"archive/tar"
"compress/gzip"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/gosuri/uitable"
"github.com/pkg/errors"
"github.com/raftAtGit/hl-fabric-operator/api/v1alpha1"
corev1 "k8s.io/api/core/v1"
apiErrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.i... |
// Copyright 2016 Iron.io
//
// 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 writ... |
// Copyright (c) 2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LIC... |
package mime
import (
"errors"
"fmt"
"io"
"strings"
)
const sixtyFour = 64
var (
ErrEmpty = errors.New("empty")
ErrChar = errors.New("invalid character")
ErrDuplicate = errors.New("duplicate")
)
const unknown = "unknown"
type Mime struct {
MainType string
SubType string
Suffix string
Params ... |
/*
Copyright IBM Corp. 2016 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 wri... |
/*
*
* Copyright (c) 2016, 2017, 2018 <NAME> <<EMAIL>>.
* 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
* notic... |
package gitdiff
import (
"fmt"
"io"
"strconv"
"strings"
)
// ParseTextFragments parses text fragments until the next file header or the
// end of the stream and attaches them to the given file. It returns the number
// of fragments that were added.
func (p *parser) ParseTextFragments(f *File) (n int, err error) {... |
package iapi
import (
"context"
)
type KeyValue struct {
Key string
Value []byte
}
type LowLevelStorage interface {
//If the key does not exist, return nil value and nil err
Load(ctx context.Context, key string) (val []byte, err error)
//For both of these functions, you either have to fully consume the value ... |
// This file contains just a few generic helpers which are used by the
// other test files.
package check_test
import (
"flag"
"fmt"
"os"
"regexp"
"runtime"
"testing"
"time"
"github.com/vulcand/vulcand/Godeps/_workspace/src/gopkg.in/check.v1"
)
// We count the number of suites run at least to get a vague hi... |
package runner
import (
"bufio"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"strings"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/ipranger"
"github.com/projectdiscovery/iputil"
"github.com/projectdiscovery/naabu/v2/pkg/privileges"
"github.com/projectdiscovery/naabu/v2/pkg/scan"
"github.com... |
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// Copyright 2021 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... |
package metadata
import (
"encoding/base64"
"encoding/json"
"errors"
"strconv"
"github.com/incognitochain/incognito-chain/common"
"github.com/incognitochain/incognito-chain/dataaccessobject/statedb"
"github.com/incognitochain/incognito-chain/wallet"
)
type PortalReplacementFeeRequest struct {
MetadataBaseWit... |
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package snapshotgrpc
import (
"context"
"fmt"
"io/ioutil"
"testing"
"github.com/hyperledger/fabric-protos-go/common"
pb "github.com/hyperledger/fabric-protos-go/peer"
"github.com/hyperledger/fabric/common/configtx/test"
"gith... |
package mysql
import (
"database/sql"
"fmt"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/migrator"
"gorm.io/gorm/schema"
)
type Migrator struct {
migrator.Migrator
Dialector
}
type Column struct {
name string
nullable sql.NullString
datatype string
maxLen ... |
/*
* @Author: calm.wu
* @Date: 2019-03-22 15:36:53
* @Last Modified by: calm.wu
* @Last Modified time: 2019-03-22 16:46:03
*/
package utils
import (
"context"
"errors"
"math/rand"
"sync"
"time"
)
var ForeverTestTimeout = time.Second * 30
var NerverStop <-chan struct{} = make(chan struct{})
type Group stru... |
package kafka
import (
"context"
"fmt"
"github.com/go-logr/logr"
"github.com/pkg/errors"
"github.com/seldonio/seldon-core/executor/api"
"github.com/seldonio/seldon-core/executor/api/client"
"github.com/seldonio/seldon-core/executor/api/payload"
"github.com/seldonio/seldon-core/executor/api/rest"
v1 "github.co... |
// Copyright 2020 Red Hat, Inc. and/or its affiliates
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... |
package server
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"github.com/containerd/containerd"
"github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.