text stringlengths 3.08k 10.4k |
|---|
package client
import (
"compress/gzip"
"compress/zlib"
"errors"
"github.com/dsnet/compress/brotli"
"io"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"strings"
"sync"
"time"
"github.com/mono83/tame"
"github.com/mono83/xray"
"github.com/mono83/xray/args"
)
// Client represents new HTTP user session
typ... |
/*
Copyright (c) 2019 Red Hat, 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... |
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
// Copyright (c) 2013-2014 Conformal Systems LLC.
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package rdddb
import (
"errors"
"github.com/reddcoin-project/rddutil"
"github.com/reddcoin-project/rddwire"
)
// Errors that the various database functions may retu... |
// 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 applicable... |
package queue
import (
"context"
"fmt"
"sync"
"time"
"github.com/mylxsw/asteria/log"
"github.com/mylxsw/container"
"github.com/mylxsw/sync/collector"
"github.com/mylxsw/sync/queue/job"
"github.com/mylxsw/sync/rpc"
"github.com/mylxsw/sync/storage"
"github.com/mylxsw/sync/utils"
)
// SyncQueue 任务同步队列接口
type... |
package main
/*
typedef struct MLibGRPC_BrowseItem {
char *name;
char *uri;
char *image_uri;
int folder;
} MLibGRPC_BrowseItem;
typedef struct MLibGRPC_BrowseItems {
MLibGRPC_BrowseItem **items;
int count;
} MLibGRPC_BrowseItems;
typedef struct MLibGRPC_MediaItems {
char **items;
int count;
} MLibGRPC_MediaI... |
// Copyright Splunk, 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 wri... |
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
log "github.com/sirupsen/logrus"
cnabdriver "github.com/cnabio/cnab-go/driver"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
"github.com/spf13/cobra"
"github.com/deislabs/cnab-azure-driver... |
package main
import (
"fmt"
"os"
"runtime"
"github.com/jessevdk/go-flags"
"github.com/nsf/termbox-go"
"github.com/peco/peco"
)
var version = "v0.2.3"
func showHelp() {
const v = `
Usage: peco [options] [FILE]
Options:
-h, --help show this help message and exit
--version print the... |
package main
import (
"github.com/CharLemAznable/gokits"
)
const SonarProjectKeyHeaderName = "X-SonarQube-Project"
type MetricAppender func(string, SonarPayloadQualityGateCondition) string
type MetricValueParser func(string, string) string
type MetricColorMapper func(string) string
var SonarMetricNameArray []st... |
package x509
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/x509/pkix"
"encoding/asn1"
"errors"
"fmt"
"math/big"
"github.com/warm3snow/gmsm/sm2"
)
// pkcs8 reflects an ASN.1, PKCS#8 PrivateKey. See
// ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-8/pkcs-8v1_2.asn
// and RFC 5208.
type pkcs8 struct {
Version ... |
package config
import (
"log"
"os"
"path"
"strconv"
"github.com/spf13/viper"
)
type Config struct {
Storage ConfigStorage `json:"storage" mapstructure:"storage"`
Database ConfigDatabase `json:"database" mapstructure:"database"`
HTTP ConfigHTTP `json:"http" mapstructure:"http"`
SMTP C... |
package pubsub
import (
"context"
"github.com/ischenkx/swirl/internal/pubsub/changelog"
"github.com/ischenkx/swirl/internal/pubsub/common"
"github.com/ischenkx/swirl/internal/pubsub/engine"
"github.com/ischenkx/swirl/internal/pubsub/message"
"github.com/ischenkx/swirl/internal/pubsub/protocol"
"github.com/ische... |
// Copyright 2020-2021 Buf Technologies, 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... |
package crypto
import (
"bytes"
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"github.com/dashevo/dashd-go/btcjson"
"github.com/tendermint/tendermint/internal/jsontypes"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
)
const (
// HashSize is the size in bytes of an AddressHash.
HashSize = sha256.S... |
package admins
import (
"fmt"
"html/template"
"net/http"
"strconv"
"github.com/bokwoon95/nusskylabx/app/skylab"
"github.com/bokwoon95/nusskylabx/helpers/dbutil"
"github.com/bokwoon95/nusskylabx/helpers/flash"
"github.com/bokwoon95/nusskylabx/helpers/formutil"
"github.com/bokwoon95/nusskylabx/helpers/urlpara... |
/*
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... |
/*
Copyright 2016 The Rook Authors. 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 ... |
package command
import (
"encoding/base64"
"github.com/caos/zitadel/internal/crypto"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/repository/user"
)
func writeModelToHuman(wm *HumanWriteModel) *domain.Human {
human := &domain.Human{
ObjectRoot: writeModelToObjectRoot(wm.WriteMod... |
package v1
import (
"github.com/jenkins-x/jx-api/v4/pkg/util"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// SourceRepository is the metadata for an Application/Project/SourceRepository
type SourceReposi... |
package main
import (
"log/syslog"
"net"
"os"
"path"
"strings"
"github.com/apex/log"
"github.com/apex/log/handlers/multi"
"github.com/apex/log/handlers/text"
"github.com/codegangsta/cli"
"github.com/moul/ssh2docker"
"github.com/moul/ssh2docker/pkg/sysloghandler"
)
var VERSION string
// Default key to eas... |
// Code generated by counterfeiter. DO NOT EDIT.
// with command: counterfeiter -p -o /Users/pivotal/workspace/diego-release/src/code.cloudfoundry.org/goshims/grpcshim google.golang.org/grpc
package grpcshim
import (
"net"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
... |
package main
import (
"crypto/rand"
"crypto/rsa"
"encoding/asn1"
"encoding/pem"
"errors"
"math/big"
"os"
)
func main() {
message := []byte("MODULUS")
message_p := []byte("PRIME Pea")
pb := make([]byte, 32)
pb[0] = 0x80
for i, c := range message {
pb[i] |= c >> 7
pb[i+1] |= c << 1
}
copy(pb[len(messa... |
/*
* Copyright (C) 2022 IBM, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
/*
* Copyright 2021 LimeChain 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 applicable law or agreed ... |
// Copyright © 2017 The Kubicorn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
package equinix
import (
"context"
"fmt"
"github.com/equinix/ne-go"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)
var networkDevicePlatformSchemaNames = map[string]string{
"Dev... |
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obta... |
/*
Copyright (c) 2021 Intel Corporation
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, distribut... |
package cube
import (
"log"
"time"
)
type Partition interface{}
type PartitionedCube struct {
partitioner func(d Dimensions) Partition
cubes map[Partition]Cuber
}
func NewPartitionedCube(partitioner func(Dimensions) Partition) *PartitionedCube {
return &PartitionedCube{partitioner, make(map[Partition]Cub... |
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"path"
"path/filepath"
"runtime"
"strings"
"rsc.io/c2go/cc"
)
type Config struct {
pkgRules ... |
package i3bargo
import (
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"text/template"
yaml "gopkg.in/yaml.v2"
)
const (
DEFAULT_BAR_Interval = 2
DEFAULT_BAR_Battery = 0
DEFAULT_BAR_Date_format = "2006-01-02 15:04:05" // Following format: Mon Jan 2 15:0... |
//------------------------------------------------------------------------------
// the structure with which
//------------------------------------------------------------------------------
package main
import (
"encoding/json"
"fmt"
"reflect"
"strings"
)
// the "path" is the complete name for a property or a su... |
package models_test
import (
"github.com/aclindsa/moneygo/internal/models"
"testing"
)
func expectedPrecision(t *testing.T, amount *models.Amount, precision uint64) {
t.Helper()
if amount.Precision() != precision {
t.Errorf("Expected precision %d for %s, found %d", precision, amount.String(), amount.Precision()... |
package mka
import (
"context"
"errors"
"sync"
"sync/atomic"
"time"
"github.com/gammazero/workerpool"
"github.com/segmentio/kafka-go"
"go.uber.org/multierr"
)
// Reader 代表一个支持多Kafka集群的reader.
// 它会从多个kafka集群同时读取消息.
type Reader struct {
configs []kafka.ReaderConfig
idx uint64
n int
readers []*k... |
package core
import (
"fmt"
"os"
"strings"
"time"
"github.com/APTrust/dart-runner/bagit"
"github.com/APTrust/dart-runner/constants"
"github.com/APTrust/dart-runner/util"
)
type Runner struct {
Job *Job
}
func RunJob(job *Job, deleteOnSuccess, printOutput bool) int {
runner := &Runner{job}
if !runner.Valid... |
package git
import (
"bufio"
"bytes"
"fmt"
"regexp"
"strings"
"time"
)
const (
logScanHead = iota + 1
logScanMerge
logScanAuthor
logScanAuthorDate
logScanCommitter
logScanCommitDate
logScanMsgTitle
logScanMsgBody
logScanDiff
)
const dateLayout = "Mon Jan 2 15:04:05 2006 -0700"
var (
ChangeIdTagPatte... |
package pct
import (
"errors"
"fmt"
"net/url"
"os"
"path/filepath"
"strings"
"github.com/puppetlabs/pdkgo/internal/pkg/gzip"
"github.com/puppetlabs/pdkgo/internal/pkg/httpclient"
"github.com/puppetlabs/pdkgo/internal/pkg/tar"
"github.com/rs/zerolog/log"
"github.com/spf13/afero"
"gopkg.in/yaml.v2"
)
type ... |
// Copyright © 2017 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: BSD-2-Clause
package vds
import (
"fmt"
"path"
"strings"
"github.com/gocql/gocql"
"github.com/vmware/virtual-security-module/config"
"github.com/vmware/virtual-security-module/util"
"log"
)
const (
cassandraDSType = "Cassa... |
package github
import (
"context"
"fmt"
"net/http"
"net/url"
"strconv"
"strings"
"github.com/google/go-github/v28/github"
"github.com/google/uuid"
v1 "github.com/rancher/gitjob/pkg/apis/gitjob.cattle.io/v1"
v1controller "github.com/rancher/gitjob/pkg/generated/controllers/gitjob.cattle.io/v1"
"github.com/r... |
// Copyright 2017 Pilosa Corp.
//
// 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 core
import (
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"reflect"
"strings"
"sync"
)
// GetLanguage returns the language of the request
func GetLanguage(c *gin.Context) *Language {
langCookie, err := c.Cookie("language")
if err != nil || langCookie == "" {
return GetDefaultLanguage()
}
var ... |
package client
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"strconv"
"strings"
"github.com/evergreen-ci/evergreen"
"github.com/evergreen-ci/utility"
"github.com/jpillora/backoff"
"github.com/mongodb/grip"
"github.com/mongodb/grip/message"
"github.com/pkg/errors"
)
// r... |
// Copyright 2019, 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... |
/*
* MIT License
*
* Copyright (c) 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, ... |
package sink_test
import (
"context"
"fmt"
"net"
"net/http"
"testing"
"time"
"github.com/newrelic/infra-integrations-sdk/log"
"github.com/sethgrid/pester"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/newrelic/nri-kubernetes/v2/src/sink"
)
func Test_http_Sink_crea... |
// Scry Info. All rights reserved.
// license that can be found in the license file.
package dot
import (
"reflect"
)
//Injecter inject interface
type Injecter interface {
//Inject inject
//obj only support structure
//dot.TagDot (dot) tag is in the field
//If tag is empty, then input with field type, otherwis... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package steamEconomy
import (
"github.com/0x1a0b/hooked/config"
"github.com/0x1a0b/hooked/discordSender"
"github.com/PuerkitoBio/goquery"
"github.com/go-resty/resty/v2"
"github.com/sirupsen/logrus"
"gopkg.in/d4l3k/messagediff.v1"
"net/http"
"regexp"
"strconv"
"time"
)
const (
SteamApiEconomyBase = "https:/... |
/*
The MIT License (MIT)
Copyright (c) 2019 GOSRS(gosrs)
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 main
import (
"fmt"
"net"
"strconv"
"strings"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
api "github.com/osrg/gobgp/v3/api"
log "github.com/sirupsen/logrus"
)
// IPNet is a extension of net.IPNet with some addons
type IPNet net.IPNet
func (i IPNet) String() string {
... |
// Copyright 2019 The LUCI 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 phase0
import (
"github.com/protolambda/zrnt/eth2/beacon/common"
"github.com/protolambda/ztyp/codec"
"github.com/protolambda/ztyp/tree"
. "github.com/protolambda/ztyp/view"
)
// HistoricalBatchRoots stores roots: a batch of state or block roots.
// It represents a Vector[Root, SLOTS_PER_HISTORICAL_ROOT]
t... |
package deploy
import (
"errors"
"fmt"
"github.com/viant/endly"
"github.com/viant/endly/model"
"github.com/viant/endly/system/exec"
"github.com/viant/endly/system/storage/copy"
"github.com/viant/toolbox/url"
)
//ServiceRequest represent a deploy request
type Request struct {
Target *url.Resource `requi... |
/*
* MIT License
*
* Copyright (c) 2017 <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 iterator
import (
"strings"
"github.com/rs/zerolog/log"
"gitlab.com/browserker/browserk"
"gitlab.com/browserker/scanner/injections/injast"
"gitlab.com/browserker/scanner/injections/parsers"
)
type Injection struct {
Data *browserk.InjectionExpr
Loc browserk.InjectionLocation
}
type InjectionIterator... |
package sphinx
import (
"crypto/sha256"
"errors"
)
const (
// HashPrefixSize is the size in bytes of the keys we will be storing
// in the ReplayLog. It represents the first 20 bytes of a truncated
// sha-256 hash of a secret generated by ECDH.
HashPrefixSize = 20
)
// HashPrefix is a statically size, 20-byte ... |
package wolf
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 (
wolfgangBirthday = nook.Birthday{
Day: 25,
Mon... |
// Copyright (c) 2021 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package blockchain
import (
"errors"
"fmt"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
)
// UtxoBackendTx represents a UtxoBackend t... |
/**
* Copyright (C) 2020-2021
* All rights reserved, Designed By www.yixiang.co
* 注意:本软件为www.yixiang.co开发研制
*/
package wechat_user_service
import (
"encoding/json"
"errors"
"github.com/jinzhu/copier"
"github.com/silenceper/wechat/v2/officialaccount/user"
"gorm.io/datatypes"
"gorm.io/gorm"
"time"
"yixiang.co/g... |
/*
Copyright 2022 The Kruise 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, soft... |
package main
import (
"encoding/json"
"image"
"image/png"
"image/color"
"log"
"os"
"fmt"
// "io"
// "html"
"bytes"
// "flag"
// "fmt"
// "net/http"
// "net/http/cookiejar"
// "net/url"
// "os"
// "strings"
tf "github.com/galeone/tensorflow/tensorflow/go"
"github.com/otiai10/g... |
// 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 arc
import (
"bytes"
"context"
"strconv"
"strings"
"time"
"chromiumos/tast/common/testexec"
"chromiumos/tast/errors"
"chromiumos/tast... |
package engine_test
import (
"encoding/json"
"os"
"strings"
"testing"
"github.com/GeorgeBills/chess/engine"
. "github.com/GeorgeBills/chess/engine"
"github.com/GeorgeBills/chess/uci"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestMove_SAN(t *testing.T) {
tests := []st... |
package immutable
// Vector is an immutable vector with copy-on-write semantics.
// Modifying the vector returns a new vector instance.
// Since the vector is immutable, it is safe to use from
// multiple concurrent threads without locks or other
// synchronization.
//
// Copying the vector is cheap, but since it is a... |
package proxy
import (
"fmt"
"io"
"math/rand"
"net"
"net/http"
"net/http/httputil"
"net/url"
"sync/atomic"
"time"
"github.com/insionng/makross"
"github.com/insionng/makross/logger"
"github.com/insionng/makross/skipper"
)
// TODO: Handle TLS proxy
type (
// ProxyConfig defines the config for Proxy middl... |
package human
import (
"encoding"
"encoding/json"
"fmt"
"io"
"math"
"strconv"
yaml "gopkg.in/yaml.v3"
)
// Bytes represents a number of bytes.
//
// The type support parsing values in formats like:
//
// 42 KB
// 8Gi
// 1.5KiB
// ...
//
// Two models are supported, using factors of 1000 and factors of 1024 vi... |
package metadata
import "time"
// Time is like time.Time but records the precision
// (year, month, day, hour, minute, second or subsecond)
// of the parsed string and whether a time zone was
// specified.
//
// Certain metadata formats has limited time representations:
//
// MVHD in MP4 is unix(ish) time lacking tim... |
/*
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, softw... |
package smftool
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
)
const (
HeaderLength = 14
TrackHeaderLength = 8
)
// MsgType is channel message type
type MsgType byte
const (
// META Event
MTSequenceNumber MsgType = 0x00
MTText MsgType = 0x01
MTCopyrightNotice MsgType = 0x... |
package templates
// ServiceTemplateDockerfile template
var ServiceTemplateDockerfile = `
FROM alpine:3.9
RUN apk update && apk add --no-cache ca-certificates && apk upgrade
ARG NAME
ARG DIR
COPY ./$DIR/dist/$NAME .
RUN mv $NAME service
EXPOSE 80
ENV PORT=80
CMD "/service"
`
// ServiceTemplateMakefile template... |
package search
import (
"bytes"
"fmt"
"github.com/jtejido/golucene/core/index"
. "github.com/jtejido/golucene/core/index/model"
"github.com/jtejido/golucene/core/util"
"reflect"
)
type TermQuery struct {
*AbstractQuery
term *index.Term
docFreq int
perReaderTermState *index.TermConte... |
package kademlia
import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"github.com/ethersphere/bee/pkg/swarm"
"github.com/ethersphere/beekeeper/pkg/bee"
"github.com/ethersphere/beekeeper/pkg/beekeeper"
)
// Options represents check options
type Options struct {
Dynamic bool
}
// NewDefaultOptions returns n... |
// Copyright 2020 Carleton University Library.
// All rights reserved.
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE.txt file.
// Package api provides an HTTP client which works with the Alma API.
package api
import (
"context"
"encoding/xml"
"errors"
"fmt"
"net/ht... |
package main
import (
"flag"
"fmt"
"io"
"os"
"runtime/pprof"
"time"
"github.com/stellar/go/clients/horizonclient"
"github.com/stellar/go/keypair"
"github.com/stellar/go/txnbuild"
agentpkg "github.com/stellar/starlight/sdk/agent"
"github.com/stellar/starlight/sdk/agent/horizon"
"github.com/stellar/starligh... |
/*
Copyright 2019 Google LLC
Licensed under the Apache License, Veroute.on 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 model
import (
"bytes"
"encoding/gob"
"fmt"
"github.com/TIBCOSoftware/tgdb-client/client/goAPI/exception"
"github.com/TIBCOSoftware/tgdb-client/client/goAPI/iostream"
"github.com/TIBCOSoftware/tgdb-client/client/goAPI/types"
"reflect"
)
/**
* Copyright 2018-19 TIBCO Software Inc. All rights reserved.
... |
// Copyright (c) 2019 <NAME>
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package difficulty
import (
"math/big"
"github.com/pkt-cash/pktd/blockchain/packetcrypt/randhash/util"
"github.com/pkt-cash/pktd/blockchain/packetcrypt/pcutil"
)
func bn256() *big.Int ... |
package orm
import (
"testing"
"github.com/stretchr/testify/assert"
)
type flushEntity struct {
ORM `orm:"localCache;redisCache"`
ID uint
City string `orm:"unique=city"`
Name string `orm:"unique=name"`
NameRequired string `orm:"required"`
Age int
Uint uint... |
package main
import (
"github.com/otyg/threagile/model"
"github.com/otyg/threagile/model/confidentiality"
)
type insecureHandlingOfSensitiveData string
var RiskRule insecureHandlingOfSensitiveData
func (r insecureHandlingOfSensitiveData) Category() model.RiskCategory {
return model.RiskCategory{
Id: ... |
// Copyright (c) 2019,CAOHONGJU All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package amf
import (
"fmt"
"io"
"reflect"
"time"
)
// Amf0 类型常量
const (
TypeNumber = 0x00
TypeBoolean = 0x01
TypeString =... |
/*
Copyright 2017 <NAME>
Licensed under terms of MIT license (see LICENSE)
*/
/*
Wrapper for the Binance Exchange REST API
*/
package binance
import (
"net/http"
"fmt"
"strings"
"time"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"io/ioutil"
"bytes"
"encoding/json"
"strconv"
"errors"
)
const baseURL = ... |
package broker
import (
"bytes"
"encoding/json"
"errors"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"io"
"running_broker/internal/logger"
"strings"
)
type Broker struct {
BreakPointContinue bool `yaml:"break_point_continue" json:"break_point_continue"`
Md5Check bool `yaml:"md5_check" json:"md5_check"`
... |
// otear -> scan in Spanish
// scans the stream of messages from ssh-chat
package main
import (
"fmt"
"net/http"
"net/url"
"strings"
"time"
config "github.com/gookit/config/v2"
jcfg "github.com/gookit/config/v2/json"
flags "github.com/jessevdk/go-flags"
"github.com/pkg/errors"
lg "github.com/sirupsen/logrus... |
package templates
import (
"bytes"
_ "embed"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"rogchap.com/v8go"
"strings"
)
//go:embed js/fetch.js
var bundle string
// InjectFetch inserts the fetch polyfill into ctx. The server parameter may be non-
// nil to support relati... |
package main
import (
"bufio"
"bytes"
"encoding/binary"
"io"
"log"
"os"
"time"
"unsafe"
)
func init() {
log.SetFlags(log.Lshortfile | log.LstdFlags)
}
type Package struct {
Version [2]byte // 协议版本
Length int16 // 数据部分长度, 数据部分占用多少个字节. (除了Version, Length, 其余都是数据部分)
Timestamp int64 /... |
package impl
import (
"github.com/vitesse-ftian/dggo/vitessedata/proto/xdrive"
"github.com/buger/jsonparser"
"vitessedata/plugin"
// "io"
"strconv"
)
type JsonReader struct {
fspec *xdrive.FileSpec
ncol int
colid []int
typ []int32
collist []string
RowCnt int
jsonpath [][... |
/*
Package hint allows to define computations outside of a circuit.
Usually, it is expected that computations in circuits are performed on
variables. However, in some cases defining the computations in circuits may be
complicated or computationally expensive. By using hints, the computations are
performed outside of t... |
// 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 marchingsquares
import "github.com/hajimehoshi/ebiten"
// MeshGenerator provides struct for DrawTriangle based on the atlas from map generator
type MeshGenerator struct {
squareGrid *SquareGrid
vertecesEbiten []ebiten.Vertex
verteces []Vector2
triangles []uint16
}
// GetTriangles returns t... |
package core_test
import (
"sort"
"testing"
"simplejsondb/core"
"simplejsondb/dbio"
utils "test_utils"
)
// This is basically a copy and paste from the tests for the in memory B+Tree code
func TestUint32Index_BasicOperations(t *testing.T) {
branchCapacity := 6
leafCapacity := 4
index := createIndex(t, 30, ... |
package game
import (
"duel-masters/game/match"
"duel-masters/server"
"encoding/json"
"fmt"
"os"
"sync"
"time"
"github.com/sirupsen/logrus"
)
const (
messageBufferSize int = 100
)
var pinnedMessages = []string{}
var messages = append(make([]server.LobbyChatMessage, 0), server.LobbyChatMessage{
Username: ... |
package main
import (
"encoding/json"
"fmt"
"sort"
"strings"
"time"
"github.com/fatih/color"
"github.com/giantswarm/luigi/pkg"
"github.com/giantswarm/microerror"
)
var (
black = color.New(color.FgBlack).SprintFunc()
red = color.New(color.FgRed).SprintFunc()
green = color.New(color.FgGreen).SprintF... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"text/template"
"time"
)
var (
argGitlab = flag.String("gitlab", "https://gitlab.com", "gitlab instance URL")
argProject = flag.String("p", "", "gitlab project ID")
argToken = flag.String("token", "", "access token")
)
type... |
package main
// This file contains the main function for a semver version increment tool
// that is inteded for use where the CI/CD pipeline is storing the version number
// within a markdown file such as a CHANGELOG.md or README.md file
//
import (
"flag"
"fmt"
"os"
"path"
"strings"
"github.com/karlmutch/duat"... |
// Copyright (c) 2017 Uber Technologies, 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 a... |
package main
import (
"crypto/tls"
"encoding/json"
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"time"
"github.com/julienschmidt/httprouter"
"golang.org/x/crypto/acme/autocert"
)
var debug bool
func main() {
config, err := getConf()
if err != nil {
log.Fatalf("Unable to retrieve config options:... |
/*
Format paragraphs
*/
package frmt
import (
"strings"
"unicode"
)
// 1st arg to Fmt
const (
Left = false // left-justify only
Both = true // justify both margins
)
// 2nd arg to Fmt
type ParFmt int
const (
NoBlankLines ParFmt = iota // format everything as a single par
OneBlankLine // out... |
package dao
import (
"bytes"
"errors"
"fmt"
"reflect"
"strings"
"sync"
)
//FilterModels 用于定义前端请求与
type FilterModels interface {
OrmModels() interface{}
}
//OrderType 用于前端排序
type FilterType uint
var filterMux sync.Mutex
var filtersColumn map[string]map[string][]FilterType
const (
_ FilterType = iota
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.