text stringlengths 3.08k 10.4k |
|---|
// 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 ... |
/*
MIT License
Copyright (c) Nhost
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, s... |
package space
import (
"context"
"fmt"
"path/filepath"
"sync"
"github.com/brimsec/zq/pkg/nano"
"github.com/brimsec/zq/zqd/api"
"github.com/brimsec/zq/zqd/storage"
"github.com/brimsec/zq/zqd/storage/archivestore"
"github.com/brimsec/zq/zqd/storage/filestore"
"github.com/brimsec/zq/zqe"
"github.com/segmentio... |
/*
Copyright 2014 The Camlistore 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 (
"bufio"
"fmt"
"strings"
)
var amphipods = map[string]int{
"A": 1,
"B": 10,
"C": 100,
"D": 1000,
}
var amphiString = map[int]string{
0: ".",
1: "A",
10: "B",
100: "C",
1000: "D",
}
var targetAmphi = []int{1, 10, 100, 1000}
var targetRoom = map[int]int{
1: 0,
10: 1,
... |
// Copyright 2018 The OpenPitrix Authors. All rights reserved.
// Use of this source code is governed by a Apache license
// that can be found in the LICENSE file.
package gerr
import "fmt"
type ErrorMessage struct {
Name string
En string
}
func (em ErrorMessage) Message(locale string, a ...interface{}) string ... |
// Package ascii_donut
// Created by Teocci.
// Author: <EMAIL> on 2021-09-01
// Based on [Donut math: how donut.c works](https://www.a1k0n.net/2011/07/20/donut-math.html)
package main
import (
"fmt"
"math"
"os"
"os/signal"
"syscall"
"time"
"github.com/teocci/go-csv-samples/src/iolive"
)
const (
luminance ... |
package aws
import (
"context"
"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/applicationa... |
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package document provides common utilities for performing comparison between
// documents produced during testing.
package document
import (
"cont... |
package encryptionconfig
import (
"encoding/base64"
"sort"
"k8s.io/apimachinery/pkg/runtime/schema"
apiserverconfigv1 "k8s.io/apiserver/pkg/apis/config/v1"
"k8s.io/klog"
"github.com/openshift/library-go/pkg/operator/encryption/crypto"
"github.com/openshift/library-go/pkg/operator/encryption/state"
)
var (
e... |
package collectors
import (
"regexp"
"strconv"
"strings"
"time"
"code.cloudfoundry.org/bytefmt"
"github.com/diarworld/nifi_exporter/nifi/client"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
)
type clusterMetrics struct {
totalNodes *prometheus.Desc
connectedNode... |
// Copyright 2020 Northern.tech AS
//
// 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 (c) 2020 - present Kurtosis Technologies LLC.
* All Rights Reserved.
*/
package client
import (
"encoding/json"
"fmt"
"github.com/kurtosis-tech/kurtosis-go/lib/kurtosis_service"
"github.com/kurtosis-tech/kurtosis-go/lib/networks"
"github.com/kurtosis-tech/kurtosis-go/lib/testsuite"
"github.com... |
// Copyright 2017 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... |
package main
import (
"flag"
"github.com/cyrilix/robocar-base/cli"
actuator2 "github.com/cyrilix/robocar-pca9685/pkg/actuator"
"github.com/cyrilix/robocar-pca9685/pkg/part"
"go.uber.org/zap"
"log"
"os"
)
const (
DefaultClientId = "robocar-pca9685"
SteeringChannel = 0
ThrottleChannel = 1
ThrottleStoppedPWM... |
// Copyright © 2018-2019 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 o... |
// *** 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 powerbidedicated
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Represents an instance of an a... |
// Copyright 2016-2020, 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 masker
import (
"crypto/sha1"
"fmt"
"github.com/practo/tipoca-stream/pkg/redshift"
"github.com/practo/tipoca-stream/pkg/serializer"
"github.com/practo/tipoca-stream/pkg/transformer"
"strconv"
"strings"
)
const (
MOBILE_KEYS_EXPOSED_LENGTH = 5
)
type masker struct {
salt string
database string
... |
/**
* Copyright 2018 gd Author. All Rights Reserved.
* Author: Chuck1024
*/
package discovery
import (
"encoding/json"
"fmt"
"github.com/chuck1024/gd/dlog"
"github.com/chuck1024/gd/server"
"github.com/samuel/go-zookeeper/zk"
"sync"
"time"
)
type ZkNode struct {
node string
nodesInfo []server.NodeInf... |
/*
* Copyright 2018- The Pixie Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... |
package kubernetes
import (
"encoding/json"
"fmt"
"io"
"strconv"
"strings"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promscrape/discoveryutils"
)
func (p *Pod) key() string {
return p.Metadata.key()
}
func parsePodList(r io.Reader) (map[string]object, ListMeta, error) {
var pl PodList
d := json.NewDe... |
// Copyright 2015 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 ssa
// layout orders basic blocks in f with the goal of minimizing control flow instructions.
// After this phase returns, the order of f.Blocks matter... |
/*
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 templater
import (
"bytes"
"errors"
"fmt"
"strings"
"text/template"
"github.com/CubicrootXYZ/openapi-code-sample-generator/internal/log"
"github.com/CubicrootXYZ/openapi-code-sample-generator/internal/types"
"github.com/getkin/kin-openapi/openapi3"
)
var ErrMissingEncoder = errors.New("missing encode... |
/*
Copyright 2018 Oracle and/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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable la... |
package controllers
import (
v1 "alexellis/registry-creds/api/v1"
"context"
"fmt"
"strings"
ctrl "sigs.k8s.io/controller-runtime"
"github.com/go-logr/logr"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.... |
package udp
import (
"context"
"fmt"
"net"
"strconv"
"strings"
"github.com/sdslabs/pinger/pkg/checker"
)
const (
// checkerName is the name of the checker.
checkerName = "UDP"
// messageType is the type of output for checking message
messageType = "MESSAGE"
// timeoutType is the type of output for check... |
package node
import (
"errors"
"fmt"
"path/filepath"
"sync"
"github.com/dgraph-io/badger/v2/options"
"github.com/ipfs/go-datastore"
dsbadger "github.com/ipfs/go-ds-badger2"
"github.com/mitchellh/go-homedir"
"github.com/celestiaorg/celestia-node/libs/fslock"
"github.com/celestiaorg/celestia-node/libs/keysto... |
// Copyright 2019 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 w... |
// Copyright 2018 The go-exactonline AUTHORS. All rights reserved.
//
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Code generated by gen-services.go; DO NOT EDIT.
package financialtransaction
import (
"context"
"github.com/mcnijman/go-exactonline/api"
"github... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package route53
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"
)
// A complex type that contains information about the request to create a h... |
/*
Copyright (c) 2015, Alcatel-Lucent Inc
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 condi... |
package lib
import (
"fmt"
"strconv"
"strings"
clients "github.com/litmuschaos/litmus-go/pkg/clients"
"github.com/litmuschaos/litmus-go/pkg/events"
experimentTypes "github.com/litmuschaos/litmus-go/pkg/generic/node-taint/types"
"github.com/litmuschaos/litmus-go/pkg/log"
"github.com/litmuschaos/litmus-go/pkg/s... |
package utils
import (
"fmt"
"io"
"os"
"strings"
"sync"
"time"
"github.com/arthurkiller/rollingwriter"
"go.uber.org/multierr"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var (
logger *LoggerWrapper
loggerOnce sync.Once
)
// InitLog 初始化日志结构体 Logger 与 SugarLogger
func InitLog(opts *LoggerOptions) {
... |
package gofromto
// Conversion holds the rules of how to convert from one unit to another
type Conversion struct {
From Unit
To Unit
Conversion func(amount float64) float64
Precise bool
}
// ConversionList a list of all defined conversions. There is a full mapping in ConversionMap that is generat... |
// Copyright 2019 Dolthub, 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 main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"sort"
"strings"
"gopkg.in/yaml.v2"
)
// The Generator is used to generate compilable go code from a yaml configuration
type Generator struct {
Config Config
Debug bool
Logger io.Writer
}
// NewGenerator creates a new Generator instance
func NewG... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package dynamicselection
import (
"fmt"
"sync"
"github.com/hyperledger/fabric-sdk-go/api/apiconfig"
fab "github.com/hyperledger/fabric-sdk-go/api/apifabclient"
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk"
... |
// Copyright 2015 The Chromium 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 buildextract contains structs useful in deserializing json data from
// CBE, e.g. https://chrome-build-extract.appspot.com/get_master/chromium
... |
package server
import (
"errors"
"fmt"
"mime"
"net/http"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
"github.com/gin-gonic/gin"
"github.com/marcboeker/supertar/archive"
"github.com/marcboeker/supertar/item"
)
var (
mutex = sync.Mutex{}
)
// Server holds the archive together with the item cache.
t... |
package vpn
import (
"bufio"
"crypto/tls"
"encoding/hex"
"fmt"
"net"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
"strings"
"github.com/genshen/cmds"
plugin "github.com/genshen/wssocks/client"
"github.com/genshen/wssocks/cmd/client"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/ssh/terminal"
... |
//
// Copyright 2021 The Sigstore 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 service
import (
"github.com/SkyAPM/SkyAPM-php-sdk/reporter/logger"
nla1 "github.com/SkyAPM/SkyAPM-php-sdk/reporter/network/language/agent/v1"
nla2 "github.com/SkyAPM/SkyAPM-php-sdk/reporter/network/language/agent/v2"
nla3 "github.com/SkyAPM/SkyAPM-php-sdk/reporter/network/language/agent/v3"
nm3 "github.c... |
package stream
import (
"fmt"
"net/url"
"strconv"
"strings"
)
type (
//IStreamQueryParamsBuilder is the interface for StreamQueryParamBuilder.
IStreamQueryParamsBuilder interface {
AddBackFillMinutes(minutes uint) *StreamQueryParamBuilder
AddExpansion(expansion string) *StreamQueryParamBuilder
AddMediaFie... |
package RunningCommand
import (
"bufio"
"fmt"
. "github.com/francoishill/golang-web-dry/errors/checkerror"
"os"
"os/exec"
"strings"
"sync"
"time"
)
type RunningCommand struct {
appendLock sync.RWMutex
commandDoneLock sync.RWMutex
OnFinishAction actionOnFinish
AdditionalObject interface{}
WorkingD... |
package parser
import (
"fmt"
"reflect"
"testing"
)
func fmtimport() {
fmt.Println()
}
func matchType(t *testing.T, st IStatement, ref interface{}) {
if reflect.TypeOf(st) != reflect.TypeOf(ref) {
t.Fatalf("expect type[%v] not match[%v]", reflect.TypeOf(ref), reflect.TypeOf(st))
}
}
func matchSchemas(t *tes... |
/**
* @Author :jerry
* @Version :1.0.0
* @Date :下午7:12 19-8-12
* @Description : timeutils to help you
(1) get time in specified type,
(2) and format time to specified pattern,
(3) parse time with specified pattern.
*/
package timeutils
import (
"time"
)
const pATTERN string = "2006-01... |
package install
import (
"fmt"
"github.com/kubesphere-sigs/ks/kubectl-plugin/common"
"github.com/kubesphere-sigs/ks/kubectl-plugin/install/installer"
"github.com/kubesphere-sigs/ks/kubectl-plugin/install/storage"
"github.com/kubesphere-sigs/ks/kubectl-plugin/types"
"github.com/spf13/cobra"
"html/template"
"k8s... |
package kotsadm
import (
"fmt"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
func webConfig(deployOptions DeployOptions) *corev1.ConfigMap {
configMap := &corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
APIVersion... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package monitoring
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// A NotificationChannel is a medium through whic... |
package main
import (
"regexp"
"github.com/jangler/edit"
)
var (
spaceRegexp = regexp.MustCompile(`\s`)
wordRegexp = regexp.MustCompile(`\w`)
)
// find attempts a regexp search in the buffer and returns a status message.
func find(b *edit.Buffer, re *regexp.Regexp, forward bool,
defaultStatus string) string {... |
package elephant
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
bigtopBirthday = nook.Birthday{
Day: 3,
Mo... |
// Copyright 2016. Amazon Web Services, 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 require... |
package staff
import (
"context"
"git.900sui.cn/kc/rpcinterface/client"
"git.900sui.cn/kc/rpcinterface/interface/staff"
)
// 定义rpc客户端调用方法
// @author liyang<<EMAIL>>
// @date 2020/4/1 18:33
type Staff struct {
client.Baseclient
}
//初始化
func (s *Staff)Init() *Staff {
s.ServiceName = "rpc_staff"
s.ServicePath =... |
package ascode
import (
"context"
"time"
"github.com/go-gorp/gorp"
"github.com/ovh/cds/engine/api/cache"
"github.com/ovh/cds/engine/api/operation"
"github.com/ovh/cds/engine/api/repositoriesmanager"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/log"
)
const (
AsCodePipeline = "pipeline"
AsCodeWorkflow ... |
// Copyright (c) 2015-2022 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (... |
// Licensed to The Moov Authors under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. The Moov Authors licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this... |
package indicators
import (
"container/list"
"errors"
"github.com/jaybutera/gotrade"
"math"
)
// A Highest High Value Bars Indicator (HhvBars), no storage, for use in other indicators
type HhvBarsWithoutStorage struct {
*baseIndicatorWithIntBounds
// private variables
periodHistory *list.List
currentHigh ... |
package channels
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/notifications"
"github.com/prometheus/alertmanager/template"
"github.com/prometheus/alertmanager/types"
"g... |
// Copyright 2018 Owkin, 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... |
package metricsbp
import (
"fmt"
"os"
"runtime"
"sync"
"time"
"github.com/go-kit/kit/metrics"
)
// SysStatsTickerInterval is the interval we pull and report sys stats.
// Default is 10 seconds.
var SysStatsTickerInterval = time.Second * 10
var activeRequestCounter int64
type cpuStats struct {
NumGoroutine i... |
package pg
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"github.com/pkg/errors"
"github.com/chef/automate/lib/platform/command"
)
type ConnInfoURI interface {
// ConnURI returns a string suitable for passing to the
// database/sql libraries or other tools that accept libpq
// connection URIs.... |
package styledprinter
import (
"fmt"
"regexp"
"strings"
)
var (
// escapeRegexp = regexp.MustCompile(`[^\\]?<`)
tagRegexp = regexp.MustCompile(`(?i)<([a-z][^<>]*|/([a-z][^<>]*)?)>`)
lineEndRegexp = regexp.MustCompile(` *(\r?\n)`)
)
// escape will prepend all '<' with a backslash
// func escape(text string... |
package drum
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"log"
"math"
"regexp"
)
// Pattern is the high level representation of the
// drum pattern contained in a .splice file.
type Pattern struct {
hwVersion string
tempo float32
instrumentNames []string
instrumentIds map[string]int
inst... |
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"goa.design/goa/codegen"
"goa.design/goa/pkg"
)
// Generator is the code generation management data structure.
type Generator struct {
// Command is the name of the command to run.
Command string
// DesignPath is ... |
// Copyright 2022 Staex GmbH (https://staex.io)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agree... |
//
// Copyright 2018 Atos
//
// ROTTERDAM application
// CLASS Project: https://class-project.eu/
//
// 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/LI... |
package geo2city
import (
"encoding/json"
"errors"
"github.com/kellydunn/golang-geo"
"io/ioutil"
"os"
"strconv"
"strings"
)
const (
COUNTRY = iota
PROVINCE = iota
CITY = iota
DISTRICT = iota
STREET = iota
)
var le *locationEngin
func init() {
le = newLocationEngin()
}
func LocationParseEngin(pa... |
// Copyright (c) 2017, <NAME> All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"regexp"
"sort"
"string... |
package munn
import (
"time"
)
// Portfolio represents a person's financial portfolio.
type Portfolio struct {
Accounts []*Account
Transactions []*Transaction
ManualAdjustments []*ManualAdjustment
RetirementPlan *RetirementPlan
Debug bool
}
// TotalBalance gets the c... |
package role
import (
"fmt"
"strings"
"github.com/infraboard/keyauth/pkg/token"
"github.com/infraboard/mcube/http/request"
"github.com/infraboard/mcube/types/ftime"
"github.com/rs/xid"
"github.com/infraboard/keyauth/pkg/endpoint"
)
const (
// MaxPermissionCount 一个角色最多可以容纳的权限条数
MaxPermissionCount = 500
)
/... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package zcapld_test
import (
"fmt"
"testing"
"github.com/google/uuid"
"github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld"
"github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite"
"g... |
// A golang implementation of the acme factory examples from python and Java APIs
//
// The python implementation is in mmv.py in PCP core
// (https://github.com/performancecopilot/pcp/blob/master/src/python/pcp/mmv.py#L21-L70)
//
// The Java implementation is in examples in parfait core
// (https://github.com/performa... |
package database
//
// Consumers of this package need to add this import line:
//
// _ "github.com/go-sql-driver/mysql"
//
import (
"database/sql"
"fmt"
"time"
)
// Ship holds all the information we get back from the web service about a single ship.
type Ship struct {
// Stored in db ...
MMSI strin... |
/*
Copyright 2015 <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
distribute... |
package design
import (
. "goa.design/goa/v3/dsl"
_ "goa.design/plugins/v3/docs" // Generates documentation
_ "goa.design/plugins/v3/goakit" // Enables goakit
_ "goa.design/plugins/v3/zaplogger" // Enables ZapLogger Plugin
)
var CommonResult = Type("CommonResult", func() {
Description("Common Result for ... |
/*******************************************************************************
* Copyright 2018 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... |
package main
import (
"context"
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
"time"
bserv "github.com/ipfs/go-ipfs/blockservice"
"github.com/ipfs/go-ipfs/exchange/bitswap"
bsnet "github.com/ipfs/go-ipfs/exchange/bitswap/network"
dag "github.com/ipfs/go-ipfs/merkledag"
inet "gx/ipfs/QmPjvxTpVH8qJyQDnxns... |
package main
import (
"encoding/json"
"fmt"
"html/template"
"io"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/pkg/errors"
flag "github.com/spf13/pflag"
)
var (
Version = "dev"
Commit = "none"
)
type Config struct {
Values []Value `json:"values"`
Targets []Target `json:... |
package main
import (
//"crypto/ecdsa"
//"crypto/elliptic"
//"crypto/rand"
//"crypto/sha256"
"fmt"
"math/big"
//"math"
"errors"
"log"
)
type Point struct {
x big.Int
y big.Int
}
func ec_valid(P *Point) error {
//fmt.Printf("%t\n", P)
// The characteristic of secp256k1; the order of the corresponding fi... |
package stack
import (
"github.com/xplorfin/moneysocket-go/moneysocket/beacon"
"github.com/xplorfin/moneysocket-go/moneysocket/layer"
"github.com/xplorfin/moneysocket-go/moneysocket/layer/compat"
"github.com/xplorfin/moneysocket-go/moneysocket/layer/consumer"
"github.com/xplorfin/moneysocket-go/moneysocket/layer/... |
// Copyright (c) 2021- Stripe, Inc. (https://stripe.com)
// This code is licensed under MIT license (see LICENSE-MIT for details)
// Copyright 2022 Praetorian Security, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... |
package kms
import (
"fmt"
"os"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/kms"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/pkg/e... |
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Klaxoninteractionstatsalertstopicinteractionstatalert
type Klaxoninteractionstatsalertstopicinteractionstatalert struct {
// Id
Id *string `json:"id,omitempty"`
// Name
Name *string `json:"name,... |
package elasticsearch
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
// EsConnection details to the ElasticSearch database
type EsConnection struct {
Port string
URL string
Namespace string
}
// EsSpan maps spans data from ES REST API response
// API endpoint: /<index>/_search?for... |
// Copyright 2019 cruzbit developers
// Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
package cruzbit
import (
"bytes"
"container/list"
"encoding/base64"
"fmt"
"sync"
)
// TransactionQueueMemory is an in-memory FIFO implementation of the TransactionQueue inter... |
package importer
import (
"fmt"
"github.com/cjnosal/manifer/v2/pkg/file"
"github.com/cjnosal/manifer/v2/pkg/library"
"github.com/cjnosal/manifer/v2/pkg/processor"
"github.com/cjnosal/manifer/v2/pkg/processor/factory"
"os"
"path/filepath"
"sort"
"strings"
)
type Importer interface {
Import(libType library.Ty... |
/*
* Copyright (c) 2019 Ready Stock
*
* 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 dnscrypt
import (
"bytes"
"crypto/ed25519"
"encoding/binary"
"fmt"
"time"
)
// Cert - DNSCrypt server certificate
// See ResolverConfig for more info on how to create one
type Cert struct {
// Serial - a 4 byte serial number in big-endian format. If more than
// one certificates are valid, the client m... |
package nodes
import (
"fmt"
"strings"
"github.com/annismckenzie/k3os-config-operator/pkg/consts"
"github.com/annismckenzie/k3os-config-operator/pkg/errors"
internalConsts "github.com/annismckenzie/k3os-config-operator/pkg/internal/consts"
"github.com/annismckenzie/k3os-config-operator/pkg/util/taints"
corev1 ... |
package tg
import (
"fmt"
"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/k8s"
"github.com/aws/aws-sdk-go/service/elbv2"
extensions "k8s.io/api/extensions/v1beta1"
"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/aws/albelbv2"
"github.com/kubernetes-sigs/aws-alb-ingress-control... |
package ndau
// ----- ---- --- -- -
// Copyright 2019 Oneiro NA, Inc. All Rights Reserved.
//
// Licensed under the Apache License 2.0 (the "License"). You may not use
// this file except in compliance with the License. You can obtain a copy
// in the file LICENSE in the source distribution or at
// https://www.apac... |
package main
import (
"encoding/json"
"fmt"
"log"
"time"
ui "github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
_ "github.com/influxdata/influxdb1-client" // this is important because of the bug in go mod
client "github.com/influxdata/influxdb1-client/v2"
)
// Displayer displays the metrics inf... |
package testutil
import (
"context"
"fmt"
"math/rand"
"net"
"os"
"os/exec"
"runtime"
"syscall"
"testing"
"time"
"github.com/cloudflare/tubular/internal/sysconn"
"golang.org/x/sys/unix"
)
// FileStatusFlags returns flags for the open file description onderlying conn.
func FileStatusFlags(tb testing.TB, c... |
package catalog
import (
"errors"
"fmt"
"io/ioutil"
"regexp"
"strings"
yarn "github.com/omeid/go-yarn"
)
var (
// ErrUnknownCommentTag is return when a line that is expected to be
// a starting line starts with an unsupported comment type.
// i.e: it is not `--`, `#`, `//`, or `/*`.
ErrUnknownCommentTag = ... |
package connector
import (
"fmt"
"log"
"os"
"sawu-monitor/config"
"sawu-monitor/entities"
"sawu-monitor/mapper"
"strings"
// go-mssqldb is the database driver
_ "github.com/denisenkom/go-mssqldb"
"github.com/jmoiron/sqlx"
)
var nextstepeventSchema = `
CREATE TABLE nextstepevent (
id varchar(255) NOT NULL,... |
/*
Copyright The Kmodules 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, softwar... |
package ui
// Bitmap font loader. The format is the one described here
// http://www.angelcode.com/products/bmfont/doc/file_format.html
import (
"fmt"
"io/ioutil"
"regexp"
"strconv"
"strings"
)
// BmChar holds information about a single character, see
// http://www.angelcode.com/products/bmfont/doc/file_format.... |
package response
import (
"encoding/json"
"encoding/xml"
"fmt"
"net"
"strconv"
"time"
"github.com/inabajunmr/http11server/http"
"github.com/inabajunmr/http11server/http/header"
"github.com/inabajunmr/http11server/http/request"
)
type EchoResponse struct {
Version http.HTTPVersion
StatusCode int
Re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.