text
stringlengths
3.08k
10.4k
package sap_api_input_reader type EC_MC struct { ConnectionKey string `json:"connection_key"` Result bool `json:"result"` RedisKey string `json:"redis_key"` Filepath string `json:"filepath"` SalesInquiry struct { SalesInquiry string `json:"document_no"` Plant ...
package main import ( "bufio" "fmt" "os" "sort" ) func readInt(bytes []byte, from int, val *int) int { i := from sign := 1 if bytes[i] == '-' { sign = -1 i++ } tmp := 0 for i < len(bytes) && bytes[i] != ' ' { tmp = tmp*10 + int(bytes[i]-'0') i++ } *val = tmp * sign return i } func readNum(scanne...
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
package kcp import ( "encoding/binary" "errors" "io" "net" "sync" "time" "github.com/airkits/nethopper/log" "github.com/airkits/nethopper/network" "github.com/airkits/nethopper/network/common" ) //ErrReadPackageLength read package length failed var ErrReadPackageLength = errors.New("read package length fail...
/* Copyright 2020 The Vitess Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
package config import ( "flag" "fmt" "time" ) // Flags defines the command line flags. type Flags struct { // Config contains the command line arguments that can also be set // in a config file. Config Config // ConfigFiles contains the list of config files and directories // that should be read. ConfigFile...
package module import ( "bytes" "fmt" "os" "os/exec" "path/filepath" "runtime" "strings" "github.com/gomods/athens/pkg/errors" "github.com/gomods/athens/pkg/paths" "github.com/spf13/afero" ) type goGetFetcher struct { fs afero.Fs goBinaryName string } // NewGoGetFetcher creates fetcher which u...
// {{{ Copyright (c) <NAME> <<EMAIL>>, 2017 // // 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 2021 Zenauth Ltd. // SPDX-License-Identifier: Apache-2.0 package gateway import ( "context" "encoding/base64" "encoding/json" "errors" "fmt" "io" "log" "mime" "net/http" "net/url" "strconv" "strings" "github.com/aws/aws-lambda-go/events" "go.uber.org/multierr" ) var ErrNotStarted = errors...
// 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 wri...
package engine // transposition.go contains an implementation of a transposition table (TT) to use // in search. const ( // Default size of the transposition table, in MB. DefaultTTSize = 64 // Constant for the size of a transposition table entry, in bytes, // considering memory alignment. TTEntrySize = 16 //...
package table import ( "github.com/charmbracelet/lipgloss" ) // WithHighlightedRow sets the highlighted row to the given index. func (m Model) WithHighlightedRow(index int) Model { m.rowCursorIndex = index if m.rowCursorIndex < 0 { m.rowCursorIndex = 0 } if m.rowCursorIndex >= len(m.GetVisibleRows()) { m.r...
package nat import ( "context" "errors" "fmt" "sync" "time" logging "github.com/ipfs/go-log" goprocess "github.com/jbenet/goprocess" periodic "github.com/jbenet/goprocess/periodic" nat "github.com/libp2p/go-nat" ) var ( // ErrNoMapping signals no mapping exists for an address ErrNoMapping = errors.New("ma...
package spammer import ( "fmt" "time" "github.com/iotaledger/iota.go/bundle" "github.com/iotaledger/iota.go/consts" "github.com/iotaledger/iota.go/transaction" "github.com/iotaledger/iota.go/trinary" "github.com/gohornet/hornet/pkg/metrics" "github.com/gohornet/hornet/pkg/model/hornet" "github.com/gohornet/...
// Copyright 2018 The Kubeflow 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 agre...
package credentials import ( "encoding/json" "errors" "fmt" "io/ioutil" "time" "github.com/cnabio/cnab-go/bundle" "github.com/cnabio/cnab-go/secrets" "gopkg.in/yaml.v2" ) // Set is an actual set of resolved credentials. // This is the output of resolving a credentialset file. type Set map[string]string // E...
package modules import ( "context" "fmt" "sync/atomic" "time" "github.com/buguang01/Logger" "github.com/buguang01/bige/messages" "github.com/buguang01/util" "github.com/buguang01/util/threads" ) //设置通道缓存空间 func LogicSetChanNum(channum int) options { return func(mod IModule) { mod.(*LogicModule).chanNum =...
//Package quic defines functions to listen and dial quic, with some customizable congestion settings. package quic import ( "context" "crypto/tls" "net" "time" "github.com/hahahrfool/v2ray_simple/netLayer" "github.com/hahahrfool/v2ray_simple/utils" "github.com/lucas-clemente/quic-go" "github.com/lucas-clement...
// Copyright 2013 The Walk 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 main import ( "fmt" "log" "time" ) import ( "github.com/lxn/walk" . "github.com/lxn/walk/declarative" ) func main() { walk.FocusEffect, _ = w...
package scheduler import ( "context" "fmt" "math" "math/rand" "testing" "time" "github.com/evergreen-ci/evergreen" "github.com/evergreen-ci/evergreen/db" "github.com/evergreen-ci/evergreen/model" "github.com/evergreen-ci/evergreen/model/distro" "github.com/evergreen-ci/evergreen/model/host" "github.com/ev...
package main import ( "fmt" "flag" "gopkg.in/yaml.v2" "io/ioutil" // "log" "strconv" "strings" "os" "database/sql" _ "github.com/go-sql-driver/mysql" ) type Tag struct { ID int `json:"id"` Fname string `json:"fname"` Ds string `json:"ds"` } type DbConfig struct { User string `yaml:"user"` Password...
package apiserver import ( "context" "fmt" "io" "net/http" "os" "time" "github.com/crowdsecurity/crowdsec/pkg/apiserver/controllers" "github.com/crowdsecurity/crowdsec/pkg/csconfig" "github.com/crowdsecurity/crowdsec/pkg/database" "github.com/crowdsecurity/crowdsec/pkg/types" "github.com/gin-gonic/gin" "g...
package lotus import ( "encoding/json" "github.com/brunvieira/fastalice" "github.com/buaazp/fasthttprouter" "github.com/mitchellh/mapstructure" "github.com/valyala/fasthttp" "github.com/vmihailenco/msgpack" "regexp" "strings" ) // Method defines usable methods for endpoints type Method string const ( // DEL...
// Copyright 2022 TiKV Project Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
package bearcub 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 ( pudgeBirthday = nook.Birthday{ Day: 11, Mon...
// Copyright 2018 the Service Broker Project Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applic...
package clickhouse_test import ( "github.com/ClickHouse/clickhouse-diagnostics/internal/collectors/clickhouse" "github.com/ClickHouse/clickhouse-diagnostics/internal/platform" "github.com/ClickHouse/clickhouse-diagnostics/internal/platform/config" "github.com/ClickHouse/clickhouse-diagnostics/internal/platform/dat...
/* Copyright 2016 The Rook 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 agreed to ...
package acme import ( "crypto/tls" "crypto/x509" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net" "net/http" "os" "runtime" "strings" "time" ) var ( // UserAgent (if non-empty) will be tacked onto the User-Agent string in requests. UserAgent string // HTTPClient is an HTTP client with a reasonab...
package handlers import ( "bytes" "context" "encoding/json" "fmt" "net/http" "net/http/httptest" "strings" "testing" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/openfaas/faas/gateway/requests" ) func genFakeSecret(name string, data string, includeOwnerLabel ...
package cucumber import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "log" "net/http" "reflect" "strings" "github.com/cucumber/godog" "github.com/cucumber/godog/gherkin" ) // APIFeature to test api type APIFeature struct { Options APIFeatureOptions logger *log.Logger client *http.Client...
package internal import ( "context" "errors" "fmt" "net/http" "os" "sort" "strings" "github.com/logrusorgru/aurora" "nitro/markdown-link-check/internal/service" "nitro/markdown-link-check/internal/service/parser" "nitro/markdown-link-check/internal/service/provider" "nitro/markdown-link-check/internal/se...
// Copyright 2017 tsuru 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 clusterclient import ( "io" "time" docker "github.com/fsouza/go-dockerclient" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" "githu...
// Code generated by protoc-gen-go. // source: peer/configuration.proto // DO NOT EDIT! package peer import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf /...
// +build integration // Space above here matters // Copyright 2017 Monax Industries Limited // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICEN...
// Copyright 2020 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package crash import ( "context" "io/ioutil" "os" "path" "path/filepath" "strings" "chromiumos/tast/errors" "chromiumos/tast/local/chrome" "...
package physical import ( "bytes" "fmt" "io" "os" "sort" "strings" "time" log "github.com/mgutz/logxi/v1" "github.com/armon/go-metrics" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashi...
// Copyright 2014 Team 254. All Rights Reserved. // Author: <EMAIL> (<NAME>) // // Web handlers for the alliance station display. package main import ( "fmt" "io" "log" "net/http" "text/template" ) // Renders the team number and status display shown above each alliance station. func AllianceStationDisplayHandle...
/* Copyright 2019 The Skaffold Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
package main import ( "bytes" "context" "encoding/json" "io/ioutil" "log" "net/http" "net/url" "os" "strings" "unicode" "github.com/aws/aws-lambda-go/lambda" _ "github.com/go-sql-driver/mysql" "golang.org/x/text/transform" "golang.org/x/text/unicode/norm" ) type authData struct { Access_Token string ...
package version import ( "bufio" "fmt" "io/ioutil" "os" "path/filepath" "reflect" "runtime" "strings" "text/tabwriter" "github.com/blang/semver" "github.com/containers/common/pkg/apparmor" "github.com/containers/common/pkg/seccomp" "github.com/google/renameio" json "github.com/json-iterator/go" "github...
/* * Copyright (c) 2017, MegaEase * 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 ap...
/* Copyright 2020 The Nocalhost Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
/* Copyright (c) 2019 the Octant contributors. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package printer import ( "context" "fmt" "github.com/pkg/errors" rbacv1 "k8s.io/api/rbac/v1" "github.com/vmware-tanzu/octant/pkg/view/component" ) // ClusterRoleBindingListHandler is a printFunc that pri...
// Copyright 2019 Istio Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
// Copyright 2018 Istio Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
package sstats import ( "math" "math/rand" "sort" "testing" ) func TestMin_1(t *testing.T) { i,v := Min(0,1,2) if i != 0 { t.Errorf("wrong index") } if v != 0 { t.Errorf("wrong value") } } func TestMin_2(t *testing.T) { i,v := Min(2,1,0) if i != 2 { t.Errorf("wrong index") } if v != 0 { t.Errorf("wrong val...
// *** 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 servicecatalog import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Provides information on a Service Catalog...
package main import ( "TUM-Live/api" "TUM-Live/dao" "TUM-Live/model" "TUM-Live/tools" "TUM-Live/tools/tum" "TUM-Live/web" "fmt" "github.com/dgraph-io/ristretto" "github.com/droundy/goopt" "github.com/getsentry/sentry-go" sentrygin "github.com/getsentry/sentry-go/gin" "github.com/gin-contrib/gzip" "github....
/* * Copyright 2020 CDFMLR * * 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 wr...
/* Copyright (C) 2018 Yahoo Japan Corporation Athenz team. 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 agre...
/* Copyright 2021 The Hybridnet 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 writ...
package upgrade import ( "fmt" "time" "github.com/kyma-project/cli/internal/cli" "github.com/kyma-project/cli/internal/hosts" "github.com/kyma-project/cli/internal/kube" "github.com/kyma-project/cli/internal/nice" "github.com/kyma-project/cli/pkg/installation" "github.com/pkg/errors" "github.com/spf13/cobr...
/* Copyright The containerd Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to...
package serialization import ( "bytes" "fmt" "io/ioutil" "math" "testing" ) func BenchmarkWriteVarUint(b *testing.B) { n := uint64(math.MaxUint64) for i := 0; i < b.N; i++ { WriteVarUint(ioutil.Discard, n) } } func BenchmarkWriteVarBytes(b *testing.B) { s := []byte{10, 11, 12} buf := new(bytes.Buffer) f...
// Copyright 2016 The Fuchsia 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 msdosfs implements the FAT filesystem package msdosfs import ( "errors" "sync" "time" "thinfs/block" "thinfs/fs" "thinfs/fs/msdosfs/boot...
package authoauth2 import ( "fmt" "html/template" "io/ioutil" "log" "net/http" "net/url" "strings" "time" "github.com/gobwas/glob" "github.com/wrgl/wrgl/pkg/api" "github.com/wrgl/wrgl/pkg/conf" server "github.com/wrgl/wrgl/wrgld/pkg/server" wrgldutils "github.com/wrgl/wrgl/wrgld/pkg/utils" "golang.org/x...
package webhook import ( "bytes" "net/http" "net/http/httptest" "testing" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" ) type testHTTPHandler struct{} func (t testHTTPHandler) ServeHTTP(w http.ResponseWriter...
package policy import ( "errors" "sync" "time" "github.com/go-logr/logr" kyverno "github.com/kyverno/kyverno/pkg/api/kyverno/v1" "github.com/kyverno/kyverno/pkg/engine" "github.com/kyverno/kyverno/pkg/engine/response" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) func (pc *PolicyController) processEx...
package main import ( "database/sql" "fmt" "github.com/fuzzybear3965/gotex/internal/parser" "os" ) func initDB(fpath string) *sql.DB { db, err := sql.Open("sqlite3", fpath) if err != nil { panic(err) } if db == nil { panic("db == nil") } return db } func migrate(db *sql.DB) { sql := ` CREATE TA...
package godis import ( "encoding/json" "fmt" "github.com/go-redis/redis" "github.com/leyantech/godis/internal" "github.com/pkg/errors" "github.com/samuel/go-zookeeper/zk" "log" "sort" "sync/atomic" ) // RoundRobinPool is a round-robin redis client pool for connecting multiple codis proxies based on // zookee...
// 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...
//+build windows package wui import ( "math" "strconv" "strings" "syscall" "github.com/gonutz/w32" ) func NewFloatUpDown() *FloatUpDown { return &FloatUpDown{ minValue: math.Inf(-1), maxValue: math.Inf(1), precision: 1, } } type FloatUpDown struct { textControl upDownHandle w32.HWND value ...
package app_test import ( "testing" "github.com/danielbaenabird/fyne/v2" "github.com/danielbaenabird/fyne/v2/container" "github.com/danielbaenabird/fyne/v2/internal/app" internalWidget "github.com/danielbaenabird/fyne/v2/internal/widget" "github.com/danielbaenabird/fyne/v2/widget" "github.com/stretchr/testify...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package commitcmd import ( "io" "testing" "github.com/hyperledger/fabric-cli/pkg/environment" "github.com/hyperledger/fabric-cli/pkg/fabric" "github.com/spf13/cobra" "github.com/stretchr/testify/require" "gi...
package chainrpc import ( "context" "crypto/tls" "github.com/olympus-protocol/ogen/cmd/ogen/config" "github.com/olympus-protocol/ogen/internal/keystore" "net" "net/http" "path" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/olympus-protocol/ogen/internal/chain" "github.com/olympus-protocol/oge...
package tap import ( "crypto/tls" "crypto/x509" "encoding/json" "fmt" "net" "net/http" "github.com/julienschmidt/httprouter" "github.com/linkerd/linkerd2/controller/gen/controller/tap" "github.com/linkerd/linkerd2/controller/k8s" k8sutils "github.com/linkerd/linkerd2/pkg/k8s" "github.com/linkerd/linkerd2/p...
package gw2api // Character contains all the listed items from subrequests type Character struct { CharacterCore Backstory []string `json:"backstory"` CharacterExtras Specializations []*Character CharacterSkills CharacterEquipment Crafting []*DisciplineProgress `json:"crafting"` Recipes []int ...
/* Copyright 2018-2020 Polyaxon, 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 main import ( "math/rand" "strconv" "strings" "time" "github.com/pterm/pterm" ) // Change this to time.Millisecond*200 to speed up the demo. // Useful when debugging. const second = time.Second var pseudoProgramList = strings.Split("pseudo-excel pseudo-photoshop pseudo-chrome pseudo-outlook pseudo-expl...
package chicken 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 ( hankBirthday = nook.Birthday{ Day: 0, Month...
package lint /* * ZLint Copyright 2020 Regents of the University of Michigan * * 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 requ...
// Copyright 2019 The GCR Cleaner 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 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package cli import ( "errors" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/copilot-cli/internal/pkg/aws/identity" "github.com/aws/copilot-cli/internal/pkg/cli/deploy" "github.com/aws/copilo...
package upstreams import ( "context" "time" "github.com/solo-io/go-utils/contextutils" "go.uber.org/zap" "github.com/hashicorp/go-multierror" "github.com/rotisserie/eris" "github.com/solo-io/gloo/projects/gloo/pkg/upstreams/consul" "github.com/solo-io/gloo/projects/gloo/pkg/upstreams/kubernetes" "golang.org...
// Copyright 2014 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
// Copyright © 2019 NVIDIA 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 agre...
/* Package gift provides a set of useful image processing filters. Basic usage: // 1. Create a new GIFT and add some filters: g := gift.New( gift.Resize(800, 0, gift.LanczosResampling), gift.UnsharpMask(1, 1, 0), ) // 2. Create a new image of the corresponding size. // dst is a new target image, src...
package trello import ( "encoding/json" "fmt" "io/ioutil" "strings" "time" "github.com/dustin/go-humanize" "github.com/zephinzer/dev/internal/constants" "github.com/zephinzer/dev/pkg/utils/request" ) func GetNotifications(accessKey, accessToken string) (*APIv1MemberNotificationResponse, error) { responseObj...
package sdk import ( "context" "fmt" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) // ResourceW...
// // 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 dash import "net/http" // Client is how we interact with the chain rider api type Client struct { URL string `json:"url"` Payload string `json:"payload"` Token string `json:"token"` HC *http.Client } // ConfigOpts are the configuration options for our session with teh api type ConfigOpts struc...
package main import ( "bytes" "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/base64" "encoding/binary" "io" ) type pem struct { buf bytes.Buffer b64 io.WriteCloser stack []io.Writer bound bool } func newPEM(bound bool) *pem { p := new(pem) if bound { p.buf.WriteString("-----BEGIN OPENSSH PRI...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package mockmsp import ( "net" "net/http" "time" cfapi "github.com/cloudflare/cfssl/api" cfsslapi "github.com/cloudflare/cfssl/api" "github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric...
package main import ( "encoding/json" //"io" //"ioutil" "os" //"os/exec" "fmt" //"strings" //"net/http" "github.com/jleben/slack-chat-resource/utils" "github.com/nlopes/slack" ) func main() { var request utils.CheckRequest var err error err = json.NewDecoder(os.Stdi...
package actions import ( "strings" "time" "github.com/gobuffalo/buffalo" "github.com/gobuffalo/pop/v5" "github.com/gofrs/uuid" "github.com/monarko/piia/helpers" "github.com/monarko/piia/models" "github.com/pkg/errors" ) // NotificationsIndex returns the logs list func NotificationsIndex(c buffalo.Context) er...
package wImpl import ( "regexp" ) /* */ const ( MSG_NORMAL = iota MSG_JRPC ) //事件 type Event int /* EventID */ const ( EVENT_UNKNOWN Event = iota EVENT_ERROR EVENT_PING EVENT_LOGIN //订阅公共频道 EVENT_BOOK_INSTRUMENTS EVENT_STATUS EVENT_BOOK_TICKERS EVENT_BOOK_OPEN_INTEREST EVENT_BOOK_KLINE EVENT_BOOK...
package main /* * client.go * Client side of threebytes * By <NAME> * Created 20181107 * Last Modified 20181107 */ import ( "flag" "fmt" "io" "log" "math/rand" "net" "os" "os/exec" "strings" "time" "golang.org/x/net/idna" ) const ( minSleep = time.Nanosecond maxSleep = 2 * time.Second ) func ini...
package ipfscluster import ( "context" "encoding/hex" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" ipns "github.com/ipfs/go-ipns" "github.com/ipfs/ipfs-cluster/config" libp2p "github.com/libp2p/go-libp2p" relay "github.com/libp2p/go-libp2p-circuit" connmgr "github.com/libp2p/go-lib...
package main import ( "bytes" "github.com/iancoleman/strcase" "github.com/markbates/pkger" "github.com/spf13/cobra" "io/ioutil" "log" "os" "path" "strings" "text/template" ) type _projTemplate struct { content []byte dstPath string mode os.FileMode } type _projDir struct { dstPath string mode os...
// Copyright ©2014 The Gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package optimize import ( "math" "time" ) // Local finds a local minimum of a minimization problem using a sequential // algorithm. A maximization probl...
package meta import ( "encoding/csv" "encoding/json" "log" "strconv" "strings" ) const NO_POKER_HAND = "no poker hand" const PAIR_ONE = "1 pair" const PAIR_TWO = "2 pair" const THREE_OF_A_KIND = "3 of a kind" const FOUR_OF_A_KIND = "4 of a kind" const FIVE_OF_A_KIND = "5 of a kind" const SIX_OF_A_KIND = "6 of a ...
/* Copyright 2019 <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 distribut...
package callable import ( "context" "encoding/json" "errors" "firebase.google.com/go/auth" "fmt" "github.com/go-logr/logr" "mime" "net/http" "strings" ) // Callable encapsulates a Firebase 'onCall' request with its handler method. type Callable struct { request Request authClient *auth.Client authR...
/* Copyright The Helm 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 di...
//go:build linux || darwin // +build linux darwin package ui import ( "bytes" "context" "fmt" "io" "os" "sync" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/internal/logger" syftEvent "github.com/anchore/syft/syft/event" "github.com/anchore/syft/ui" "github.com/wagoodman/go-partybus" "g...
package proxyutil import ( "bytes" "compress/flate" "compress/gzip" "encoding/gob" "io" "io/ioutil" "net/http" "strconv" ) // BufferedResponseWriterEncodings is the set of encodings that // BufferedResponseWriter supports var BufferedResponseWriterEncodings = []string{"gzip", "deflate"} // BufferedResponseWr...
package internal_test import ( "encoding/json" "fmt" "net/http" "testing" ) // AdminBackend as returned from admin API type AdminBackend struct { URL string `json:"url"` ID string `json:"id"` ActiveConnections int `json:"activeConnections"` Enabled bool `json:"enabl...
package tests import ( "fmt" "io/ioutil" "log" "os" "path" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "gorm.io/driver/sqlite" "gorm.io/gorm" "gorm.io/gorm/logger" "github.com/omaskery/optimistic-gorm/optimistic" ) var ( TestID uint = 1 NonExistantID = 999999 ) type TestModel str...
package drng import ( "encoding/hex" "log" "testing" "github.com/drand/drand/chain" "github.com/drand/drand/key" "github.com/drand/kyber/share" "github.com/drand/kyber/util/random" "github.com/iotaledger/hive.go/crypto/ed25519" "github.com/stretchr/testify/require" ) var ( eventTest *CollectiveBeaconEvent ...