text stringlengths 3.08k 10.4k |
|---|
// Copyright © 2019 Oxford Nanopore Technologies.
//
// 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, m... |
package skl
import (
"reflect"
"strings"
"testing"
"github.com/eliquious/lexer"
)
// Ensure the scanner can scan tokens correctly.
func TestScanner_Scan(t *testing.T) {
var tests = []struct {
s string
tok lexer.Token
lit string
pos lexer.Pos
}{
// Types
{s: `STRING`, tok: STRING},
{s: `UINT8`,... |
package config
import (
"fmt"
"os"
"reflect"
"strconv"
"time"
)
// Set the default values on the config from the tags. This is one of the tag handlers
// specifically implemented to learn the reflect library. Note that a Config pointer
// needs to be passed to this function so that the config is editable and f.C... |
package exec
import (
"context"
"encoding/json"
"fmt"
"os/exec"
"strings"
"time"
"github.com/ykorzikowski/checkup/types"
)
// Type should match the package name
const Type = "exec"
// Checker implements a Checker by running programs with os.Exec.
type Checker struct {
// Name is the name of the endpoint.
N... |
package controllers
import (
"context"
"fmt"
"testing"
"time"
testinghelper "github.com/open-cluster-management/cluster-proxy-addon/pkg/helpers/testing"
"open-cluster-management.io/registration-operator/pkg/certrotation"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimach... |
package gitea
import (
"context"
"fmt"
"net/url"
"strings"
"code.gitea.io/sdk/gitea"
"github.com/jenkins-x/go-scm/scm"
)
type releaseService struct {
client *wrapper
}
func (s *releaseService) Find(ctx context.Context, repo string, id int) (*scm.Release, *scm.Response, error) {
namespace, name := scm.Split(... |
package crimsonred
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"mime/multipart"
"net/http"
"net/url"
"strconv"
"github.com/crimsonred/go/v5/pnerr"
)
var emptyGetMembershipsResponse *PNGetMembershipsResponse
const getMembershipsPathV2 = "/v2/objects/%s/uuids/%s/channels"
const membershipsL... |
package gonuntius
import (
"bytes"
"errors"
"fmt"
"math/rand"
"net"
"sync"
"github.com/AndreBaltazar8/autorpc"
)
type Connection interface {
Register(appID []byte, publicID []byte, registrationKey []byte, fn func(secreyKey []byte, err error))
Authenticate(appID []byte, publicID []byte, secretKey []byte, fn ... |
package kubernetes
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/helm/monocular/chartsvc"
"github.com/labstack/echo"
log "github.com/sirupsen/logrus"
"sigs.k8s.io/yaml"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3... |
package lgtm
import (
"fmt"
"strings"
"github.com/fatedier/freebot/pkg/client"
"github.com/fatedier/freebot/pkg/event"
"github.com/fatedier/freebot/pkg/log"
"github.com/fatedier/freebot/pkg/notify"
"github.com/fatedier/freebot/plugin"
)
var (
PluginName = "lgtm"
CmdLGTM = "lgtm"
CmdUnLGTM = "unlgtm"
)
... |
// Copyright (c) 2015, <NAME> <<EMAIL>>
// See LICENSE for licensing information
// Package xurls extracts urls from plain text using regular expressions.
package xurls
import (
"regexp"
"strings"
"unicode/utf8"
)
//go:generate go run ./generate/tldsgen
//go:generate go run ./generate/schemesgen
//go:generate go ... |
package ovn
import (
"fmt"
"strings"
goovn "github.com/ebay/go-ovn"
"github.com/pkg/errors"
"github.com/submariner-io/admiral/pkg/log"
"k8s.io/klog"
)
const (
// The ovn_cluster_router submariner port connects to the submariner router
ovnClusterSubmarinerRPort = "ovn_cluster_subm_lrp"
ovnClusterSubmarinerS... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AgentStatus string
// Enum values for AgentStatus
const (
AgentStatusHealthy AgentStatus = "HEALTHY"
AgentStatusUnhealthy AgentStatus = "UNHEALTHY"
AgentStatusRunning AgentStatus = "RUNNING"
AgentStatusUnknown AgentStatus = "UNK... |
// Copyright 2018 The NuxUI Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// go:build (linux && !android)
package xlib
/*
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include <X11/ke... |
// sips ref https://github.com/google/gopacket/blob/master/layers/sip.go
package sips
import (
"bytes"
"strconv"
"strings"
)
// Here is a correspondence between long header names and short
// as defined in rfc3261 in section 20
var compactSipHeadersCorrespondence = map[string]string{
"accept-contact": "a",
... |
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"strconv"
"strings"
"sync"
"syscall"
"time"
"github.com/bookingcom/nanotube/test/stats"
)
func parsePorts(portsStr string) []int {
var ports []int
portStrs := st... |
// 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, merge, publish, distri... |
package main
import (
"errors"
"fmt"
"io"
"io/ioutil"
"time"
"strconv"
"github.com/LEW21/siren/imagectl"
)
func ReadMetadata(commands_in [][]string) (id, tag, name, version, baseName string, baseSources []string, commands [][]string, err error) {
commands = commands_in
var idCmd, fromCmd []string
done :=... |
package types
// only myposmyposchain owner can issue reserved symbol token
var reservedSymbolMap map[string]int
//nolint
var reserved = []string{
// coin market cap currency Top 200
"btc", "eth", "xrp", "bch", "usdt", "ltc", "eos", "bnb", "bsv", "xlm",
"trx", "ada", "xmr", "leo", "ht", "link", "xtz", "neo", "miot... |
// Copyright (c) 2021 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... |
// +build !release
package whitesource
import (
"fmt"
"strconv"
"time"
)
// SystemMock stores a number of WhiteSource objects and, based on that, mocks the behavior of System.
type SystemMock struct {
ProductName string
Products []Product
Projects []Project
Alerts []... |
// Copyright 2020 The Tekton 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 agree... |
// Code generated by go-swagger; DO NOT EDIT.
package intake
// 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/g... |
// Copyright (c) 2017-2020 Tigera, 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 ... |
// Copyright 2016 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 tar
// Tar takes a source and variable writers and walks 'source' writing each file
import (
"archive/tar"
"fmt"
"io"
"log"
"os"
"path/filepath"
"github.com/appvia/artefactor/pkg/util"
)
// Create a tar file from file name and array of paths and files to add
func Create(tarFn string, paths []string) e... |
package regression
import (
"archive/tar"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/alcortesm/tgz"
"gopkg.in/src-d/go-errors.v1"
"gopkg.in/src-d/go-log.v1"
)
var regRelease = regexp.MustCompile(`^v\d+\.\d+\.\d+$`)
// ErrBinaryNotFound is returned when the executable i... |
package manifest
import (
"fmt"
"github.com/onepanelio/cli/util"
"log"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
)
type Manifest struct {
path string // where the manifest directory is located
components map[string]*Component
overlays map[string]*Overlay
}
// ParamsError represents an error e... |
/*
Copyright NetFoundry, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
//********************************************************************************************************************//
//
// Copyright (C) 2018 - 2022 J&J Ideenschmiede GmbH <<EMAIL>>
//
// This file is part of gocheck24.
// All code may be used. Feel free and maybe code something better.
//
// Author: <NAME> (aka go... |
package cf
import (
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"sync"
"code.cloudfoundry.org/cfhttp"
"code.cloudfoundry.org/clock"
"code.cloudfoundry.org/lager"
"time"
)
const (
PathCfInfo = "/v2/info"
PathCfAuth ... |
package client
import (
"bufio"
"bytes"
"io"
"net"
"strings"
"testing"
"github.com/ihippik/go-imap"
)
type cmdScanner struct {
scanner *bufio.Scanner
}
func (s *cmdScanner) ScanLine() string {
s.scanner.Scan()
return s.scanner.Text()
}
func (s *cmdScanner) ScanCmd() (tag string, cmd string) {
parts := s... |
package v2
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"reflect"
"strings"
)
type Client struct {
HTTP *http.Client
Site *url.URL
Role *ApplicationRoleService
Auth *AuthenticationService
Dashboard *DashboardService
Filter *FilterSe... |
/*
Copyright (c) 2020 Loadsmart, 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, publish, distribute,... |
package streammux
import (
"bytes"
"errors"
"io"
"os"
"sync"
"sync/atomic"
"time"
)
// Handler is an interface which must be implemented by user message handlers
type Handler interface {
Handle(io.Reader) (io.Reader, error)
}
type requestSocket struct {
socket
sockID uint16
initSock bool
requestB... |
package drbuffer
import (
"fmt"
"math"
"unsafe"
)
const META_SECTION_SIZE = 16 // 4 for version 4 for nextWriteFrom 4 for lastReadTo 4 for wrapAt
const MAX_PACKETS_READ_ONE_TIME = 1024
const IS_DEBUG = false
type ringBuffer struct {
data []byte // store packets
version *uint32
nextWrit... |
package timescale
import (
"context"
"encoding/json"
"fmt"
"strconv"
"github.com/jackc/pgx"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/max-bytes/metrics-receiver/pkg/config"
"github.com/max-bytes/metrics-receiver/pkg/general"
)
var timescalePools map[string]*pgxpool.Pool
func InitConnPools(cfg []config.O... |
// Copyright 2017 GRAIL, Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package local
import (
"context"
"encoding/base64"
"encoding/json"
"io"
"strings"
"sync"
"time"
"docker.io/go-docker"
"docker.io/go-docker/api/types"
... |
// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
// Package edam handles interaction with the Evernote API, otherwise known as
// EDAM. Currently, a developer token is required to access an individual
// Evernote account. Read more at https://dev.evernote.com/doc/.
package edam
import (
"context"
"fmt"
"os"
"time"
en "github.com/dreampuf/evernote-sdk-golang/cl... |
/*
Copyright (c) 2021 - Present. Blend Labs, Inc. All rights reserved
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
*/
package db
import (
"context"
"database/sql"
"github.com/blend/go-sdk/async"
"github.com/blend/go-sdk/bufferutil"
"github.com/blend/go-sdk/ex"
"... |
package security
import (
"crypto/md5"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"errors"
"github.com/hortonworks/gohadoop/hadoop_common"
"log"
"strings"
)
func getChallengeParams(challenge string) (map[string]string, error) {
challengeParams := make(map[string]string)
splits := strings.Split(string(ch... |
// Copyright 2019 PayPal Inc.
//
// 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.... |
// Copyright Jetstack Ltd. See LICENSE for details.
package wing
import (
"fmt"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/fields"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/u... |
package elaapi
import (
"bytes"
"encoding/hex"
"fmt"
. "Elastos.ELA/common"
"Elastos.ELA/core/auxpow"
"Elastos.ELA/core/ledger"
tx "Elastos.ELA/core/transaction"
"github.com/yuin/gopher-lua"
)
const (
luaBlockdataTypeName = "blockdata"
luaBlockTypeName = "block"
)
// Registers my person type to given... |
// Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package libkbfs
import (
"fmt"
"strings"
"github.com/keybase/client/go/kbfs/tlf"
)
// PathType describes the types for different paths
type PathType string
const ... |
package zset
import (
"math/rand"
"strconv"
"testing"
)
var s *SortedSet
func init() {
s = New()
}
func TestNew(t *testing.T) {
if s == nil {
t.Failed()
}
s.Set(66, "1001", "test1")
s.Set(77, "1002", "test2")
s.Set(88, "1003", "test3")
s.Set(100, "1004", "liyiheng")
s.Set(99, "1005", "test4")
s.Set(44... |
package p2p
import (
"bytes"
"crypto/rand"
"fmt"
"net"
"reflect"
"testing"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/ecies"
"github.com/ethereum/go-ethereum/p2p/discover"
)
func TestSharedSecret(t *testing.T) {
prv0, _ := crypto.GenerateKey() // = ecdsa.Genera... |
package blockstore
import (/* Updating contact e-mail address */
"context"
"fmt"
"sync"
"time"
// TODO: app version code up
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/raulk/clock"
"go.uber.org/multierr"
)
// TimedCacheBlockstore is a blockstore that keeps blocks for at leas... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnEndpointRequest
type CreateClientVpnEnd... |
// +build !no_native_menus
package glfw
import (
"unsafe"
"github.com/ravenlab/fyne"
)
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation -framework AppKit
#include <AppKit/AppKit.h>
// Using void* as type for pointers is a workaround. See https://github.com/golang/go/issues/12065.
void a... |
package advent2018
import (
"bufio"
"bytes"
"fmt"
"io"
"regexp"
"sort"
"time"
)
type step string
func (s step) isCompleteable(completed map[step]struct{}, prerequisites []step) bool {
for _, prereq := range prerequisites {
if _, present := completed[prereq]; !present {
return false
}
}
return true
... |
package responses
import (
"strconv"
"strings"
"time"
)
// Program details
type Program struct {
Apiversion string `json:"apiVersion"`
Data struct {
Alternativeid []string `json:"alternativeId"`
Audio []struct {
Format []struct {
Inscheme string `json:"inScheme"`
Key string `jso... |
package registryclient
import (
"context"
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
ecr "github.com/awslabs/amazon-ecr-credential-helper/ecr-login"
"github.com/chrismellard/docker-credential-acr-env/pkg/credhelper"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg... |
package main
import(
"fmt"
"net"
"strings"
"encoding/json"
"net/http"
"net/rpc"
"runtime"
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/cni/pkg/version"
"github.com/containernetworking/cni/pkg/types/current"
glog "github.com/golang/glog"
utils "github.com/TCPWAV... |
package main
import (
"bytes"
"flag"
"fmt"
"os"
"path"
"path/filepath"
"github.com/benthosdev/benthos/v4/internal/bundle"
tdocs "github.com/benthosdev/benthos/v4/internal/cli/test/docs"
"github.com/benthosdev/benthos/v4/internal/component/buffer"
"github.com/benthosdev/benthos/v4/internal/component/cache"
... |
package summerfish
import (
"fmt"
"regexp"
"strings"
"unicode"
"unicode/utf8"
)
type SchemeHolder struct {
SwaggerVersion string `json:"swagger" yaml:"swagger"`
Information SchemeInformation `json:"info" yaml:"info"`
Host string `json:"host,omitempty" yaml:"host,omitempty"`
... |
package owparser
import (
"fmt"
"log"
"net/http"
"net/url"
"strconv"
"strings"
"github.com/PuerkitoBio/goquery"
"github.com/kr/pretty"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
func NewPlayerByLink(playerURL *url.URL) *Player {
return &Player{
url: *playerURL,
Heroes: map[string][]St... |
package lsp
import (
"context"
"fmt"
"runtime"
"github.com/golangq/q"
antlr "github.com/wxio/goantlr"
"github.com/wxio/tron-go/adl"
"golang.org/x/tools/lsp/protocol"
)
func qstack() {
pc := make([]uintptr, 10)
n := runtime.Callers(0, pc)
if n == 0 {
// No pcs available. Stop now.
// This can happen if ... |
// Copyright (c) 2019 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package txscript
import (
"encoding/binary"
"fmt"
)
// opcodeArrayRef is used to break initialization cycles.
var opcodeArrayRef *[256]opcode
func init() {
opcodeArrayRef... |
/*
* Copyright 2012-2019 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
package monitor
import (
"context"
"strings"
"time"
"github.com/apex/log"
globus "github.com/materials-commons/goglobus"
"gorm.io/gorm"
)
type GlobusTaskMonitor struct {
client *globus.Client
db *gorm.DB
endpointID string
finishedGlobusTasks map[string]bool
}
func Ne... |
// Copyright 2020 Nexus Operator and/or its 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 applicab... |
// Copyright (c) 2016, 2018, 2022, 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... |
package etcd
import (
"context"
"sync"
"time"
"github.com/pinealctx/neptune/ulog"
"go.etcd.io/etcd/api/v3/mvccpb"
"go.etcd.io/etcd/client/v3"
"go.uber.org/zap"
)
const (
//ChanBufferSize chan buffer size
ChanBufferSize = 10
)
type Watcher struct {
//client
cli *Client
//context control
ctx context.... |
package consensus_test
import (
"context"
"fmt"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
"github.com/filecoin-project/go-filecoin/actor"
"github.com/filecoin-project/go-filecoin/actor/builtin/account"
"github.com/filecoin-project/go-filecoin/address"
"github.com/fi... |
// Bazaar is an wrapper for cafebazaar.ir purchase API
package bazaar
import (
"encoding/json"
"errors"
"github.com/BurntSushi/toml"
"io/ioutil"
"net/http"
"regexp"
"sync"
)
type config struct {
RefreshToken string `json:"refresh_token" toml:"refresh_token"`
AccessToken string `json:"access_token" toml:"acc... |
/*
Copyright 2019 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 The go-ethereum Authors
// Copyright 2017 The cypherBFT Authors
// This file is part of the cypherBFT library.
//
// The cypherBFT 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 Foundat... |
package alpsbase
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"mime"
"mime/multipart"
"strings"
"time"
"github.com/emersion/go-message/mail"
"github.com/emersion/go-smtp"
)
func quote(r io.Reader) (string, error) {
scanner := bufio.NewScanner(r)
var builder strings.Builder
for scanner.Scan() {
bui... |
/*
Copyright 2020 The Knative 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 (
"bufio"
"fmt"
"log"
"os"
"net"
"strings"
"strconv"
"github.com/rs/xid"
)
type Session struct {
id, pass string
participants map[*net.Conn]struct{}
host *net.Conn
}
func (s *Session) Add(c *net.Conn) {
s.participants[c] = struct{}{}
}
func (s *Session) Delete(c *net.Conn) {
delete(... |
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"unicode"
"unicode/utf8"
"github.com/hexdigest/gowrap/generator"
"github.com/pkg/errors"
)
const version = "1.3"
type (
interfaceInfo struct {
Name string
Package string
OutputFile string
}
)
func main... |
package userService
import (
"errors"
"net/http"
"github.com/gorilla/securecookie"
"golang.org/x/crypto/bcrypt"
"github.com/dorajistyle/goyangi/config"
"github.com/dorajistyle/goyangi/db"
"github.com/dorajistyle/goyangi/model"
"github.com/dorajistyle/goyangi/util/log"
"github.com/dorajistyle/goyangi/util/va... |
package elicit
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
type log struct {
ctx *Context
buffer bytes.Buffer
useColour bool
outpath string
}
func (l *log) writeToConsole() {
l.useColour = true
l.fillBuffer(false)
if l.buffer.Len() > 0 {
fmt.Println(l.buffer.... |
package configstack
import (
"bytes"
"fmt"
"sort"
"strings"
"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io/terragrunt/errors"
"github.com/gruntwork-io/terragrunt/options"
"github.com/gruntwork-io/terragrunt/util"
)
// Represents a stack of Terraform modules (i.e. folders with Terraform ... |
package api
import (
"fmt"
"github.com/boltdb/bolt"
"github.com/open-horizon/anax/eventlog"
"github.com/open-horizon/anax/events"
"github.com/open-horizon/anax/exchange"
"github.com/open-horizon/anax/exchangecommon"
"github.com/open-horizon/anax/persistence"
"time"
)
func FindManagementStatusForOutput(nmpName... |
package main
import (
"errors"
"fmt"
"reflect"
"strconv"
"strings"
"github.com/mattermost/mattermost-server/v6/model"
)
// configuration captures the plugin's external configuration as exposed in the Mattermost server
// configuration, as well as values computed from the configuration. Any public fields will b... |
package expanders
import (
"context"
"encoding/json"
"fmt"
"strings"
"github.com/lawrencegripper/azbrowse/internal/pkg/interfaces"
"github.com/lawrencegripper/azbrowse/pkg/armclient"
"github.com/lawrencegripper/azbrowse/pkg/swagger"
)
var _ SwaggerAPISet = SwaggerAPISetARMResources{}
// SwaggerAPISetARMResou... |
// Copyright 2020 Insolar Network Ltd.
// All rights reserved.
// This material is licensed under the Insolar License version 1.0,
// available at https://github.com/insolar/insolar/blob/master/LICENSE.md.
package host
import (
"fmt"
"net"
"testing"
"github.com/insolar/insolar/insolar"
"github.com/insolar/insol... |
package cert
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
"net"
"os"
"os/user"
"path"
"time"
"github.com/pkg/errors"
"github.com/spoke-d/thermionic/internal/clock"
"github.com/spoke-d/thermionic/internal/fsys"
)
const defaultCertValidPeriod = 10 ... |
package middleware
import (
"fmt"
"net/http"
"strings"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/txfs19260817/scopelens/server/config"
"github.com/txfs19260817/scopelens/server/utils/response"
)
var (
TokenExpired = fmt.Errorf("Token is expired. ")
TokenNotValidYet = f... |
/*
* Copyright 2018 The CovenantSQL 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 ... |
package main
import (
"database/sql"
"encoding/json"
"fmt"
"net/http"
"os"
"os/signal"
"path/filepath"
"strings"
"github.com/ONSdigital/dp-publish-pipeline/health"
"github.com/ONSdigital/dp-publish-pipeline/kafka"
"github.com/ONSdigital/dp-publish-pipeline/utils"
"github.com/ONSdigital/go-ns/log"
_ "gith... |
package resource
import (
"encoding/json"
"errors"
"fmt"
"os"
"time"
"github.com/digitalocean/artifactory-resource/internal"
m "github.com/digitalocean/concourse-resource-library/metadata"
)
// AQL provides the version query structure
type AQL struct {
Raw string `json:"raw,omitempty"` // AQL to filter ver... |
package main
import (
"encoding/json"
"fmt"
"net/http"
"strings"
"sync"
"github.com/lxc/lxd/lxd/cluster"
"github.com/lxc/lxd/lxd/db"
"github.com/lxc/lxd/lxd/instance"
"github.com/lxc/lxd/lxd/instance/instancetype"
"github.com/lxc/lxd/lxd/node"
"github.com/lxc/lxd/lxd/operations"
"github.com/lxc/lxd/lxd/re... |
// Program hubsync pulls changes from a remote to the default branch
// of a local clone of a GitHub repository, then rebases local branches onto
// that branch if they have a corresponding remote branch.
package main
import (
"errors"
"flag"
"fmt"
"log"
"os"
"os/exec"
"strings"
"bitbucket.org/creachadair/she... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/http/httputil"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
const (
PortgRPC = 8500
PortRestAPI = 8501
)
var (
specialized = false
// fo... |
package dataloader
import (
"context"
"time"
"go.opencensus.io/trace"
)
type loaderConfig struct {
FetchFunc func(context.Context, []string) ([]interface{}, error) // FetchFunc should return resources for the provided IDs (order doesn't matter).
IDFunc func(interface{}) string /... |
/*
**
** 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
** distribute... |
/*
Copyright NetFoundry, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
package hashring
import (
"crypto/sha1"
"fmt"
"regexp"
"runtime"
"strconv"
"testing"
"time"
)
const (
node1 = "192.168.1.1"
node2 = "192.168.1.2"
node3 = "192.168.1.3"
)
func getNodesCount(nodes nodesArray) (int, int, int) {
node1Count := 0
node2Count := 0
node3Count := 0
for _, node := range nodes {
... |
package mat64
import (
"github.com/gonum/blas"
"github.com/gonum/blas/blas64"
)
var (
triDense *TriDense
_ Matrix = triDense
_ Triangular = triDense
_ RawTriangular = triDense
)
// TriDense represents an upper or lower triangular matrix in dense storage
// format.
type TriDense s... |
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"net"
"os"
"runtime"
"time"
"github.com/jessevdk/go-flags"
)
var version string
const UNKNOWN = 3
const CRITICAL = 2
const WARNING = 1
const OK = 0
type commandOpts struct {
Timeout time.Duration `long:"timeout" default:"10s" descripti... |
package main
import (
"archive/zip"
"flag"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"runtime"
"strings"
"time"
)
var (
source string
destination string
w *zip.Writer
archiveNeeded = false
)
func splitPath(path string) []string {
s := strings.Split(path, `/`) // Linux
if len(s)... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1alpha1
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a Peering for Managed AD insta... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
"github.com/open-farms/inventory/ent/category"
"github.com/open-farms/inventory/ent/implement"
"github.com/open-farms/inventory/ent/location"
)
// Implement is the model entity for the Implement sch... |
package app
import (
"yap/nlp/format/lattice"
"yap/nlp/format/raw"
// "yap/nlp/format/mapping"
"yap/nlp/parser/disambig"
nlp "yap/nlp/types"
"fmt"
"log"
"os"
"strings"
"github.com/gonuts/commander"
"github.com/gonuts/flag"
)
func GenLemmasConfigOut() {
log.Println("Configuration")
log.Printf("Paramete... |
package search
import (
"errors"
"net/http"
"io/ioutil"
"encoding/json"
"log"
"strings"
"fmt"
"sort"
sq "github.com/Masterminds/squirrel"
"github.com/devinmcgloin/clr/clr"
"github.com/fokal/fokal-core/pkg/handler"
"github.com/fokal/fokal-core/pkg/model"
"github.com/fokal/fokal-core/pkg/retrieval"
)
... |
package pkg
import (
"testing"
)
type Level3 struct {
Delta int
}
type Level2 struct {
Ypsilon int
Omega string
Epsilon *Level3
}
type Level1 struct {
Alfa float64
beta string
Gamma *Level2
Zeta map[string]float64
}
const (
SEP = "."
Alfa_name = "Alfa"
Alfa_value ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.