text stringlengths 3.08k 10.4k |
|---|
// Copyright 2015 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package env
import (
"context"
"fmt"
"sort"
"sync"
v1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/ty... |
package main
import (
"flag"
"fmt"
"io"
"net"
"os"
"os/signal"
"runtime"
"strings"
"syscall"
"time"
C "github.com/xjasonlyu/tun2socks/constant"
"github.com/xjasonlyu/tun2socks/core"
"github.com/xjasonlyu/tun2socks/filter"
"github.com/xjasonlyu/tun2socks/log"
"github.com/xjasonlyu/tun2socks/proxy"
"git... |
package forward
import (
"context"
"errors"
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/fatih/color"
"github.com/mutagen-io/mutagen/cmd"
"github.com/mutagen-io/mutagen/cmd/mutagen/common/templating"
"github.com/mutagen-io/mutagen/cmd/mutagen/daemon"
forwardingmodels "github.com/mutagen-io/mutagen/pkg... |
package main
import (
"context"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"os/signal"
"time"
admissionv1 "k8s.io/api/admission/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
apimetav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/... |
// Copyright 2020 <EMAIL>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
package utils
import (
"context"
"github.com/kluctl/kluctl/v2/pkg/k8s"
"github.com/kluctl/kluctl/v2/pkg/types"
k8s2 "github.com/kluctl/kluctl/v2/pkg/types/k8s"
"github.com/kluctl/kluctl/v2/pkg/utils/uo"
"golang.org/x/sync/semaphore"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/sch... |
package logic
import (
"bufio"
"fmt"
"github.com/hedzr/cmdr"
"io"
"math"
"os"
"strings"
"syreclabs.com/go/faker"
"time"
)
func dumpHacker(oo faker.FakeHacker) string {
var sb strings.Builder
sb.WriteString(fmt.Sprintf(" SaySomethingSmart : %v\n", oo.SaySomethingSmart())) // => "If we connect the bus, ... |
package controlplane
import (
"bytes"
"io"
"io/ioutil"
"mime"
"net/http"
"strings"
log "github.com/cihub/seelog"
"github.com/hailo-platform/H2O/api-proxy/session"
)
const (
// Key added by a client (to the query or body parameters) to specify a city
cityCodeKey = "city"
hobCodeKey = "hob"
)
// extracto... |
package main_test
import (
"context"
"fmt"
"github.com/nicholasblaskey/raytracer/material"
"github.com/nicholasblaskey/raytracer/matrix"
"github.com/nicholasblaskey/raytracer/tuple"
"github.com/cucumber/godog"
)
var patterns map[string]material.Pattern
func patternBefore(ctx context.Context, sc *godog.Scenar... |
package flag_test
import (
"io/ioutil"
"os"
"sort"
"strings"
"sync"
"testing"
"github.com/stretchr/testify/assert"
"github.com/posener/flag"
)
var once = sync.Once{}
func chdir() {
once.Do(func() {
os.Chdir("tests")
})
}
func constCompleter(last string) ([]string, bool) {
if strings.HasPrefix("const"... |
package btll
import (
"log"
occ "github.com/cmd-e/huffman-algorithm/occpackage"
)
// TreeNode - represent node in binary tree
type TreeNode struct {
LeftData interface{}
RightData interface{}
LeftBranchHas []rune
RightBranchHas []rune
Parent *TreeNode
Freq float64
}
// BinaryTr... |
package epsagonawswrapper
import (
"fmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
awsmetadata "github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws... |
package link
import (
"bufio"
"errors"
"fmt"
"net"
"sync"
"time"
"github.com/sirupsen/logrus"
"github.com/coschain/contentos-go/p2p/common"
"github.com/coschain/contentos-go/p2p/message/types"
)
//Link used to establish
type Link struct {
log *logrus.Logger
id uint64
addr string ... |
// Code generated from SelectStatementParser.g4 by ANTLR 4.7.2. DO NOT EDIT.
package selectparser // SelectStatementParser
import "github.com/antlr/antlr4/runtime/Go/antlr"
// BaseSelectStatementParserListener is a complete listener for a parse tree produced by SelectStatementParserParser.
type BaseSelectStatementPar... |
package totp
import (
"encoding/json"
"errors"
"io"
"io/ioutil"
"os"
"time"
"github.com/pquerna/otp/totp"
)
var errSecretNotFound = errors.New("Secret not found")
var errNoFilename = errors.New("No save target")
var errSecretNameEmpty = errors.New("Secret name empty")
var errSecretValueEmpty = errors.New("Sec... |
// Copyright 2022 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 bulk
import (
"context"
"github.com/stack11/go-exactonline/api"
"github.com/stack11/go-e... |
package siadir
import (
"os"
"path/filepath"
"sync"
"time"
"github.com/HyperspaceApp/Hyperspace/persist"
"github.com/HyperspaceApp/errors"
"github.com/HyperspaceApp/writeaheadlog"
)
const (
// persistVersion defines the Sia version that the persistence was last
// updated
persistVersion = "1.4.0"
// SiaD... |
// Copyright 2014 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 unsafeptr defines an Analyzer that checks for invalid
// conversions of uintptr to unsafe.Pointer.
package unsafeptr
import (
"go/ast"
"go/token"
... |
package command
import (
"bytes"
"encoding/json"
"fmt"
"github.com/PuerkitoBio/goquery"
sealos "github.com/fanux/sealos/install"
"github.com/wonderivan/logger"
"net/http"
"os"
"strings"
"text/template"
)
type Docker struct{}
func NewDocker() stepInterface {
var stepInterface stepInterface
stepInterface =... |
// Command screenshot is a chromedp example demonstrating how to take a
// screenshot of a specific element and of the entire browser viewport.
package main
import (
"context"
"io/ioutil"
"log"
"math"
"fmt"
"sync"
"errors"
"gopkg.in/yaml.v2"
"github.com/chromedp/cdproto/emulation"
"github.com/chromedp/cd... |
/*
Copyright The Accelerated Container Image 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 ... |
package alerting
import (
"encoding/json"
"flag"
"fmt"
"net/http"
"strconv"
"strings"
"sync"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/gorilla/mux"
"github.com/prometheus/alertmanager/template"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus... |
package fakenetwork_test
import (
"net"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
. "github.com/tigerbot/hyperdht/fakenetwork"
)
//nolint:errcheck
func TestPanics(t *testing.T) {
run := func(name string, f func()) {
defer func() {
if err := recover(); err == nil {
t.Errorf("%s did not panic", ... |
// Code generated by transpiler. DO NOT EDIT.
/**
* Go Video Downloader
*
* Copyright 2019 Tenta, 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.or... |
package client
import (
"container/list"
"time"
"github.com/juju/errors"
"github.com/ngaut/log"
"github.com/ngaut/tso/proto"
"github.com/ngaut/tso/util"
"github.com/ngaut/zkhelper"
)
const (
maxPipelineRequest = 100000
)
// Client is a timestamp oracle client.
type Client struct {
requests chan *PipelineRe... |
package handlers
import (
"context"
"crypto/sha256"
"local/gin/gin-recipes-api/models"
"net/http"
"os"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/gin-contrib/opengintracing"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
"github.com/opentracing/opentracing-go"
"github.com/rs/xid"
"go.... |
/*
Copyright 2020 The KubeSphere 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 Banrai LLC. All rights reserved. Use of this source code is
// governed by the license that can be found in the LICENSE file.
package ui
import (
"database/sql"
"github.com/Banrai/TeamWork.io/server/database"
"log"
"net/http"
"strings"
)
type Recipient struct {
Person *database.PERSON
Keys []*d... |
package transportc
import (
"encoding/json"
"github.com/pion/webrtc/v3"
)
func (c *WebRTConn) Status() WebRTConnStatus {
defer c.lock.RUnlock()
c.lock.RLock()
status := c.status
return status
}
func (c *WebRTConn) LastError() error {
defer c.lock.RUnlock()
c.lock.RLock()
err := c.lasterr
c.lasterr = nil
... |
package scraper
import (
"bufio"
"encoding/base64"
"fmt"
"io"
"log"
"os"
"sync"
"time"
"google.golang.org/api/gmail/v1"
)
const userID = "me"
// Scrape will extract attachments contained in mails sent by a specific email.
func Scrape(service *gmail.Service) {
osf := os.Stdin
emailThatSentAttach := getEma... |
// Code generated by protoc-gen-go.
// source: install_log.proto
// DO NOT EDIT!
/*
Package cisco_ios_xr_spirit_install_instmgr_oper_software_install_last_n_operation_logs_last_n_operation_log_summary is a generated protocol buffer package.
It is generated from these files:
install_log.proto
It has these top-level ... |
package fluent
import (
"fmt"
"github.com/lus/fluent.go/fluent/parser/ast"
"golang.org/x/text/language"
"strings"
)
// Bundle represents a collection of messages and terms collected from one or many resources.
// It provides the main API to format messages.
type Bundle struct {
locales []language.Tag
messages ... |
/*
* Copyright 2018 Comcast Cable Communications Management, 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 require... |
/*
*
* Copyright 2020-present Arpabet, 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 ... |
// This project is licensed under the MIT License (see LICENSE).
package tidepool
import (
"tidepool/tidepool/gene"
)
const (
VM_NOOP int = iota
VM_BREAK
VM_CONTINUE
)
type VM struct {
ctx *Context
genomeIdx int32
genomeMaxIdx int32
loopStack []int32
loopStackIdx int32
loop... |
package apns
import "bytes"
import "encoding/binary"
import "encoding/hex"
import "encoding/json"
import "errors"
// Notification Payload
// https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW1... |
/*
* Copyright 2018 Insolar
*
* 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 controller_test
import (
"reflect"
"strconv"
"strings"
"testing"
"github.com/fabric8-services/fabric8-wit/app"
"github.com/fabric8-services/fabric8-wit/app/test"
. "github.com/fabric8-services/fabric8-wit/controller"
"github.com/fabric8-services/fabric8-wit/gormtestsupport"
"github.com/fabric8-servic... |
package genetic
import (
"math/rand"
"optimize/function"
"time"
)
type Population2 struct {
population []function.Point
generation int
maxGen int
min function.Point
r *rand.Rand
}
func NewPopulation2(size, generations int) *Population2 {
return &Population2{
population: make([]function.Point, size)... |
package database
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"os"
"sync"
"github.com/TopHatCroat/CryptoChat-server/helpers"
"github.com/TopHatCroat/CryptoChat-server/constants"
"reflect"
"errors"
"log"
"fmt"
)
var (
DATABASE_NAME = "baza"
DATABASE_PATH = "./" + DATABASE_NAME + ".db"
db ... |
package xmpp
import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"regexp"
"strconv"
log "github.com/sirupsen/logrus"
"github.com/zmap/zgrab2"
)
type Flags struct {
zgrab2.BaseFlags
zgrab2.TLSFlags
Stanza string `long:"stanza" default:"<stream:stream xmlns='jabber:client'\\nxmlns:stream='http://etherx.jab... |
package agent
import (
"bytes"
"github.com/golang/glog"
. "github.com/infradash/dash/pkg/dash"
"github.com/qorio/maestro/pkg/docker"
"github.com/qorio/maestro/pkg/zk"
"strings"
"text/template"
)
var (
image_counter = map[string]int{}
)
func NoActions() []Task {
return []Task{}
}
func get_sequence_by_image(... |
package modules
import (
"bytes"
"context"
"fmt"
"io"
"net"
"sync/atomic"
"time"
"github.com/buguang01/bige/messages"
"github.com/buguang01/util/threads"
"github.com/buguang01/Logger"
)
func SocketSetPort(ipport string) options {
return func(mod IModule) {
mod.(*SocketModule).ipPort = ipport
}
}
//超时... |
package cloudcallcenter
//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 cki
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"errors"
"io"
"math/big"
"github.com/vmihailenco/msgpack/v5"
"golang.org/x/crypto/sha3"
)
//GenerateECKey generates a new private/public key from a given accepted OCS curve based algorithm
func GenerateECKey(a Algorithm) (*SecpPubl... |
// Copyright (c) 2017 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... |
/*
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 lxPdf
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
"net/url"
"os"
"path/filepath"
)
// IPdf, interface for pdf service
type IPdf interface {
CreatePdf(template string, data map[string]interface{}, opts ...*options) ([]byte, error)
}
type pdf struct {
... |
package gcp
import (
"bytes"
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/plugin"
"github.com/turbot/steampipe-plugin-sdk/plugin/transform"
"google.golang.org/api/option"
)
func getLastPathElement(path string) ... |
/*
Copyright (c) 2019 the Octant contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package printer
import (
"context"
"fmt"
"github.com/pkg/errors"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/vmware/octant/pkg/view/component"
)
// DaemonSetListHandler is ... |
// Copyright 2012 The llgo Authors.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"fmt"
"go/build"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
)
var (
pepper string
llvmconfig string
llvmversion str... |
package renderer
import (
"github.com/PucklaMotzer09/GoHomeEngine/src/gohome"
"github.com/go-gl/gl/all-core/gl"
"image"
"image/color"
"unsafe"
)
type OpenGLCubeMap struct {
name string
oglName uint32
width int
height int
shadowMap bool
}
func (this *OpenGLCubeMap) GetName() string {
return t... |
/*
* This file is part of the Routine project.
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"path/f... |
/*
Copyright NetFoundry, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
/*
* Synthetics Monitoring API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 202101beta1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package synthetics
import (
"encoding/json"
)
// ... |
package registration
import (
"context"
"errors"
"fmt"
"time"
"github.com/RagOfJoes/mylo/internal"
"github.com/RagOfJoes/mylo/internal/config"
"github.com/RagOfJoes/mylo/internal/validate"
"github.com/RagOfJoes/mylo/pkg/nanoid"
"github.com/RagOfJoes/mylo/ui/form"
"github.com/RagOfJoes/mylo/ui/node"
"github... |
// Copyright © 2018 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: BSD-2-Clause
package processors
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/vmware/kube-fluentd-operator/config-reloader/fluentd"
)
func TestMakeRewriteTagFragment(t *testing.T) {
frag, err := makeRewriteTa... |
package models
// It is very important that NewValueSetMap gets called to get a populated ValueSetMap
type ValueSetMap map[string][]CodeSet
func NewValueSetMap(vs []ValueSet) ValueSetMap {
vsMap := make(ValueSetMap)
for _, valueSet := range vs {
vsMap[valueSet.Oid] = valueSet.CodeSetMap()
}
return vsMap
}
// V... |
package scl
import (
"fmt"
"unicode"
)
type variable struct {
name string
value string
}
type mixin struct {
declaration *scannerLine
arguments []variable
defaults []string
}
type scope struct {
parent *scope
branch *scannerLine
branchScope *scope
variables map[string]*variable
mixins ... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the Li... |
// Copyright 2020 <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, sof... |
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law o... |
package cluster
import (
"golina/matrix"
"log"
"math"
"math/rand"
)
type Kernel func(x, y *matrix.Vector) float64
// SVM based on SMO (http://cs229.stanford.edu/materials/smo.pdf)
// Input:
// C: regularization parameter
// tol: numerical tolerance
// maxIter: max # of times to iterate over α’s without changing
... |
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strings"
"time"
dapr "github.com/dapr/go-sdk/client"
"github.com/dapr/go-sdk/service/common"
daprd "github.com/dapr/go-sdk/service/grpc"
"github.com/pkg/errors"
)
const (
languageDefault = "en"
se... |
/*
* Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
* Copyright 2020-present Open Networking Foundation
* 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://w... |
package moexiss
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"runtime"
"strings"
)
// Global constants.
const (
libraryName = "MoEx ISS"
libraryVersion = "v0.0.1"
defaultBaseURL = "https://iss.moex.com/iss/"
)
// User Agent should always following the below style.
//
// ... |
// bloom.go - Bloom filter.
// Written in 2015 by <NAME>
//
// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this software to the public domain
// worldwide. This software is distributed without any warranty.
//
// You should have received a copy o... |
package main
import (
//"bufio"
"fmt"
"log"
"os"
//"strconv"
//"strings"
"github.com/ChimeraCoder/anaconda"
. "github.com/gbin/goncurses"
xdg "launchpad.net/go-xdg"
"time"
)
func main() {
// check to see if the config file exists
// if it doesn't, create it and ask for API keys
var tweets []anaconda.Twe... |
package grpcexpect
import (
"context"
"io"
"net/http"
"reflect"
"sync"
"github.com/fullstorydev/grpcurl"
"github.com/golang/protobuf/proto"
otgrpc "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/dynamic"
"github.com/jhum... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package lightsail
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for AWS::Lightsail::Instance
func LookupIn... |
package sspai_column
import (
"fmt"
"net/http"
"strings"
"time"
"github.com/chyroc/go-lambda"
"github.com/chyroc/grss/internal/fetch"
"github.com/chyroc/grss/internal/helper"
)
// args: map[string]string{"id": "264"}
// args: map[string]string{"id": "266"}
func New(args map[string]string) (*fetch.Source, erro... |
/*
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 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... |
package mytoolkits
import (
"fmt"
)
func ExampleRemoveDuplicatesFromSliceString() {
// Create a slice of string
strSlice := []string{
"aaaaaa",
"bbbbbb",
"cccccc",
"aaaaaa",
"dddddd",
"cccccc",
}
//Remove all duplicates in the slice strSlice and save the result in tmpSlice
tmpSlic... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019 Datadog, Inc.
package service
import (
"context"
"strconv"
"time"
corev1 "k8s.io/api/core... |
package bundlec
import (
"fmt"
"reflect"
"regexp"
"unicode/utf8"
smith_v1 "github.com/atlassian/smith/pkg/apis/smith/v1"
"github.com/atlassian/smith/pkg/resources"
"github.com/pkg/errors"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
)
var (
// ?s allows us to match multiline expressions.
reference = re... |
// Copyright © 2018 Camunda Services GmbH (<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 applicabl... |
// Package prioqueue implements an efficient min and max priority queue using a
// binary heap encoded in a slice.
package prioqueue
// MaxHeap implements a priority queue which allows to retrieve the highest
// priority element using a heap. Since the heap is maintained in form of a
// binary tree, it can efficiently... |
package main
import (
"errors"
"image"
"log"
"math/rand"
"time"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
"github.com/hajimehoshi/ebiten/v2/inpututil"
"github.com/sinisterstuf/dynamo/media"
)
// Levels maps level difficulty indices to maze size scaling factors
var Leve... |
package fzfwrapper
import (
"bytes"
"fmt"
"sort"
"github.com/fatih/color"
"github.com/junegunn/fzf/src"
)
// Sort criteria
type criterion int
const (
ByScore criterion = iota // sort by score
ByLength // sort by string length
ByPosition // sort by match location
maxI... |
package alicloud
import (
"context"
"encoding/json"
"fmt"
"math"
"strings"
"time"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/aliyun/alibaba-cloud-sdk-go/services/cms"
"github.com/sethvargo/go-retry"
"github.com/turbot/steampipe-plugin-sdk/grpc/proto"
"github.com/turbot/steampipe-plugin... |
package snmp
import (
"errors"
"fmt"
"strings"
"time"
"github.com/DataDog/datadog-agent/pkg/aggregator"
"github.com/DataDog/datadog-agent/pkg/autodiscovery/integration"
"github.com/DataDog/datadog-agent/pkg/collector/check"
core "github.com/DataDog/datadog-agent/pkg/collector/corechecks"
"github.com/DataDog/... |
package player
import (
"context"
"errors"
"log"
"time"
device "github.com/gotracker/gosound"
"gotracker/internal/player/intf"
"gotracker/internal/song"
)
type playerState int
const (
playerStateIdle = playerState(iota)
playerStatePlaying
playerStatePaused
playerStateStopped
)
// Player is a player of ... |
package bitrix24
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
"github.com/skratchdot/open-golang/open"
"net/http"
"fmt"
"encoding/json"
"log"
"net/url"
"time"
. "bitrix24/interfaces"
)
const (
URL_SERVER = "http://localhost"
PORT_SERVER = ":8081"
DOMAIN = "demoapplic.bitr... |
package lcp
import (
"fmt"
"net"
"sync"
)
// IPv4AddrOption represents IPCP option contains a single v4 addr like IP-Addr, DNS
type IPv4AddrOption struct {
Addr net.IP
AddrType IPCPOptionType
}
// Serialize implments Option interface
func (addr *IPv4AddrOption) Serialize() ([]byte, error) {
buf := make([]b... |
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
package sseclient
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"strconv"
)
// The Decoder interface describes how to implement a SSE stream decoder.
// MakeContainer() should take the name of the event and return a suitable
// struct that satisfies the Event interface.
type Decoder interface {
MakeContainer(... |
package cliutils
import (
"os"
"strings"
"github.com/codegangsta/cli"
"github.com/jfrog/jfrog-cli-core/utils/coreutils"
"github.com/jfrog/jfrog-cli/utils/summary"
serviceutils "github.com/jfrog/jfrog-client-go/artifactory/services/utils"
"github.com/jfrog/jfrog-client-go/utils"
clientutils "github.com/jfrog/j... |
package nodeanalyzer
import (
"encoding/json"
"errors"
"fmt"
"os"
"strings"
"time"
"github.com/hyperpilotio/node-agent/pkg/common"
"github.com/hyperpilotio/node-agent/pkg/snap"
log "github.com/sirupsen/logrus"
)
type NodeAnalyzer struct {
initialized bool
DerivedMetrics *DerivedMetrics
Normalize... |
// Copyright 2022 The CubeFS 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 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os/exec"
"strconv"
"strings"
)
type Builder struct {
CorpId string
AppSecret string
Users string
Partys string
Tags string
AgentId string
MsgType string
Message string
Payload TextCard
}
fun... |
//nolint:unused
package main
import (
"context"
"encoding/json"
"os/exec"
"strings"
"sync"
"time"
"github.com/thomas-maurice/gowerline/gowerline-server/plugins"
"github.com/thomas-maurice/gowerline/gowerline-server/types"
"go.uber.org/zap"
)
var (
cfg Config
stopChannel chan bool
stoppedCha... |
package manager
import (
"context"
"fmt"
"sort"
"sync"
"time"
"github.com/rinx/alvd/internal/errors"
"github.com/rinx/alvd/internal/log"
"github.com/rinx/alvd/pkg/alvd/server/service/tunnel"
"github.com/vdaas/vald/apis/grpc/v1/agent/core"
"github.com/vdaas/vald/apis/grpc/v1/payload"
"github.com/vdaas/vald/... |
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Domainedgesoftwareupdatedto
type Domainedgesoftwareupdatedto struct {
// Version - Version
Version *Domainedgesoftwareversiondto `json:"version,omitempty"`
// MaxDownloadRate
MaxDownloadRate *in... |
package main
import (
"log"
"io/ioutil"
//"fmt"
//"net/http"
//"io"
//"os"
//"mime/multipart"
//"bytes"
"github.com/streadway/amqp"
"github.com/quirkey/magick"
"github.com/golang/protobuf/proto"
pb "github.com/fercamp09/elastic-transcoder/tasks"
)
func failOnError(err error, msg string) {
if err != nil {... |
package cluster
import (
"bytes"
"crypto/sha1"
"encoding/hex"
"fmt"
"time"
"strings"
"sync"
"github.com/armon/consul-api"
"github.com/vektra/vega"
)
type consulRoutingTable struct {
selfId []byte
key string
names map[string]bool
lock sync.RWMutex
local vega.RouteTable
consul *consulapi.Client
... |
package main
import (
"errors"
"flag"
"fmt"
"net/http"
"strings"
"sync"
"github.com/nuvo/emq_exporter/internal/client"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
const (
namespace = "emq"... |
//
// BSD 3-Clause License
//
// Copyright (c) 2018, <NAME>
// 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.