text stringlengths 3.08k 10.4k |
|---|
package gosrt
// #cgo pkg-config: srt
// #include <srt/srt.h>
import "C"
import (
"fmt"
"net"
"time"
"unsafe"
)
// Socket is a SRT socket type.
// To create one, use NewSocket
type Socket struct {
sockid int
}
// NewSocket creates a new socket
// newType is either INET_4 or INET_6, which are ipv4 and ipv6 reps... |
// Copyright (c) 2019-2020 Latona. All rights reserved.
package main
import (
"context"
"net"
"os"
"os/signal"
"syscall"
"bitbucket.org/latonaio/aion-core/cmd/service-broker/app"
"bitbucket.org/latonaio/aion-core/config"
"bitbucket.org/latonaio/aion-core/internal/services"
"bitbucket.org/latonaio/aion-core/p... |
package contentionmanager
import (
"context"
"fmt"
"github.com/lterrac/system-autoscaler/pkg/apis/systemautoscaler/v1beta1"
"github.com/lterrac/system-autoscaler/pkg/podscale-controller/pkg/types"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
... |
package command
import (
"encoding/json"
"errors"
"sort"
"time"
"koding/db/models"
"koding/db/mongodb/modelhelper"
"koding/kites/kloud/machinestate"
"koding/kites/kloud/sshutil"
"github.com/koding/kite/protocol"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
type Template struct {
Machines struct {
Labels... |
package main
import (
"bufio"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/tableauio/tableau/proto/tableaupb"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/descriptorpb"
)
const (
errorsPackage = protogen.GoImportPath("errors")
f... |
package gaeserver
import (
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"os"
"time"
"github.com/gorilla/mux"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
appengine "google.golang.org/appengine"
"google.golang.org/appengine/log"
"... |
/*
Copyright © 2021 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 scheduler
import (
syncv1alpha1 "github.com/Skyscanner/applicationset-progressive-sync/api/v1alpha1"
"github.com/Skyscanner/applicationset-progressive-sync/internal/utils"
argov1alpha1 "github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
"github.com/argoproj/gitops-engine/pkg/health"
"github.com/go... |
package lambdautils
import (
"crypto/sha256"
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-... |
package node
import (
"context"
iksv1alpha1 "github.com/jkwong888/iks-overlay-ip-controller/pkg/apis/iks/v1alpha1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/contr... |
package quick
import (
"fmt"
"io"
"log"
"os"
"github.com/go-redis/redis/v7"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/robfig/cron/v3"
"gopkg.in/natefinch/lumberjack.v2"
"gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"gorm.io/... |
package main
import (
"log"
"testing"
"github.com/stretchr/testify/assert"
yaml "gopkg.in/yaml.v2"
)
var simpleDocument = `
first:
second:
string: "ss"
int: 2323
float: 3.5
array: ["a", "b"]
map:
string: "abc"
int: 123
single: "abc"
`
var validationDocument = `
mandatory_... |
package org
import (
"github.com/invopop/gobl/uuid"
validation "github.com/go-ozzo/ozzo-validation/v4"
"github.com/go-ozzo/ozzo-validation/v4/is"
)
// Party represents a person or business entity.
type Party struct {
ID string `json:"id,omitempty" jsonschema:"title=ID,description=Internal ID use... |
/*
Copyright 2021 Adobe. All rights reserved.
This file is licensed to you 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 agre... |
package huffman
import (
"bytes"
"sort"
)
type Node struct {
Left *Node
Right *Node
Weight int
Value interface{}
}
func (n *Node) traverse(depth int, code []byte, offset int, encoder *Encoder, decoder *Decoder) {
i := depth / 8
o := depth % 8
if n.Left.Left == nil {
ncode := make([]byte, len(code), le... |
// The deploy command deploys Scheduled Queries into BigQuery
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"regexp"
"strings"
datatransfer "cloud.google.com/go/bigquery/datatransfer/apiv1"
"google.golang.org/api/iterator"
datatransferpb "google.golang.org/genproto/googleapis/cloud/bi... |
// Copyright <NAME> 2020. See LICENSE file.
package solvers
import (
"runtime/pprof"
"runtime"
"os"
"unsafe"
"fmt"
"time"
"foxhole/grid"
"sync"
)
const DEBUG = true
/*
Current grids which need to be processed.
*/
var GridsToProcess = make(chan *grid.Grid)
/*
Requirement for creating a foxhole solver
*/
t... |
package vat
import (
"fmt"
"testing"
)
var tests = []struct {
number string
valid bool
}{
{"", false},
{"A", false},
{"AB123A01", false},
{"ATU12345678", true},
{"ATU15673009", true},
{"ATU1234567", false},
{"BE0123456789", true},
{"BE1234567891", true},
{"BE0999999999", true},
{"BE9999999999", true},
... |
package cli
import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"
envoyv1alpha1 "github.com/jpeach/envoy-controller/api/v1alpha1"
"github.com/jpeach/envoy-controller/pkg/kubernetes"
"github.com/jpeach/envoy-controller/pkg/must"
"github.com/jpeach/envoy-controller/pkg/xds"
"github.com/spf13/cobra"
"github.co... |
package service
import (
"encoding/json"
"errors"
"fmt"
"math/rand"
"strconv"
"strings"
"time"
"github.com/bingfenglai/gt/common/constants"
"github.com/bingfenglai/gt/common/helper"
"github.com/bingfenglai/gt/config"
"github.com/bingfenglai/gt/domain/response"
"github.com/bingfenglai/gt/domain/params"
"... |
/*
MIT License
Copyright 2016 Comcast Cable Communications Management, LLC
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, cop... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package quicksight
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type DeleteThemeInput struct {
_ struct{} `type:"structure"`
// The I... |
// Copyright 2018 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 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 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
/*
Copyright 2018 Pressinfra SRL
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 image
import (
"fmt"
"regexp"
"runtime"
"strings"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors"
)
var (
specifierRe = regexp.MustCompile(`^[A-Za-z0-9_-]+$`)
)
// Platform is a subset of the supported fields from specs "github.com/opencontainers/image-spec/specs-go/v1.Platform"
ty... |
// Copyright 2018 The Operator-SDK 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 ... |
package cachext
import (
"context"
"errors"
"fmt"
"net/url"
"strconv"
"strings"
"time"
"github.com/RichardKnop/machinery/v1/log"
)
const Nil = cacheNil("cache result is nil")
type cacheNil string
func (e cacheNil) Error() string { return string(e) }
// CachedConfig save the param and config for a cached f... |
// Copyright 2019 GoAdmin Core Team. All rights reserved.
// Use of this source code is governed by a Apache-2.0 style
// license that can be found in the LICENSE file.
package menu
import (
"github.com/davidlcarrascal/go-admin/modules/db"
"github.com/davidlcarrascal/go-admin/modules/language"
"github.com/davidlca... |
package cronowriter
import (
"io"
"os"
"path/filepath"
"sync"
"time"
"github.com/lestrrat-go/strftime"
)
type (
// A CronoWriter writes message to a set of output files.
CronoWriter struct {
pattern *strftime.Strftime // given pattern
path string // current file path
symlink *strftime.St... |
/*
Package index provides the functionality to describe a reference 'file' and its contents in terms of
the weak and strong checksums, in such a way that you can check if a weak checksum is present,
then check if there is a strong checksum that matches.
It also allows lookups in terms of block offsets, so that upon fi... |
// Copyright 2017 orijtech. 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 ... |
/*
Copyright 2020 The cert-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 law or agreed to in writing... |
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// 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 limit... |
// 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/aws-sdk-go-v2/service/ec2/types"
"github.com/awslabs/smithy-go/middleware"
smithyhttp "github.com/awslabs/sm... |
/*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
/*
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, ... |
package config
import (
"encoding/xml"
//"path"
"path/filepath"
"os"
"strings"
"strconv"
"fmt"
"logger"
)
type Vhost struct {
Name string `xml:"name,attr"`
Status int `xml:"status,attr"`
Bind []string `xml:"bind"`
Host []Host `xml:"host"`
Cache []Cache `xml:"cache"`
Limit Limit `xml:"limit"`
Ssl []Ss... |
package github
import (
"context"
"log"
"net/http"
"github.com/google/go-github/v41/github"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
func resourceGithubIssueLabel() *schema.Resource {
return &schema.Resource{
Create: resourceGithubIssueLabelCreateOrUpdate,
Read: resourceGithubIssueLabe... |
// 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 peaker
import (
"fmt"
"github.com/pelletier/go-toml"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
type ServerConfig struct {
Server string
Port int
Email string
Password string
}
type AccountConfig struct {
Name string
Server *ServerConfig
Mailboxes []string
Template s... |
// Copyright (c) 2021 Terminus, 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 agree... |
// Copyright 2016 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... |
/*
* This file is part of the KubeVirt project
*
* 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 manager
import (
"bytes"
"filesrv/conf"
"filesrv/library/log"
"filesrv/library/utils"
"github.com/disintegration/imaging"
"go.mongodb.org/mongo-driver/bson"
"go.uber.org/zap"
"image"
"image/jpeg"
"sort"
"sync"
"time"
)
type FileItem struct {
mu *sync.Mutex
Fid int64 //文件ID
... |
package pipelines
import (
"context"
"strings"
v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1"
"github.com/jenkins-x/jx-logging/pkg/log"
"github.com/jenkins-x/octant-jx/pkg/common/viewhelpers"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
"github.com/vmware-tanzu/octant/pkg/plugin/service"
... |
/*
Copyright 2021 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 main
import (
"errors"
"fmt"
"io"
"log"
"net"
"os"
"path"
"strings"
tea "github.com/charmbracelet/bubbletea"
"github.com/jessevdk/go-flags"
"www.github.com/ZinoKader/portal/constants"
"www.github.com/ZinoKader/portal/models"
"www.github.com/ZinoKader/portal/tools"
)
type SendCommandOptions struc... |
package testing
import (
"bytes"
. "github.com/shimmeringbee/unpi"
"io"
"sync/atomic"
"testing"
)
const UnlimitedCalls = -1
type MockAdapter struct {
sequencer *int64
ReceivedFrames []Frame
incomingReader io.Reader
incomingWriter io.WriteCloser
incomingEnd chan bool
outgoingBuffer *bytes.Buffer
out... |
/*
* Copyright 2020 OSFramework Project
*
* 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 codespace
import (
"context"
"errors"
"fmt"
"strings"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/cli/cli/v2/internal/codespaces/api"
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
)
type deleteOptions struct {
deleteAll bool
skipConfirm bool
codespaceName string
repoFilte... |
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"path/filepath"
"sort"
"strings"
"time"
"github.com/vbauerster/mpb/v5"
"github.com/vbauerster/mpb/v5/decor"
"gitlab.com/NebulousLabs/Sia/modules"
"gitlab.com/NebulousLabs/Sia/node/api"
"gitlab.com/NebulousLabs/Sia/skykey"
"gitlab.com/NebulousLabs/Sia/... |
package util
import (
"bytes"
"encoding/json"
"net/http"
"strconv"
"strings"
"github.com/ryanjdew/go-marklogic-go/clients"
handle "github.com/ryanjdew/go-marklogic-go/handle"
)
// Transaction represents a transaction for a request
type Transaction struct {
client *clients.Client
Name string
ID ... |
package nodemgr
import (
"bytes"
"encoding/gob"
"fmt"
"sort"
"sync"
"github.com/lbryio/claimtrie/change"
"github.com/lbryio/claimtrie/claim"
"github.com/lbryio/claimtrie/trie"
"github.com/pkg/errors"
"github.com/syndtr/goleveldb/leveldb"
)
// NodeMgr ...
type NodeMgr struct {
height claim.Height
db ... |
// Copyright 2013 M-Lab
//
// 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, s... |
package module
import (
"bytes"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/stretchr/testify/a... |
//
// Copyright (c) 2017, Cisco Systems
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditi... |
package main
import (
"fmt"
"os"
"sigs.k8s.io/kustomize/api/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/api/konfig/builtinpluginconsts"
"sigs.k8s.io/kustomize/api/resmap"
"sigs.k8s.io/kustomize/api/resource"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/fn/framework"
kyaml "sigs.k8s.io/kustomi... |
/*
Manipulation of the request to the Service.
*/
package request
import (
"github.com/Kong/go-pdk/bridge"
)
type RequestIface interface {
SetScheme(scheme string) error
SetPath(path string) error
SetRawQuery(query string) error
SetMethod(method string) error
SetQuery(query map[string][]string) error
SetHeader... |
package main
import "fmt"
const NATNetworkAddress = 255;
type IntcodeNetwork struct {
Terminals []*IntcodeTerminal;
LastAddress int;
SimulationStep int;
LastPacketId int;
PendingPackets []*IntcodePacket;
EnableNAT bool;
LastNATPacket *IntcodePacket
LastFlushedNATPacket *IntcodePacket
TotalPacketsDelivered i... |
package oberon
import (
crand "crypto/rand"
"encoding/hex"
"github.com/stretchr/testify/require"
"testing"
)
func TestProof(t *testing.T) {
// Test values don't use as real world values
nonce := []byte{138, 162, 3, 91, 76, 34, 240, 157, 149, 94, 93, 228, 214, 51, 50, 136}
skBytes := []byte{180, 92, 239, 44, 24... |
/*
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, ... |
// Copyright (c) 2020 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package badgerdb
import (
"encoding/binary"
"errors"
"fmt"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/dcrutil/v3"
"github.com/dgraph-io/badger/... |
/*
Copyright 2021 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 2020 The Crossplane 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 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... |
package idrelay
import (
"crypto/tls"
"errors"
"log"
"regexp"
"strings"
ircE "github.com/thoj/go-ircevent"
)
// StartIRC starts the IRC connection and adds the handlers
func StartIRC() error {
iConn := ircE.IRC(*config.Irc.Nick, *config.Irc.Nick)
iConn.VerboseCallbackHandler = false // DEV, use true for DEV
... |
package main
import (
"fmt"
"log"
"math"
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
)
func main() {
var mw *walk.MainWindow
var db *walk.DataBinder
pmvInput := new(PMVInput)
var acceptPB *walk.PushButton
MainWindow{
AssignTo: &mw,
Icon: "2",
Title: "计算PMV的小程序",
Layout: VBox{... |
/*
Copyright 2018 BlackRock, 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
di... |
// Copyright 2019 Drone IO, 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... |
package main
/*
Copyright 2018 - 2020 Crunchy Data Solutions, 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 applicab... |
package base
import (
"context"
"fmt"
"io"
"reflect"
"strconv"
"sync"
storagedriver "github.com/sequix/distribution/registry/storage/driver"
)
type regulator struct {
storagedriver.StorageDriver
*sync.Cond
available uint64
}
// GetLimitFromParameter takes an interface type as decoded from the YAML
// con... |
// Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "lic... |
package cmd
import (
"fmt"
"github.com/pkg/errors"
"github.com/vordev/VOR/core/store"
"github.com/vordev/VOR/core/utils"
)
// KeyStoreAuthenticator implements the Authenticate method for the store and
// a password string.
type KeyStoreAuthenticator interface {
Authenticate(*store.Store, string) (string, error... |
package task
import (
"database/sql"
"fmt"
"time"
"github.com/qingfeng777/owls/server/config"
"github.com/qingfeng777/owls/server/utils/logger"
)
func Exec(paramTask, dbTask *OwlTask) error {
if paramTask.Et == 0 {
return ExecTask(paramTask, dbTask)
}
err := taskDao.UpdateTask(&OwlTask{
ID: dbTask... |
package exporter
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/ricoberger/script_exporter/pkg/auth"
"github.com/ricoberger/script_exporter/pkg/config"
"github.com/ricoberger/script_exporter/pkg/vers... |
// Copyright 2018 The Cloudprober 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... |
// Copyright 2016 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package v2
import (
"strings"
"testing"
"github.com/nexclipper/gophercloud"
"github.com/nexclipper/gophercloud/acceptance/tools"
"github.com/nexclipper/gophercloud/openstack/messaging/v2/claims"
"github.com/nexclipper/gophercloud/openstack/messaging/v2/messages"
"github.com/nexclipper/gophercloud/openstack/mes... |
package main
import (
"errors"
"k8s.io/apimachinery/pkg/version"
"net/http"
"os/exec"
"strings"
"time"
log "github.com/Sirupsen/logrus"
// "github.com/gentics/kubernetes-zfs-provisioner/pkg/provisioner"
"github.com/chrisamti/kubernetes-zfs-provisioner/pkg/provisioner"
"github.com/kubernetes-incubator/extern... |
package api
import (
"fmt"
"github.com/replicatedhq/ship/pkg/constants"
)
// A Lifecycle is the top-level lifecycle object
type Lifecycle struct {
V1 []Step `json:"v1,omitempty" yaml:"v1,omitempty" hcl:"v1,omitempty"`
}
// Step represents vendor-customized configuration steps & messaging
type Step struct {
Mes... |
// Copyright 2018 <NAME>.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
//
// 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.a... |
package main
import (
"context"
"errors"
"fmt"
"log"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
coreinformer "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/clie... |
package client
import (
"runtime"
"strings"
"sync"
"github.com/fluffle/goirc/logging"
)
// Handlers are triggered on incoming Lines from the server, with the handler
// "name" being equivalent to Line.Cmd. Read the RFCs for details on what
// replies could come from the server. They'll generally be things like
/... |
/*
Copyright 2018 Gravitational, 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, soft... |
package client
import (
"context"
"io"
"mime/multipart"
"net/http"
"net/url"
)
// Set the URL Scheme based on the TLS settings of the Client.
func (C *SimpleClient) setScheme(URL *url.URL) {
if C.IsTLS() {
URL.Scheme = "https"
} else {
URL.Scheme = "http"
}
}
// Get is the wrapper function for an HTTP "G... |
package grav
import (
"errors"
"sync"
"sync/atomic"
)
const (
highWaterMark = 64
)
var (
errFailedMessage = errors.New("pod reports failed message")
errFailedMessageMax = errors.New("pod reports max number of failed messages, will terminate connection")
)
// connectionPool is a ring of connections to pods
... |
/*
Copyright 2020 gRPC 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, software
d... |
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Copied from inventory and modified to use our ent.Client
package viewer
import (
"context"
"database/sql"
"fmt"
"net/url"
"runtime"
"strings"
"... |
// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package namespace
import (
"sigs.k8s.io/kustomize/api/filters/fieldspec"
"sigs.k8s.io/kustomize/api/filters/filtersutil"
"sigs.k8s.io/kustomize/api/filters/fsslice"
"sigs.k8s.io/kustomize/api/types"
"sigs.k8s.io/kustomize/kyaml/kio"... |
// Copyright 2020-2021 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... |
package server
import (
"encoding/json"
"fmt"
"html/template"
"io"
"log"
"net/http"
"os"
"regexp"
"path"
"sort"
"time"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/unrolled/secure"
)
type Template struct {
templates *template.Template
}
func (t *Template) Render(... |
// Copyright (c) 2022 The nilgo authors
// Use of this source code is governed by a MIT license found in the LICENSE file.
package gcp
import (
"context"
"fmt"
"strconv"
"time"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func newLogger(options options) *zap.Logger {
cfg :=... |
// Package new generates micro service templates
package new
import (
"fmt"
"go/build"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"text/template"
"time"
"github.com/micro/cli/v2"
"github.com/micro/micro/v3/cmd"
tmpl "github.com/micro/micro/v3/internal/template"
"github.com/micro/micro/v3/internal/us... |
/*
MIT License
Copyright (c) 2020-2021 YPSI SAS
Centctl is developped by : <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 ... |
// Copyright 2019 The gVisor 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... |
// The Harness for a Revel program.
//
// It has a couple responsibilities:
// 1. Parse the user program, generating a main.go file that registers
// controller classes and starts the user's server.
// 2. Build and run the user program. Show compile errors.
// 3. Monitor the user source and re-build / restart the p... |
// Copyright 2019 Liquidata, 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... |
// Copyright (c) 2021 Terminus, 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 agree... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.