text stringlengths 3.08k 10.4k |
|---|
// MIT License
// Copyright (c) 2022 <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, p... |
package text
import (
"fmt"
"io/ioutil"
"regexp"
"strconv"
"github.com/inkyblackness/hacked/ss1/resource"
)
const (
metaExpressionInterrupt = "(t)"
metaExpressionNextMessage = "(?:i([0-9a-fA-F]{2}))"
metaExpressionColorIndex = "(?:c([0-9a-fA-F]{2}))"
metaExpressionLeftDisplay = "([0-9]+)"
metaExpres... |
package jsondoc
import (
"encoding"
"encoding/json"
"fmt"
"math/big"
"net"
"reflect"
"strings"
"time"
)
var (
stringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
marshalJsonType = reflect.TypeOf((*json.Marshaler)(nil)).Elem()
marshalTextType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()... |
/*
____ _ _ _____ _ _
/ __ \ | | | | | __ \ | | | |
| | | |_ __ ___| | ___ __| | __ _ ___ _ __ | |__) | __ ___ | |_ ___ ___ ___ | |
| | | | '_ \ / _ \ | / _ ... |
// Copyright © 2016 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package mqtt
import (
"testing"
"github.com/TheThingsNetwork/ttn/core/types"
. "github.com/smartystreets/assertions"
)
func TestParseDeviceTopic(t *testing.T) {
a := New(t)
t... |
package filewatcher
import (
"context"
"fmt"
"os"
"path/filepath"
"sync"
"time"
"github.com/pkg/errors"
)
type State int
const (
Unknown State = iota
Error
Skipped
Unchanged
Changed
)
var stateNames = map[State]string{
Unknown: "unknown",
Error: "error",
Skipped: "skipped",
Unchanged: "unch... |
/*
Copyright (c) 2013 <NAME>, https://menteslibres.net/xiam
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, mod... |
// Code generated by go-swagger; DO NOT EDIT.
package rooms
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go... |
package cnet
import (
"github.com/cuckooemm/cnet/internal/buf"
"github.com/cuckooemm/cnet/internal/netpoll"
"golang.org/x/sys/unix"
"sync"
)
var (
udpPackPoll = sync.Pool{
New: func() interface{} {
return &pack{}
},
}
)
type conn struct {
fd int // file de... |
// +build ignore
/*
* Copyright 2020 The Goava 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 appl... |
package gito
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
)
type G struct {
config *Config
}
func New(config *Config) *G {
return &G{config: config}
}
func (g *G) Get(repo string) error {
// where repo will live in the PATH
fullPath := filepath.Join(g.config.active.path[0],... |
// Package binarysearchtree implemented a binary search tree structure
package binarysearchtree
import (
"fmt"
)
// BinarySearchTree represent a binary search tree structure
type BinarySearchTree struct {
root *treeNode
count int
}
// Empty to check whether tree is empty,
// return true if empty, false if not em... |
// Copyright 2014 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ht
import (
"fmt"
"io"
"strings"
"text/template"
)
// ----------------------------------------------------------------------------
// Status
// Status d... |
package main
import (
"fmt"
"github.com/golang/freetype/truetype"
"github.com/llgcode/draw2d"
"github.com/llgcode/draw2d/draw2dimg"
"github.com/racerxdl/segdsp/dsp"
"github.com/racerxdl/segdsp/dsp/fft"
"github.com/racerxdl/segdsp/tools"
"image"
"image/color"
"image/jpeg"
"io/ioutil"
"log"
"math"
"math/ra... |
// Author: <NAME> <<EMAIL>>
// Docs: https://marill.liam.sh/
// Repo: https://github.com/lrstanley/marill
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
"text/template"
"time"
"github.com/lrstanley/marill/utils"
"github.com/tdewolff/minify"
"github.com/tdewolff/minify/css"
"github.... |
// Copyright 2014 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 trace
import (
"encoding/hex"
"fmt"
"github.com/golang/glog"
uuid "github.com/satori/go.uuid"
"golang.org/x/net/context"
"io"
"math/rand"
"net/http"
"strconv"
"time"
)
var (
_ratio = float32(1 / 1024.0)
_ev chan []byte
_writer io.Writer
)
const (
_clientStart = 0
_serverSend = 1
_se... |
// 🔌 Fiber is an Express.js inspired web framework build on 🚀 Fasthttp.
// 📌 Please open an issue if you got suggestions or found a bug!
// 🖥 https://github.com/gofiber/fiber
// 🦸 Not all heroes wear capes, thank you to some amazing people
// 💖 @valyala, @dgrr, @erikdubbelboer, @savsgio, @julienschmidt
package ... |
package knative_eventing_kafka_channel
import (
"fmt"
"os"
"os/signal"
"syscall"
"testing"
"time"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
// allow client authentication against GKE clusters
_ "k8s.io/client-go/p... |
// Copyright 2021 gorse Project 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 ... |
package store
import (
"bytes"
"context"
"fmt"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"io"
"io/fs"
"math"
"path"
"strings"
"time"
)
type S3Config struct {
Endpoint string `json:"endpoint" yaml:"endpoint"`
Bucket string `json:"bucket" yaml:"bucket"`
Location st... |
package model
import (
wire "github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
linotypes "github.com/lino-network/lino/types"
"github.com/lino-network/lino/utils"
"github.com/lino-network/lino/x/account/types"
)
var (
AccountInfoSubstore = []byte{0x00}
AccountBankSubstore = []by... |
package dcmd
import (
"encoding/json"
"errors"
"fmt"
"github.com/osgochina/donkeygo/container/dvar"
"github.com/osgochina/donkeygo/text/dregex"
"github.com/osgochina/donkeygo/text/dstr"
"os"
"strings"
)
type Parser struct {
strict bool
parsedArgs []string
parsedOptions map[string]string
... |
/*
Copyright © 2021 <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, softwar... |
package memviz
import (
"fmt"
"io"
"reflect"
"strconv"
)
type nodeKey string
type nodeID int
var (
// for values that aren't addressable keep an incrementing counter instead
keyCounter int
)
const (
kTagName = "memviz"
nilKey nodeKey = "nil0"
)
type mapper struct {
writer io.Writer
nodeI... |
package controller
import (
"encoding/json"
"log"
"reflect"
"regexp"
"strconv"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/version"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/clien... |
// Copyright 2015, <NAME>, see LICENSE for details.
// Dictionary Password Validation for Go
//
// For usage and examples see: https://github.com/klauspost/password
// (or open the README.md)
//
// This library will help you import a password dictionary and will allow you
// to validate new/changed passwords against t... |
package pagehome
import (
"html/template"
"net/http"
"os"
"path/filepath"
"strings"
"github.com/dekoch/gouniversal/module/fileshare/global"
"github.com/dekoch/gouniversal/module/fileshare/lang"
"github.com/dekoch/gouniversal/module/fileshare/typefileshare"
"github.com/dekoch/gouniversal/shared/alert"
"githu... |
package torrents
import (
"errors"
"flag"
"log"
"os"
"regexp"
"strconv"
"strings"
"time"
"goirate/utils"
"github.com/PuerkitoBio/goquery"
)
const defaultProxySourceURL string = "https://proxybay.github.io/"
// Mirror represents a PirateBay mirror and its status.
type Mirror struct {
URL string `json... |
// MIT License
//
// Copyright (c) [2017-2018] [<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, mod... |
/*
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 f... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"doublequote/ent/feed"
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
)
// Feed is the model entity for the Feed schema.
type Feed struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// Name holds the value of the "name" ... |
package router
import (
"errors"
"net/http"
"sort"
linq "github.com/ahmetb/go-linq/v3"
"github.com/authfun/gauthfun/consts"
"github.com/authfun/gauthfun/database"
"github.com/authfun/gauthfun/model"
"github.com/authfun/gauthfun/schema"
service "github.com/authfun/gauthfun/service"
rbac_errors "github.com/c... |
// Copyright © 2018 <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, distribu... |
package raptor
import (
"fmt"
"io/ioutil"
"log"
"regexp"
"github.com/fasthttp/router"
"github.com/fatih/color"
"github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/fasthttputil"
)
func init() {
color.Blue(`
Version: 0.1
'########:::::'###::::'########::'########::'#######::'########::
##.... ##... |
package chicken
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
beckyBirthday = nook.Birthday{
Day: 9,
Mont... |
// Package banner provides the banner component and interactions with that component.
//
// https://github.com/material-components/material-components-web/tree/master/packages/mdc-banner
package banner
import (
"strconv"
"github.com/maxence-charriere/go-app/v9/pkg/app"
"github.com/mlctrez/goapp-mdc/pkg/autoinit"
... |
package main
import (
"context"
"encoding/json"
"flag"
"log"
"net/http"
"github.com/go-chi/chi"
"github.com/pkg/errors"
"github.com/pressly/saml"
)
var (
flagInitiatedBy = flag.String("initiated-by", "", "Either idp or sp")
flagListenAddr = flag.String("listen-addr", "127.0.0.1:1113", "Bind to address")
... |
// Copyright 2012-2014 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package fineline
import (
"fmt"
"os"
"strings"
"syscall"
"unsafe"
)
type LineReader struct {
lineReader
// console handle
h uintptr
rows int
origTerm uint32
}
var (
modkernel32 = loadDll("kernel32.dll")
procFillConsoleOutputCharacter = getSysProcAddr(modkernel32, "FillConsoleOutputCharacterW")
procGet... |
/*
Copyright (c) 2015 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... |
package loopdb
import (
"crypto/sha256"
"io/ioutil"
"os"
"reflect"
"testing"
"time"
"github.com/lightninglabs/loop/test"
"github.com/lightningnetwork/lnd/lntypes"
)
var (
senderKey = [33]byte{
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
}
receive... |
package main
import (
"context"
"log"
"strconv"
"sync"
"time"
)
import (
"pb"
"services"
"types"
"utils"
"google.golang.org/grpc/metadata"
)
// session is user state in gate, it can store user's service using state.
// it is created when user login, and removed when user logout or timeout. each
// session... |
package opc
import (
"bytes"
"reflect"
"strings"
"testing"
)
func createFakePackage(m ...string) *pkg {
parts := make(map[string]struct{}, len(m))
for _, s := range m {
parts[strings.ToUpper(s)] = struct{}{}
}
return &pkg{
parts: parts,
}
}
func Test_newPackage(t *testing.T) {
tests := []struct {
nam... |
// Copyright 2020 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 secret provides a client interface for interacting
// with the GCP Secret Management service.
package secret
import (
"context"
"fmt"
"io"
"log"... |
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
package upgrade
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"st... |
package k8srollout
import (
"context"
"fmt"
"strings"
"time"
"github.com/google/go-cmp/cmp"
v1 "k8s.io/api/core/v1"
"github.com/tilt-dev/tilt/internal/k8s"
"github.com/tilt-dev/tilt/internal/store"
"github.com/tilt-dev/tilt/pkg/apis/core/v1alpha1"
"github.com/tilt-dev/tilt/pkg/logger"
"github.com/tilt-dev... |
/*
Copyright <NAME> All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package nodepackager
import (
"archive/tar"
"bytes"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"time"
pb "github.com/hyperledger/fabric-protos-go/peer"
"github.com/jxu86/fabric-sdk-go-gm/pkg/common/logging"
... |
// Copyright 2018 Shift Devices AG
// Copyright 2020 Shift Crypto AG
//
// 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 req... |
/*
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... |
// 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 applicable law or agreed to in wri... |
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
func doLines(filename string, do func(line string) error) error {
f, err := os.Open(filename)
if err != nil {
return err
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
line := scanner.Text()
if err := do(line); err... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package stack
import (
"fmt"
"strconv"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/aws/copilot-cli/internal/pkg/addon"
"github.com/aws/copilot-cli/inte... |
// Copyright 2017 <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 widgets
import (
"image"
"image/color"
. "github.com/HankiGreed/termui/v3"
)
type Image struct {
Block
Image image.Image
Monochrome ... |
package handlers
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"strconv"
"testing"
"time"
"github.com/google/go-github/github"
"github.com/kyma-project/control-plane/components/kyma-environment-broker/common/orchestration"
"github.com/kyma-project/control-plane/components... |
// Copyright 2017 <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 (
"context"
"fmt"
tb "github.com/nsf/termbox-go"
)
/*
List of events:
mouse events:
<MouseLeft> <MouseRight> <MouseMiddle>
<MouseWh... |
package builtin
import (
"context"
"time"
"github.com/go-gorp/gorp"
"github.com/ovh/cds/engine/api/authentication"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/log"
)
var _ sdk.AuthDriver = new(AuthDriver)
// NewDriver returns a new initialized driver for builtin authentication.
func NewDriver() sdk.Auth... |
package cloudservers
import (
"time"
"github.com/chnsz/golangsdk"
"github.com/chnsz/golangsdk/pagination"
)
type cloudServerResult struct {
golangsdk.Result
}
type Flavor struct {
Disk string `json:"disk"`
Vcpus string `json:"vcpus"`
RAM string `json:"ram"`
ID string `json:"id"`
Name string `json:"n... |
// Copyright 2019 Authors of Cilium
//
// 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 ... |
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2015, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributio... |
// Copyright (c) 2021 BitMaelum Authors
//
// 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, publ... |
package model
import (
"database/sql"
"time"
"github.com/guregu/null"
"github.com/satori/go.uuid"
)
var (
_ = time.Second
_ = sql.LevelDefault
_ = null.Bool{}
_ = uuid.UUID{}
)
/*
DB Table Details
-------------------------------------
CREATE TABLE `tributes` (
`id` int(10) unsigned NOT NULL DEFAULT 0,
... |
package runner
import (
"bufio"
"errors"
"net/url"
"os"
"path/filepath"
"strings"
"github.com/projectdiscovery/fileutil"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/gologger/formatter"
"github.com/projectdiscovery/gologger/levels"
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/c... |
// 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-2020 Datadog, Inc.
// +build linux_bpf
package utils
import (
"bufio"
"fmt"
"io"
"os"
"s... |
package recommender
import (
"fmt"
"math"
"math/rand"
"sort"
"time"
vm "github.com/juandes/lol-recommendation-system/vectormath"
log "github.com/sirupsen/logrus"
)
// NeighborhoodBasedRecommender is a recommender system implemented using k-nearest neighbors
type NeighborhoodBasedRecommender struct {
data ... |
package webtail
import (
"encoding/json"
"sort"
"github.com/LeKovr/webtail/worker"
)
type messageIn struct {
Type string `json:"type"`
Channel string `json:"channel,omitempty"`
}
type messageOut struct {
Type string `json:"type"`
Channel string `json:"channel,omitempty"`
Data string `json:"data,omit... |
// Copyright (c) 2021 rookie-ninja
//
// Use of this source code is governed by an Apache-style
// license that can be found in the LICENSE file.
package build
import (
"errors"
"fmt"
"github.com/fatih/color"
"github.com/ghodss/yaml"
"github.com/rookie-ninja/rk-common/common"
"github.com/rookie-ninja/rk/common"... |
package compare
/*
#cgo LDFLAGS: -lthemis -lsoter
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <themis/themis_error.h>
#include <themis/secure_comparator.h>
static void* compare_init(void)
{
return secure_comparator_create();
}
static bool compare_destroy(void *ctx)
{
r... |
/*
Copyright 2021 The KubeVela 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, softw... |
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.14.0
// source: x.proto
package x
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
... |
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
package tiger
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
rolfBirthday = nook.Birthday{
Day: 22,
Month:... |
package kingpin
import (
"bytes"
"fmt"
"go/doc"
"io"
"strings"
)
var (
preIndent = " "
)
func formatTwoColumns(w io.Writer, indent, padding, width int, rows [][2]string) {
// Find size of first column.
s := 0
for _, row := range rows {
if c := len(row[0]); c > s && c < 20 {
s = c
}
}
indentStr :=... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"kratos-cqrs/app/logger/service/internal/data/ent/sensor"
"kratos-cqrs/app/logger/service/internal/data/ent/sensordata"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/entql"
"entgo.io/ent/schema/field"
)
// schemaGraph ... |
package main
import (
"fmt"
"net"
"os"
"os/exec"
"os/signal"
"syscall"
"time"
"github.com/patrickmn/go-cache"
"github.com/spf13/cobra"
"github.com/housepower/ckman/config"
"github.com/housepower/ckman/log"
"github.com/housepower/ckman/server"
"github.com/housepower/ckman/service/clickhouse"
"github.com/... |
// -------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// -----------------------------------------------------------------... |
/*
Copyright 2015 The Camlistore 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,... |
// +build darwin
// Copyright 2021 hardcore-os Project 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 ap... |
// Code generated by go-swagger; DO NOT EDIT.
package multi_document
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "gith... |
/*
Copyright 2016 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 exec
import (
"amp/back-go/common"
"amp/back-go/protocol"
"errors"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/yddeng/dnet"
"github.com/yddeng/dnet/drpc"
"github.com/yddeng/utils/task"
"log"
"math/rand"
"net"
"time"
)
type Config struct {
Name string `json:"name"`
Inet string `j... |
/**
*
* @author liangjf
* @create on 2020/5/20
* @version 1.0
*/
package connect
import (
"errors"
"hash/crc32"
"sync"
"github.com/liangjfblue/gpusher/common/logger/log"
"github.com/liangjfblue/gpusher/gateway/common"
"github.com/liangjfblue/gpusher/gateway/config"
)
var (
ErrChannelBucketChannelNotExis... |
// Copyright © 2018 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
package app
import (
"bytes"
"io/ioutil"
"net/http"
"path/filepath"
"strings"
"testing"
"text/template"
"github.com/acarl005/stripansi"
"github.com/cashapp/hermit/cache"
"github.com/cashapp/hermit/hermittest"
"github.com/cashapp/hermit/ui"
"github.com/stretchr/testify/require"
)
func TestLogs(t *testing.... |
package api
import (
"encoding/json"
"errors"
"github.com/DisgoOrg/restclient"
)
// InteractionType is the type of Interaction
type InteractionType int
// Supported InteractionType(s)
const (
InteractionTypePing InteractionType = iota + 1
InteractionTypeCommand
InteractionTypeComponent
)
// InteractionRespon... |
// Copyright 2022 The ChubaoFS 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) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package reporting
import (
"strings"
"github.com/pkg/errors"
"github.com/projectdiscovery/nuclei/v2/pkg/output"
"github.com/projectdiscovery/nuclei/v2/pkg/reporting/dedupe"
"github.com/projectdiscovery/nuclei/v2/pkg/reporting/exporters/disk"
"github.com/projectdiscovery/nuclei/v2/pkg/reporting/exporters/sarif"
... |
package main
import (
"fmt"
"time"
// YOUR CODE BEGIN remove the follow packages if you don't need them
"reflect"
"sync"
// YOUR CODE END
_ "github.com/go-sql-driver/mysql"
sql "github.com/jmoiron/sqlx"
)
var (
// YOUR CODE BELOW
EvaluatorID = "18307130104" // your student id, e.g. 18307130177
Submissi... |
package schedule
import (
"sync"
"time"
com "github.com/att/deadline/common"
"github.com/att/deadline/config"
"github.com/att/deadline/dao"
"github.com/sirupsen/logrus"
)
var manager *ScheduleManager
var once sync.Once
var log *logrus.Logger
// GetManagerInstance will return the singleton of the ScheduleManag... |
package botapi
import (
"context"
"strconv"
"strings"
"github.com/go-faster/errors"
"go.uber.org/zap"
"github.com/gotd/td/telegram/message"
"github.com/gotd/td/telegram/message/entity"
"github.com/gotd/td/telegram/message/html"
"github.com/gotd/td/tg"
"github.com/gotd/botapi/internal/oas"
)
var _pollOpti... |
// Copyright (c) 2016 The HADES Authors. All rights reserved.
package main
import (
"flag"
"fmt"
"math/rand"
"net"
"strconv"
"strings"
"time"
"github.com/coreos/go-etcd/etcd"
backendetcd "github.com/ipdcode/hades/backends/etcd"
"github.com/ipdcode/hades/msg"
"github.com/ipdcode/hades/server"
"github.com... |
// Copyright (c) 2018 <NAME> <<EMAIL>>. All rights reserved.
//
// Use of this source code is governed by a BSD 3-Clause license that can be
// found in the LICENSE file.
package golden
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"testing"
)
// match represents a matching tes... |
// Code generated by gotemplate. DO NOT EDIT.
// Copyright (c) 2015, <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package treemap implements a map backed by red-black Tree.
//
// Elements are ordered by key in the map.
//
// St... |
package main
import (
"flag"
"log"
"net/http"
"time"
"github.com/felixge/godrone"
"github.com/gorilla/websocket"
)
var verbose = flag.Int("verbose", 0, "verbosity: 1=some 2=lots")
var addr = flag.String("addr", ":80", "Address to listen on (default is \":80\")")
var dummy = flag.Bool("dummy", false, "Dummy dro... |
package data
import (
"context"
"sort"
"go-common/app/interface/main/creative/model/data"
"go-common/app/interface/main/creative/model/medal"
account "go-common/app/service/main/account/model"
"go-common/library/log"
"go-common/library/sync/errgroup"
)
var (
rankKeys = []string{data.PlayDuration, data.VideoA... |
// Copyright 2015 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 Amazon.com Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.