text stringlengths 3.08k 10.4k |
|---|
/*
Copyright 2020 The OpenEBS 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 deploy
import (
"errors"
"fmt"
"path/filepath"
"regexp"
"github.com/aws-cloudformation/rain/internal/aws"
"github.com/aws-cloudformation/rain/internal/aws/cfn"
"github.com/aws-cloudformation/rain/internal/cmd"
"github.com/aws-cloudformation/rain/internal/config"
"github.com/aws-cloudformation/rain/in... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package ec2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a route in a route t... |
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this fi... |
// Copyright (c) 2020 Tailscale Inc & 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 cli
import (
"context"
"errors"
"flag"
"fmt"
"log"
"net"
"strings"
"time"
"github.com/peterbourgon/ff/v2/ffcli"
"tailscale.com/c... |
package resources
import (
"fmt"
"strings"
"sync"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/discovery"
"k8s.io/client-go/kubernetes"
)
type ResourceTypes interface {
All() ([]ResourceType, error)
Find(Resource) (ResourceType, error)
}
t... |
package iso9660
import (
"bytes"
"testing"
"github.com/dave/diskfs/partition/mbr"
"github.com/dave/diskfs/util"
)
func TestElToritoGenerateCatalog(t *testing.T) {
et := &ElTorito{
BootCatalog: "/boot.cat",
HideBootCatalog: false,
Platform: EFI,
Entries: []*ElToritoEntry{
{Platform: BIOS, E... |
package command
import (
"bufio"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
"os/signal"
"path/filepath"
"runtime"
"strings"
"time"
"github.com/hashicorp/logutils"
"github.com/mitchellh/go-homedir"
"golang.org/x/crypto/ssh"
)
const (
// Boot2docker related constants.
// These constants are from ... |
package kv
import (
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path"
"strings"
"sync"
"time"
)
type StoreOption func(*Store)
func WithDirectory(dir string) StoreOption {
return func(s *Store) {
s.dir = dir
}
}
func indexDataFile(store *Store, dataFileName string) error {
log.Printf("Reading data file to index... |
package weed_server
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"net/http"
"path/filepath"
"strconv"
"strings"
"time"
"gitlab.momenta.works/kubetrain/seaweedfs/weed/glog"
"gitlab.momenta.works/kubetrain/seaweedfs/weed/operation"
"gitlab.momenta.works/kubetrain/seaweedfs/weed/stats"
"gitlab.momenta.wo... |
// Copyright (c) 2021 Chair of Applied Cryptography, Technische Universität
// Darmstadt, Germany. All rights reserved. This file is part of
// perun-eth-mobile. Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package prnm
import (
"github.com/perun-network/per... |
// Copyright 2015 The rkt 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... |
package api
import (
"io/ioutil"
"os"
"github.com/kraken-hpc/imageapi/models"
"github.com/sirupsen/logrus"
)
var MountDrivers = map[string]MountDriver{}
type Mount models.Mount
// Make sure Mount is an EndpointObject
var _ EndpointObject = (*Mount)(nil)
func (m *Mount) GetID() models.ID ... |
// Copyright 2022 The Corazawaf 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 a... |
// 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 applicabl... |
// Copyright 2015 go-smpp 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 pdu
import (
"bytes"
"fmt"
"io"
"sync/atomic"
"github.com/messente/go-smpp/smpp/pdu/pdufield"
"github.com/messente/go-smpp/smpp/pdu/pdutlv"
)
... |
package storage
import (
"context"
"fmt"
"cloud.google.com/go/firestore"
"github.com/golang/protobuf/ptypes/timestamp"
"go.uber.org/zap"
"google.golang.org/api/iterator"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// Iterate iterate through the records and to populate in model.
func (s *... |
// Package cryptocore wraps OpenSSL and Go GCM crypto and provides
// a nonce generator.
package cryptocore
import (
"crypto/aes"
"crypto/cipher"
"crypto/sha512"
"fmt"
"log"
"runtime"
"github.com/rfjakob/eme"
"github.com/sapiens-sapide/gocryptfs/internal/siv_aead"
"github.com/sapiens-sapide/gocryptfs/intern... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package workspaces
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type DescribeWorkspaceBundlesInput struct {
_ struct{} `type:"structure"`
// The identifiers of the bundles. You canno... |
/*
* Copyright 2019 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 Licen... |
package reputation
import (
"context"
"math"
"sort"
"sync"
"time"
"github.com/ipfs/go-datastore"
logging "github.com/ipfs/go-log"
ma "github.com/multiformats/go-multiaddr"
"github.com/textileio/fil-tools/index/ask"
"github.com/textileio/fil-tools/index/miner"
"github.com/textileio/fil-tools/index/slashing"... |
package aws
import (
"fmt"
"log"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/datasync"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)
func resourceAwsDataSyncLocationEfs() *schema.Resource {
return &sc... |
// Copyright © 2022 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
// Copyright 2018 The gg 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 applicable law or agreed to... |
// Copyright 2015 flannel 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... |
/*
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 pgt
import (
"bytes"
"strconv"
"strings"
"unicode/utf8"
bat "github.com/robert-zaremba/go-bat"
)
// EmptyArray represents a value of empty Postgresql Array
var EmptyArray = []byte("{}")
var (
openingArray = byte('{')
closingArray = byte('}')
arraySeparator = byte(',')
arraySeparatorSlice = []b... |
package generator
import (
"fmt"
"reflect"
"github.com/steffnova/go-check/arbitrary"
"github.com/steffnova/go-check/constraints"
"github.com/steffnova/go-check/shrinker"
)
// Generate returns new arbitrary and it's coresponding shrinker
type Generate func() (arbitrary.Arbitrary, shrinker.Shrinker)
// Generator... |
package aws
import (
"fmt"
log "github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
kubeclient "k8s.io/client-go/kubernetes"
)
func UninstallCluster(name string) error {
// First, e... |
package main
import (
"container/list"
dl "de.knallisworld/aoc/aoc2019/dayless"
"fmt"
"strings"
"time"
)
const AocDay = 14
const AocDayName = "day14"
const AocDayTitle = "Day 14"
func main() {
dl.PrintDayHeader(AocDay, AocDayTitle)
defer dl.TimeTrack(time.Now(), AocDayName)
{
dl.PrintStepHeader(1)
puzzl... |
package scaffolder
import (
"context"
"errors"
"fmt"
"go/ast"
"go/parser"
"go/token"
"os"
"path/filepath"
"strings"
"github.com/tendermint/starport/starport/pkg/multiformatname"
"github.com/tendermint/starport/starport/pkg/protoanalysis"
"github.com/tendermint/starport/starport/templates/field/datatype"
)... |
package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func main() {
reader := bufio.NewReader(os.Stdin)
n, m, q := readThreeNums(reader)
E := make([][]int, m)
for i := 0; i < m; i++ {
E[i] = readNNums(reader, 3)
}
fmt.Println(solve(n, m, q, E))
}
func readInt(bytes []byte, from int, val *int) int {
i := f... |
package executor
import (
gofig "github.com/akutz/gofig/types"
"github.com/akutz/goof"
"github.com/rexray/rexray/libstorage/api/registry"
"github.com/rexray/rexray/libstorage/api/types"
"github.com/rexray/rexray/libstorage/api/utils"
"github.com/rexray/rexray/libstorage/drivers/storage/cinder"
"encoding/json"... |
// Code generated by gotdgen, DO NOT EDIT.
package mt
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt... |
// Copyright 2022 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package name
import (
"errors"
"fmt"
"io"
"strings"
"time"
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
e "github.com/ipfs/go-ipfs/core/commands/e"
namesys "github.com/ipfs/go-ipfs/namesys"
nsopts "github.com/ipfs/go-ipfs/namesys/opts"
cmds "gx/ipfs/QmPTfgFTo9PFr1PvPKyKoeMgBvYPh6cX3aDP7DHKVbnCbi/g... |
// 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 multipart
import (
"bytes"
"crypto/rand"
"errors"
"fmt"
"io"
"net/textproto"
"sort"
"strings"
)
// A Writer generates multipart messages.
type... |
/*
golang 内置25个关键字:
break continue switch case default if else for import return goto
package(定义包名) const(定义常量) var(定义变量) func(定义函数) type(定义类型) interface(定义接口) struct(定义结构)
chan go select defer map fallthrough range
*/
/*
1.单个变量的声明:
变量的声明格式: var <变量名称> <变量类型>
变量的赋值格式: <变量名称> = <表达式>
声明的同时赋值: var <变量名称> [变量类... |
package main
import (
"bytes"
"flag"
"fmt"
"github.com/skip2/go-qrcode"
"golang.org/x/crypto/ssh/terminal"
"io/ioutil"
"math"
"math/rand"
"os"
"runtime"
"time"
)
var (
rainbowMode bool
trueColorMode bool
spread float64
freq float64
message string
)
const (
blackBlock = "\033[... |
package player
import (
"fgame/fgame/core/storage"
jieyientity "fgame/fgame/game/jieyi/entity"
jieyitypes "fgame/fgame/game/jieyi/types"
"fgame/fgame/game/player"
"fgame/fgame/game/player/types"
"github.com/pkg/errors"
)
type PlayerJieYiObject struct {
id int64
player player.Player
jie... |
package eureka
import (
"fmt"
)
// Config eureka客户端配置
type Config struct {
// eureka服务端地址
DefaultZone string
// 心跳间隔,默认30s
RenewalIntervalInSecs int
// 获取服务列表间隔,默认15s
RegistryFetchIntervalSeconds int
// 过期间隔,默认90s
DurationInSecs int
// 应用名称
App string
// 端口
Port int
Metadata map[string]interface{}
... |
/*
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, ... |
/*
* 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 ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: common.proto
package common
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-... |
/*
Copyright (c) 2020 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... |
package httransform
import (
"time"
"github.com/9seconds/httransform/v2/auth"
"github.com/9seconds/httransform/v2/events"
"github.com/9seconds/httransform/v2/executor"
"github.com/9seconds/httransform/v2/layers"
)
const (
// DefaultConcurrency defines a default number of concurrently
// managed requests proce... |
package backend
import (
"fmt"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform/tfdiags"
"github.com/zclconf/go-cty/cty"
)
// UnparsedVariableValue represents a variable value provided by the caller
// whose parsin... |
/*
* Copyright 2017 XLAB d.o.o.
*
* 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 ... |
/*******************************************************************************
* Copyright 2019 Samsung Electronics 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... |
/*
Copyright 2021 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... |
// *** 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 machinelearningservices
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// API Version: 2021-03-01... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.15.8
// source: rpc/rpc.proto
package rpc
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
c... |
// 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 main
import (
"eaciit/gdrj/model"
"eaciit/gdrj/modules"
"github.com/eaciit/dbox"
_ "github.com/eaciit/dbox/dbc/csv"
_ "github.com/eaciit/dbox/dbc/mongo"
"github.com/eaciit/toolkit"
"gopkg.in/mgo.v2/bson"
"os"
"strings"
"sync"
"time"
)
var (
wd, _ = os.Getwd()
brandlist = []string{}
conn ... |
/*
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
* Copyright (C) 2017-2021 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.
* Yo... |
package main
import (
"context"
"fmt"
"math/rand"
"net/http"
"sync"
"time"
"github.com/finkf/gofiler"
"github.com/finkf/gofilerd/api"
log "github.com/sirupsen/logrus"
)
func init() {
rand.Seed(time.Now().Unix())
}
var (
verbs = []string{
"eating", "smelling", "seeing", "kicking", "liking", "tasting", "... |
// Code generated by go-swagger; DO NOT EDIT.
package x_cluster_replication
// 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"
c... |
package etcd
import (
"crypto/tls"
"errors"
"io/ioutil"
"net"
"net/http"
"net/url"
"path"
"strings"
"time"
)
const (
HTTP = iota
HTTPS
)
type Cluster struct {
Leader string
Machines []string
}
type Config struct {
CertFile string
KeyFile string
Scheme string
Timeout time.Duration
}
type Clie... |
package packngo
import (
"path"
)
const usersBasePath = "/users"
const userBasePath = "/user"
// UserService interface defines available user methods
type UserService interface {
List(*ListOptions) ([]User, *Response, error)
Get(string, *GetOptions) (*User, *Response, error)
Current() (*User, *Response, error)
... |
/*
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 2018 the Service Broker Project Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applic... |
package main
import (
"bytes"
"errors"
"fmt"
ht "html/template"
"io"
"io/ioutil"
"path/filepath"
"strings"
tt "text/template"
"github.com/ghodss/yaml"
)
// NewGenerator returns a new template generator that generates HTML page
// with go-import meta tags.
func NewGenerator(configPath, templatePath string) ... |
package input
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
"io"
"math/big"
ogorek "github.com/kisielk/og-rek"
log "github.com/sirupsen/logrus"
)
type Pickle struct {
dispatcher Dispatcher
}
func NewPickle(dispatcher Dispatcher) *Pickle {
return &Pickle{dispatcher}
}
func (p *Pickle) Kind() ... |
// Package client implement remote client to get and print records
package client
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"strings"
"time"
"github.com/fatih/color"
log "github.com/go-pkgz/lgr"
"github.com/go-pkgz/repeater"
"github.com/go-pkgz/repeater/strategy"
... |
/*
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 plugins
import (
"fmt"
"log"
"strconv"
hProtocol "github.com/stellar/go/protocols/horizon"
"github.com/stellar/go/txnbuild"
"github.com/stellar/kelp/api"
"github.com/stellar/kelp/model"
"github.com/stellar/kelp/support/utils"
)
type makerModeFilter struct {
name string
tradingPair *model.T... |
// Package csvstruct provides methods to decode a CSV file into a struct.
package csvstruct
import (
"encoding"
"encoding/csv"
"errors"
"fmt"
"io"
"reflect"
"strconv"
"strings"
)
var textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
// Decoder reads and decodes CSV rows from an in... |
/* The Computer Language Benchmarks Game
* http://benchmarksgame.alioth.debian.org/
*
* contributed by The Go Authors.
* based on C program by <NAME>
* flag.Arg hack by <NAME>
* modified by <NAME>.
*/
package main
import (
"flag"
"fmt"
"math"
"strconv"
)
type Body struct {
x, y, z, pad, vx... |
package config
type (
LoggerConfig struct {
LogLevel string `yaml:"logLevel" json:"logLevel"` // logging level for the application
LogsDir string `yaml:"logsDir" json:"logsDir"` // directory into which logs are written
}
StoreConfig struct {
DataDirectory string `yaml:"path" json:"path"`
}
HTTPConfig s... |
/*
Copyright © 2019 <NAME> @itaysk
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... |
// Copyright 2019 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build go1.13
// +build linux darwin
package main
import (
"bufio"
"bytes"
"context"
"net/http/httptest"
"regexp"
"strings"
"testing"
"time"
)
var... |
/*
* 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 ... |
// 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 agreed to i... |
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
package command
import (
"archive/tar"
"fmt"
"net/http"
"regexp"
"strings"
"text/template"
petname "github.com/dustinkirkland/golang-petname"
"github.com/labstack/echo/v4"
"github.com/pkg/errors"
"github.com/determined-ai/determined/master/internal/db"
"github.com/determined-ai/determined/master/internal/... |
package entity
import (
"time"
"strings"
)
// Meeting :
type Meeting struct {
Sponsor string `xorm:"notnull"`
Participators []string
StartDate, EndDate Date
Title string
}
// Met :
type Met struct {
// Id int64 `xorm:"pk autoincr"`
Sponsor string `xorm:"pk notnull"`
Participators []string
StartDate, End... |
// Copyright 2020 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
/*
Copyright 2018 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, sof... |
package eap
import (
"encoding/binary"
"fmt"
"strconv"
"github.com/Tunghsu/radius/MSCHAPV2"
)
type Code uint8
const (
CodeRequest Code = 1
CodeResponse Code = 2
CodeSuccess Code = 3
CodeFailure Code = 4
)
func (c Code) String() string {
switch c {
case CodeRequest:
return "Request"
case CodeRespons... |
// Copyright © 2016 <NAME> IV <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 agree... |
package controller
import (
"fmt"
"sync"
apierrs "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
imagev1 "github.com/openshift/api/image/v1"
imageapi "github.com/openshift/origin/pkg/image/apis/image"
metrics "github.com/op... |
// Code generated by go-swagger; DO NOT EDIT.
package custom_integrations
// 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 ... |
package load
import (
"bufio"
"bytes"
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/url"
"suggestions/datastore"
"suggestions/lang"
"suggestions/suggestion"
"sync"
"unicode"
"unicode/utf8"
"github.com/dgraph-io/badger/v2"
)
var suggEndpoint = "http://suggestqueries.google.com/complete/s... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package redshift
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type DescribeDefaultClusterParametersInput struct {
_ struct{} `type:"structure"`
// An optional parameter that specifie... |
// Copyright 2014 Wandoujia Inc. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package router
import (
"fmt"
"sync"
"time"
"github.com/wandoulabs/codis/pkg/proxy/redis"
"github.com/wandoulabs/codis/pkg/utils/errors"
"github.com/wandoulabs/codis/pkg/utils/log"
)
type BackendConn str... |
package main
import (
"bufio"
"encoding/csv"
"fmt"
"github.com/gin-gonic/gin"
"html/template"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"sort"
"strconv"
"strings"
)
func Gin() {
r := gin.Default()
// 此文件 读取html
r.GET("/", func(ctx *gin.Context) {
tem, err := template.ParseFiles("./index.html") // 将文件 导... |
package ebpf
import (
"errors"
"fmt"
"github.com/cilium/ebpf/asm"
"github.com/cilium/ebpf/btf"
)
// splitSymbols splits insns into subsections delimited by Symbol Instructions.
// insns cannot be empty and must start with a Symbol Instruction.
//
// The resulting map is indexed by Symbol name.
func splitSymbols(... |
package today
import (
"fmt"
"sort"
"time"
)
// TaskList represents a list of Tasks.
type TaskList struct {
Tasks []*Task
nextTaskID int
}
// A Task is a structure representing a task.
// A Task in a today file may look like this:
// TASK-1 - Description [STATUS NAME - Status.Comment - Status.Date]
// ... |
package lib
import (
"bytes"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"syscall"
)
// FetchNonDirFileNames returns a list of files in a directory
// that are only regular files
func FetchNonDirFileNames(dirPath string) (files []string, e error) {
var filesInfo []os.FileInfo
... |
// Copyright 2016-2018, Pulumi 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 law or... |
package integration
import (
"fmt"
"net/url"
"strings"
"time"
infra "github.com/newrelic/infra-integrations-sdk/data/metric"
sdk "github.com/newrelic/infra-integrations-sdk/integration"
"github.com/newrelic/nri-prometheus/internal/pkg/labels"
dto "github.com/prometheus/client_model/go"
"github.com/sirupsen/l... |
package services
import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptrace"
"net/http/httputil"
"strings"
"sync"
"time"
"github.com/zaaksam/goman/go/model"
)
// Req Http请求对象
var Req reqService
type reqService struct{}
func (s *reqService) Do(req *model.RequestModel) (list []*model.ResponseMo... |
package adapter
import (
"context"
"github.com/Nerzal/gocloak/v8"
"github.com/epam/edp-keycloak-operator/pkg/apis/v1/v1alpha1"
"github.com/pkg/errors"
)
type ErrNotFound string
func (e ErrNotFound) Error() string {
return string(e)
}
func IsErrNotFound(err error) bool {
switch errors.Cause(err).(type) {
cas... |
// Package consolelog provides a writer for the "github.com/rs/zerolog" package.
//
package consolelog
import (
"bytes"
"encoding/json"
"fmt"
"io"
"os"
"sort"
"strings"
"time"
"github.com/fatih/color"
"github.com/rs/zerolog"
)
const (
defaultTimeFormat = time.Kitchen
)
var (
bold = color.New(color.Bol... |
package webhook
import (
"bytes"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/kruzio/exodus/pkg/usageprinter"
"github.com/olekukonko/tablewriter"
"github.com/parnurzeal/gorequest"
"k8s.io/apimachinery/pkg/util/errors"
log "k8s.io/klog"
)
type WebhookClient stru... |
/*
Copyright 2022 a2ush.
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
distribu... |
package mesh
import (
"fmt"
"net"
)
// Status is our current state as a peer, as taken from a router.
// This is designed to be used as diagnostic information.
type Status struct {
Protocol string
ProtocolMinVersion int
ProtocolMaxVersion int
Encryption bool
PeerDiscovery bool
Name ... |
package timespec
import (
"bytes"
"io/ioutil"
"regexp"
"strconv"
)
type tokens struct {
whitespace *regexp.Regexp
number *regexp.Regexp
ordinal *regexp.Regexp
}
type keywordMatcher struct {
token int
match *regexp.Regexp
}
type yyLex struct {
tokens tokens
keywords []keywordMatcher
buf []b... |
// Copyright 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 agreed to in wri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.