text stringlengths 3.08k 10.4k |
|---|
package dlog
import (
"flag"
"fmt"
"os"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
)
type Severity int32
type globals struct {
sync.Mutex
logLevel Severity
useSyslog *bool
appName string
syslogFacility string
systemLogger *systemLogger
fileName *string
outFd *o... |
// Copyright (c) 2013-2016 The btcsuite developers
// Copyright (c) 2015-2016 The Utopia developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package blockchain
import (
"fmt"
"github.com/UtopiaCoinOrg/ucd/chaincfg/chainhash"
"github.com/UtopiaCoinOrg/ucd/u... |
package blockchain
import (
"fmt"
"time"
"massnet.org/mass-wallet/config"
"massnet.org/mass-wallet/logging"
"massnet.org/mass-wallet/massutil"
"massnet.org/mass-wallet/wire"
)
func (chain *Blockchain) maybeAcceptBlock(block *massutil.Block, flags BehaviorFlags) error {
// Get a block node for the block previo... |
package analyzer
import (
"bufio"
"bytes"
"sort"
"strings"
"unicode"
"github.com/mdanzinger/whatsapptistics/chat"
"github.com/mdanzinger/whatsapptistics/report"
)
type analyzer struct {
parser parser
}
// Analyze analyzes a chat with a given parser
func (a *analyzer) Analyze(chat *chat.Chat) (*report.ChatAn... |
// Copyright (c) 2014-2019 <NAME>
// Licensed under the MIT license
package http
import (
"errors"
"fmt"
"strconv"
"strings"
"sync"
"time"
"github.com/etix/mirrorbits/database"
"github.com/etix/mirrorbits/filesystem"
"github.com/etix/mirrorbits/mirrors"
)
/*
Total (all files, all mirrors):
STATS_TOTAL
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: settime.proto
/*
Package pb is a generated protocol buffer package.
It is generated from these files:
settime.proto
It has these top-level messages:
SetTimeRequest
SetTimeResponse
*/
package pb
import proto "github.com/golang/protobuf/proto"
import fmt ... |
package main
import (
"bytes"
"flag"
"fmt"
"net/url"
"os"
"strings"
)
// Constant variables that represent the names of the flags that we are going to
// use in the config struct and throughout the entire program.
const (
peopleDirFlag = "peopledir"
picsDirFlag = "picsdir"
faceboxUrlFlag = "f... |
package ndp
import (
"fmt"
"net"
"sync"
"go.universe.tf/metallb/internal/iface"
"github.com/golang/glog"
"github.com/mdlayher/ndp"
)
// Announce is used to "announce" new IPs mapped to the node's MAC address.
type Announce struct {
hardwareAddr net.HardwareAddr
conn *ndp.Conn
ips map[strin... |
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package testutil provides utilities to setup testing environment for camera
// tests.
package testutil
import (
"context"
"fmt"
"chromiumos/tas... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
"strconv"
"github.com/spf13/cobra"
"github.com/ovh/cds/sdk"
)
func cmdArtifacts(w *currentWorker) *cobra.Command {
c := &cobra.Command{
Use: "artifacts",
Short: "worker artifacts [--workflow=<workflow-name>] [-... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: import_public/b.proto
package import_public // import "github.com/gogo/protobuf/protoc-gen-gogo/testdata/import_public"
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import sub "github.com/gogo/protobuf/protoc-gen-gogo/t... |
package sockjsclient
import (
"bufio"
"bytes"
"encoding/json"
"errors"
"fmt"
"net/http"
"net/http/cookiejar"
"sync"
"github.com/koding/kite/utils"
)
// the implementation of New() doesn't have any error to be returned yet it
// returns, so it's totally safe to neglect the error
var cookieJar, _ = cookiejar.... |
/*
Copyright 2019 The Vitess 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 dbtypes
import (
"bytes"
"encoding/hex"
"fmt"
"github.com/HcashOrg/hcexplorer/txhelpers"
"github.com/HcashOrg/hcd/blockchain/stake"
"github.com/HcashOrg/hcd/chaincfg"
"github.com/HcashOrg/hcd/txscript"
"github.com/HcashOrg/hcd/wire"
)
// ExtractBlockTransactions extracts transaction information from ... |
package mux
import (
"fmt"
"io/ioutil"
"net"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"strings"
"time"
"github.com/docker/infrakit/pkg/discovery"
"github.com/docker/infrakit/pkg/discovery/local"
"github.com/docker/infrakit/pkg/leader"
logutil "github.com/docker/infrakit/pkg/log"
"g... |
package main
import (
"fmt"
"net/http"
"os"
"strings"
"github.com/spf13/cobra"
"github.com/ovh/cds/cli"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/cdsclient"
)
var projectCmd = cli.Command{
Name: "project",
Short: "Manage CDS project",
}
func projectCommands() []*cobra.Command {
return []*cobra.C... |
/*
Copyright 2017 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 2019 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 fetch
import (
"archive/zip"
"context"
"net/http"
"sort"
"strings"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"golang.org/x/pkgsite/inte... |
package manifest
import (
"bytes"
"database/sql"
"database/sql/driver"
"encoding/json"
"io"
"strings"
"djinn-ci.com/database"
"djinn-ci.com/errors"
"djinn-ci.com/runner"
"github.com/andrewpillar/webutil"
"gopkg.in/yaml.v2"
)
// Driver is used for the driver block in the manifest YAML.
type Driver map[st... |
package controllers
import (
"context"
"fmt"
api "github.com/guilhem/freeipa-issuer/api/v1beta1"
provisioners "github.com/guilhem/freeipa-issuer/provisionners"
cmutil "github.com/jetstack/cert-manager/pkg/api/util"
certmanager "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
cmmeta "github.com/jetsta... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type AttachVolumeInput struct {
_ struct{} `type:"structure"`
// The device name (for example, /dev/sdh or xvdh).
//... |
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"strings"
"time"
"github.com/olekukonko/tablewriter"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
var (
database string
collecti... |
package config
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"time"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/yaml.v3"
"github.com/modularise/modularise/internal/filecache"
"github.com/modularise/modularise/internal/filecache/cache"
"github.com/modulari... |
//
// (C) Copyright 2019-2020 Intel Corporation.
//
// 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 la... |
package snapshots
import (
"github.com/pierreprinetti/gophercloud/v3"
"github.com/pierreprinetti/gophercloud/v3/pagination"
)
// CreateOptsBuilder allows extensions to add additional parameters to the
// Create request.
type CreateOptsBuilder interface {
ToSnapshotCreateMap() (map[string]interface{}, error)
}
// ... |
package route53
import (
"fmt"
"os"
"strings"
"github.com/Sirupsen/logrus"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
awsRoute53 "github.com/aws/aws-sdk-go/service/route53"
"github.com/juju/ratelimit"
"github.com/rancher/external-dns/p... |
package main
import (
"bytes"
"fmt"
"io"
"os"
"os/exec"
"unsafe"
"golang.org/x/sys/unix"
)
func consoleSetFont(c *VirtualConsole) error {
if c.FontFile == "" {
debug("setfont parameters are not specified")
return nil
}
debug("loading font file %s", c.FontFile)
args := []string{c.FontFile}
if c.FontM... |
package status
import (
"encoding/json"
)
// Status Codes when querying data
const (
FailureCode = -1
SuccessCode = 1
)
// Manager addition/removal status messages
const (
ManagerRemoveFailure = "unable to remove manager"
ManagerAdditionFailure = "unable to add manager"
ManagerRemoveSuccess = "successfully... |
package bot
import (
"github.com/jonas747/discordgo"
"github.com/jonas747/dshardmanager"
"github.com/jonas747/dstate"
"github.com/jonas747/yagpdb/bot/deletequeue"
"github.com/jonas747/yagpdb/bot/eventsystem"
"github.com/jonas747/yagpdb/common"
"github.com/jonas747/yagpdb/common/scheduledevents"
"github.com/jon... |
// *** 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 v20190601preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Task struct {
pulumi.Custom... |
package andcond
import (
"encoding/xml"
"fmt"
"github.com/willhu-commit/pango/util"
)
// PanoAndCond is the client.Objects.AppSigAndCond namespace.
type PanoAndCond struct {
con util.XapiClient
}
// Initialize is invoked by client.Initialize().
func (c *PanoAndCond) Initialize(con util.XapiClient) {
c.con = co... |
package init
import (
"errors"
"fmt"
"github.com/QOSGroup/qbase/client/context"
clikeys "github.com/QOSGroup/qbase/client/keys"
"github.com/QOSGroup/qbase/keys"
"github.com/QOSGroup/qbase/server"
"github.com/QOSGroup/qbase/txs"
btypes "github.com/QOSGroup/qbase/types"
"github.com/QOSGroup/qos/app"
"github.co... |
package universe
import (
"time"
"github.com/influxdata/flux"
"github.com/influxdata/flux/codes"
"github.com/influxdata/flux/execute"
"github.com/influxdata/flux/internal/errors"
"github.com/influxdata/flux/interpreter"
"github.com/influxdata/flux/plan"
"github.com/influxdata/flux/runtime"
"github.com/influx... |
package jwtmanager
import (
"bytes"
"compress/gzip"
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"strings"
"time"
"github.com/LassoProject/lasso/pkg/cfg"
"github.com/LassoProject/lasso/pkg/structs"
log "github.com/Sirupsen/logrus"
jwt "github.com/dgrijalva/jwt-go"
)
// const numSites = 2
// LassoClaims... |
package model
import (
"fmt"
"html/template"
"strings"
"github.com/dizzyfool/genna/model"
"github.com/dizzyfool/genna/util"
)
// TemplatePackage stores package info
type TemplatePackage struct {
Package string
HasImports bool
Imports []string
Entities []TemplateEntity
}
// NewTemplatePackage creates a... |
package csrc
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"git.parallelcoin.io/dev/utl"
"github.com/gioapp/jorm/cfg"
"github.com/gioapp/jorm/jdb"
"github.com/gioapp/jorm/mod/c"
)
type CoinCodexCoins []struct {
Symbol string `json:"symbol"`
DisplaySymbol string `j... |
package sfu
import (
"errors"
"fmt"
"sync"
"github.com/lucsky/cuid"
log "github.com/pion/ion-log"
"github.com/pion/webrtc/v3"
)
const (
publisher = 0
subscriber = 1
)
var (
// ErrTransportExists join is called after a peerconnection is established
ErrTransportExists = errors.New("rtc transport already ex... |
package main
import (
"crypto/md5"
"encoding/json"
"fmt"
"log"
"net/url"
"os"
"regexp"
"strings"
"github.com/elcamino/colly/v2"
)
// "id": user id, "after": end cursor
const nextPageURL string = `https://www.instagram.com/graphql/query/?query_hash=%s&variables=%s`
const nextPagePayload string = `{"id":"%s",... |
// Copyright 2011 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 ssh
import (
"math/big"
"math/rand"
"reflect"
"testing"
"testing/quick"
)
var intLengthTests = []struct {
val, length int
}{
{0, 4 + 0},
{1, 4... |
/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
// Copyright 2017 luoji
// 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... |
//go:generate goversioninfo
package main
import (
"os"
"path/filepath"
"strings"
sdkArgs "github.com/newrelic/infra-integrations-sdk/args"
"github.com/newrelic/infra-integrations-sdk/integration"
"github.com/newrelic/infra-integrations-sdk/jmx"
"github.com/newrelic/infra-integrations-sdk/log"
)
type argumentL... |
// Copyright ©2015 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package mat_test
import (
"fmt"
"github.com/neoyagami/gonum/mat"
)
func ExampleCholesky() {
// Construct a symmetric positive definite matrix.
tmp :=... |
package api2
import (
"context"
"fmt"
"net/http"
"path"
"reflect"
"google.golang.org/protobuf/proto"
)
// Route describes one endpoint in the API, associated with particular
// method of some service.
type Route struct {
// HTTP method.
Method string
// HTTP path. The same path can be used multiple times w... |
// Copyright 2018 The go-exactonline AUTHORS. All rights reserved.
//
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Code generated by gen-services.go; DO NOT EDIT.
package mailbox
import (
"context"
"github.com/mcnijman/go-exactonline/api"
"github.com/mcnijman... |
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package platformvm
import (
"errors"
"fmt"
"github.com/corpetty/avalanchego/database/versiondb"
"github.com/corpetty/avalanchego/ids"
"github.com/corpetty/avalanchego/snow/choices"
"github.com/corpetty/avalancheg... |
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"regexp"
"strings"
)
type module struct {
File string
Name string `json:"name"`
Request moduleRequest `json:"request"`
Response moduleResponse `json:"response"`
}
type moduleRequest struct {
Metho... |
// Copyright 2018 Istio 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... |
/*
* Copyright 2018 The Service Manager 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 l... |
package conf
import (
"encoding/json"
"fmt"
"strings"
"github.com/sourcegraph/sourcegraph/pkg/conf/confdefaults"
"github.com/sourcegraph/sourcegraph/pkg/conf/conftypes"
"github.com/sourcegraph/sourcegraph/pkg/jsonc"
"github.com/sourcegraph/sourcegraph/schema"
"github.com/xeipuuv/gojsonschema"
)
// ignoreLega... |
// Copyright 2015 go-swagger maintainers
//
// 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... |
// The MIT License (MIT)
//
// 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
//... |
// Copyright 2019 MSolution.IO
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... |
// Copyright 2017 ETH Zurich
//
// 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 goripr
import (
"math"
"net"
"strconv"
"github.com/go-redis/redis"
"github.com/xgfone/netaddr"
)
var (
negInfBoundary = boundary{
ID: "-inf",
IP: nil,
Int64: int64(math.Inf(-1)),
Float64: math.Inf(-1),
UpperBound: true,
Reason: "-inf",
}
posInfBoundary = bound... |
package genericclioptions
import (
"os"
"github.com/golang/glog"
"github.com/redhat-developer/odo/pkg/application"
"github.com/redhat-developer/odo/pkg/component"
"github.com/redhat-developer/odo/pkg/log"
"github.com/redhat-developer/odo/pkg/occlient"
"github.com/redhat-developer/odo/pkg/odo/util"
"github.com... |
package main
import (
"bufio"
"errors"
"fmt"
"log"
"os"
"regexp"
"sort"
"strconv"
"strings"
)
// Type Room represents a parsed room.
type Room struct {
EncryptedName string
Sector int
Checksum string
}
// Regular expressions.
var RE_RoomName = regexp.MustCompile(`^([a-z\-]+?)\-(\d+?)\[([a-z]+... |
package app
import (
"context"
"database/sql"
"html/template"
"log"
"net"
"net/http"
"net/http/httputil"
"os"
"runtime/debug"
"time"
"github.com/budden/semdict/pkg/sddb"
"github.com/budden/semdict/pkg/shutdown"
"github.com/budden/semdict/pkg/unsorted"
"github.com/coreos/go-systemd/daemon"
"github.com/... |
package trojan
import (
"bytes"
"io"
"net"
"net/url"
"github.com/e1732a364fed/v2ray_simple/netLayer"
"github.com/e1732a364fed/v2ray_simple/proxy"
"github.com/e1732a364fed/v2ray_simple/utils"
)
func init() {
proxy.RegisterServer(Name, &ServerCreator{})
}
type ServerCreator struct{}
func (ServerCreator) NewS... |
package main
import (
"errors"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"sync"
_ "github.com/dimiro1/banner/autoload"
)
func main() {
programs := map[string]string{
"Eclipse": "https://rhlx01.hs-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/2021-09/R/eclipse-jee-2021-09-R-win32-x... |
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// Giorgis (<EMAIL>)
// Corbatto (<EMAIL>)
//Package avfilter contains methods that deal with ffmpeg filters
//filters in the same linear chain are separated by commas, and distinct linear chains of filters are separated by ... |
package util
import (
"context"
"database/sql"
"fmt"
"strconv"
"sync"
"time"
"github.com/timescale/prometheus-postgresql-adapter/pkg/log"
)
const (
waitForConnectionTimeout = time.Second
)
// PgAdvisoryLock is implementation of leader election based on PostgreSQL advisory locks. All adapters withing a HA gr... |
package grpc_prometheus
import (
"context"
prom "github.com/prometheus/client_golang/prometheus"
"google.golang.org/grpc"
"google.golang.org/grpc/status"
)
// ServerMetrics represents a collection of metrics to be registered on a
// Prometheus metrics registry for a gRPC server.
type ServerMetrics struct {
serv... |
/*
Copyright 2015 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 law or agreed to in ... |
package test
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
"os"
"syscall"
"testing"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
"github.com/pquerna/ffjson/ffjson"
"github.com/ysqi/atop/common"
"github.com/ysqi/atop/common/config"
"github.com/ysqi/atop/com... |
// This file contains helpers for
// processing SGF Property Value Types
// Refer to SGF.md in this package folder for details of
// concrete SGF Property Identity and Value Types
// This package does NOT provide direct support to connect
// SGF Property IDs and Value Types. Instead, providing helper
// functions for... |
package appbar
import (
"image/color"
"gioui.org/layout"
"gioui.org/widget"
"gioui.org/widget/material"
"gioui.org/x/component"
alo "gioui.org/example/component/applayout"
"gioui.org/example/component/icon"
page "gioui.org/example/component/pages"
)
type (
C = layout.Context
D = layout.Dimensions
)
// Pa... |
/*
Copyright AppsCode Inc. and Contributors
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 2021 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 cache
import (
"context"
"go/ast"
"go/token"
"go/types"
"strings"
"github.com/polaris1119/tools/internal/lsp/protocol"
"github.com/polaris1119/... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
package runner
import (
"fmt"
// "regexp"
"os"
"os/exec"
"os/user"
"path/filepath"
"syscall"
"runtime"
"github.com/go-errors/errors"
"github.com/modulesio/isolator/mansion"
"github.com/modulesio/isolator/manager"
"github.com/modulesio/isolator/runner"
)
var args = struct {
directory *string
// in... |
package app
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"io/ioutil"
"sort"
"strconv"
"strings"
"github.com/pkg/errors"
"github.com/saromanov/migr/pkg/db"
"github.com/saromanov/migr/pkg/model"
)
// Run provides starting of migrations
func (a *App) Run(path string) error {
dirs, err := getMigrationsDirs(... |
package ports
import (
"fmt"
"strconv"
"strings"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/knight42/krelay/pkg/constants"
)
type Parser struct {
args []string
obj runtime.Object
}
func (p Parser) WithObject(obj runtime.Object) Parser {
p.obj = ... |
/*
* Copyright IBM Corporation 2021
*
* 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 o... |
// Copyright 2019-present 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 agr... |
package matrix
import "fmt"
// SquareMultiply is the naive implementation resulting form the definition of
// matrix multiplication. If the input matricies are not square an error is returned
// It runs in O(n^3) time, where n := len(input)
func SquareMultiply(a, b [][]int) ([][]int, error) {
if err := validateMatri... |
// Copyright © 2018 BigOokie
//
// Use of this source code is governed by an MIT
// license that can be found in the LICENSE file.
package wcconfig
import (
"fmt"
"runtime"
"strings"
"time"
"crypto/sha256"
log "github.com/sirupsen/logrus"
viper "github.com/spf13/viper"
)
// Config structure models the appli... |
package mergeset
import (
"fmt"
"sort"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/encoding"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
)
type blockHeader struct {
// common prefix for all the items in the block.
commonPrefix []byte
// The first item.
firstItem []byte
// Marshal type used... |
/*
Copyright 2017 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 identity
import (
"crypto"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"crypto/ed25519"
)
var errEd25519WrongID = errors.New("incorrect object identifier")
var errEd25519WrongKeyType = errors.New("incorrect key type")
// ed25519OID is the OID for the E... |
// +build !windows
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... |
//
// SPDX-License-Identifier: BSD-3-Clause
//
package redfish
import (
"context"
"encoding/json"
"strings"
"testing"
"github.com/jacobweinstock/gophish/common"
)
var storageBody = `{
"@odata.context": "/redfish/v1/$metadata#Storage.Storage",
"@odata.type": "#Storage.v1_7_0.Storage",
"@odata.id": "/redfi... |
package auth
import (
"bytes"
"errors"
"fmt"
"io"
"strconv"
)
// RPC wraps an rpc session
type RPC struct {
F io.ReadWriteCloser
Arg []byte
Ai *Info
}
// Info is returned after a successful authentication
type Info struct {
Cuid string
Suid string
Cap string
Secret []byte
}
// Ret is a reply f... |
package main
import (
"fmt"
)
var (
//% is repaced with the "from" or "to" depot name
pathTransform = Transform{
From: "^//%s/",
To: "//%s/",
}
identTransform = Transform{
From: "^%s$",
To: "%s",
}
//Transforms are indexed by the <db name>:<field index> where field index enumerates from 0
//fields... |
package source
import (
"crypto/md5"
"encoding/hex"
"fmt"
"github.com/lf-edge/ekuiper/internal/conf"
"github.com/lf-edge/ekuiper/internal/pkg/httpx"
"github.com/lf-edge/ekuiper/pkg/api"
"github.com/lf-edge/ekuiper/pkg/cast"
"github.com/lf-edge/ekuiper/pkg/message"
"io/ioutil"
"net/http"
"net/url"
"strings"... |
/*
* Copyright 2018- The Pixie 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 exec
import (
"fmt"
"io"
"log"
"net/url"
"sync"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"k8s.... |
package registries
import (
log "github.com/sirupsen/logrus"
"regexp"
)
// ImageRegistries contains all the information regarding image registries
type ImageRegistries struct {
DockerHub ImageRegistry `koanf:"dockerHub"`
Quay ImageRegistry `koanf:"quay"`
Gcr ImageR... |
/*
Copyright 2022.
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
distributed un... |
package main
import (
"fmt"
"log"
"os"
"strconv"
"time"
"github.com/urfave/cli"
"github.com/KyberNetwork/reserve-stats/accounting/common"
huobiFetcher "github.com/KyberNetwork/reserve-stats/accounting/huobi/fetcher"
"github.com/KyberNetwork/reserve-stats/accounting/huobi/storage/postgres"
libapp "github.co... |
// Copyright 2017 Monax Industries Limited
//
// 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 cmd
import (
"log"
"time"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
cfgFile string
apiServer string
context string
namespace string
exclnamespaces []string
kubeConf string
dryRun bool
dumpMode bool
logLevel string
logOutput ... |
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package lhsm_plugin_az_core
import (
"context"
"fmt"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"syscall"
"time"
"github.com/Azure/azure-pipeline-go/pipeline"
"github.com/Azure/azure-storage-blob-go/azblob"
"github.com/edwardsp/lemur/cmd/util"
chk "gopkg.in/check.v1"
)
// test upload/download w... |
package main
import (
"errors"
"fmt"
"log"
"os"
"os/signal"
"runtime"
"strconv"
"syscall"
"time"
"github.com/garyburd/redigo/redis"
"github.com/joho/godotenv"
"github.com/takama/daemon"
)
const (
// AppName namespace in redis key
AppName = "sysremot"
// Version app version
Version = "0.1.0"
// TheTi... |
package otelconfig
import (
"fmt"
"strings"
"github.com/ghodss/yaml"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/jaegertracing/jaeger-operator/pkg/apis/jaegertracing/v1"
"github.com/jaegertracing/jaeger-operator/pkg/util"
)
const (
c... |
package external
import (
"fmt"
"io/ioutil"
"net/http"
"sort"
"strings"
"github.com/coreos/go-semver/semver"
"github.com/rancher/rancher/pkg/controllers/management/k3sbasedupgrade"
"github.com/rancher/rancher/pkg/settings"
"github.com/sirupsen/logrus"
)
type Source string
const (
K3S Source = "k3s"
RKE2... |
package mdns
import (
"context"
"strings"
"time"
"github.com/openshift/microshift/pkg/mdns/server"
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/p... |
package images
import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/pagination"
)
// ListOptsBuilder allows extensions to add additional parameters to the
// List request.
type ListOptsBuilder interface {
ToImageListQuery() (string, error)
}
// ListOpts allows the filtering and sortin... |
package main
import (
"fmt"
"time"
"net/http"
"net"
"log"
"os"
"strings"
"math/rand"
"strconv"
"io"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/pflag"
kclient "k8s.io/client-go/kubernetes"
kcorelisters "k8s.io/client-go/l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.