text
stringlengths
3.08k
10.4k
package handler import ( "fmt" "github.com/dgrijalva/jwt-go" "net/http" "strconv" "github.com/duyle0207/hoccode2020/config" model "github.com/duyle0207/hoccode2020/models" "github.com/labstack/echo" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) func (h *Handler) CreateFightMinitask(c echo.Context) (err error)...
// KATO, Application Management Platform // Copyright (C) 2021 Gridworkz Co., Ltd. // 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 r...
/* Copyright 2019 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, soft...
package main import ( "bytes" "fmt" "go/parser" "go/token" "io/ioutil" "log" "os" // "regexp" "sort" "strings" "github.com/dave/dst" "github.com/dave/dst/decorator" ) type alias int var fset = token.NewFileSet() func (*alias) String(p1, p2 int, bb string) string { return "" } // func liner( // bb...
// Code generated by astool. DO NOT EDIT. package duration import ( "fmt" "math" "regexp" "strconv" "time" ) // SerializeDuration converts a duration value to an interface representation // suitable for marshalling into a text or binary format. func SerializeDuration(this time.Duration) (interface{}, error) { ...
/* 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 distributed under the License...
package cow 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 ( pattyBirthday = nook.Birthday{ Day: 10, Month: ...
package hebcal import ( "encoding/json" "fmt" "os" "path/filepath" "regexp" "sort" "strconv" "strings" "time" "github.com/pkg/errors" ) const ( H_ROSH_HASHANA = "rosh-hashana" H_TZOM_GEDALIAH = "tzom-gedaliah" H_YOM_KIPPUR = "yom-kippur" H_SUKKOT = "sukkot" H_SHMINI_ATZERET = ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: building.proto package type_pb // import "github.com/gedorinku/tsugidoko-server/api/type" 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 _ = pro...
package model2d import ( "fmt" "math" "github.com/heustis/tsp-solver-go/model" ) // Edge2D represents the line segment between two points. type Edge2D struct { Start *Vertex2D `json:"start"` End *Vertex2D `json:"end"` vector *Vertex2D length float64 } // DistanceIncrease returns the difference in length ...
// Copyright 2015-present, Cyrill @ <EMAIL> and the CoreStore contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unles...
package runtime import ( "context" "time" "github.com/fsnotify/fsnotify" "github.com/open-policy-agent/opa/ast" "github.com/open-policy-agent/opa/bundle" "github.com/open-policy-agent/opa/loader" "github.com/open-policy-agent/opa/metrics" "github.com/open-policy-agent/opa/storage" "github.com/open-policy-age...
package webhooks import ( "reflect" "sort" "time" kyverno "github.com/nirmata/kyverno/pkg/api/kyverno/v1" v1 "github.com/nirmata/kyverno/pkg/api/kyverno/v1" "github.com/nirmata/kyverno/pkg/engine" "github.com/nirmata/kyverno/pkg/engine/context" "github.com/nirmata/kyverno/pkg/engine/response" "github.com/nir...
package main import ( "errors" "flag" "image" "os" "runtime/pprof" "strconv" "strings" "time" "golang.org/x/image/font" "golang.org/x/image/math/fixed" "github.com/ranchblt/geometry-jumper/game" "github.com/ranchblt/geometry-jumper/keyboard" "github.com/ranchblt/geometry-jumper/menu" "github.com/ranchb...
package app import ( "crypto/tls" "fmt" "net" "os" "os/signal" "sync" "syscall" "time" loggregator "code.cloudfoundry.org/go-loggregator" "github.com/cloudfoundry/metric-store-release/src/internal/debug" "github.com/cloudfoundry/metric-store-release/src/internal/metricstore" . "github.com/cloudfoundry/met...
// Copyright 2022 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 comment import ( "bytes" "fmt" "strings" ) // An mdPrinter holds the state needed for printing a Doc as Markdown. type mdPrinter struct { *Printer...
// 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, sof...
// Copyright (c) 2016 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 (c) 2014-2016 <NAME>. // // Redistribution and use in source and binary forms, with or without // modification, is permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following discla...
package operations import ( "fmt" "github.com/qiniu/qshell/v2/iqshell" "github.com/qiniu/qshell/v2/iqshell/common/alert" "github.com/qiniu/qshell/v2/iqshell/common/data" "github.com/qiniu/qshell/v2/iqshell/common/export" "github.com/qiniu/qshell/v2/iqshell/common/log" "github.com/qiniu/qshell/v2/iqshell/common/...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: simple.proto package example_simple import ( fmt "fmt" math "math" proto "github.com/golang/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a...
// Copyright (c) 2017 <NAME>. All rights reserved. // This source code is brought to you under MIT license that can be found // on the LICENSE file. // Some documentation in this source code are derived from gorilla/mux package. package route import ( "errors" "net/http" "net/url" "github.com/gorilla/mux" ) //...
package generated import ( "io/ioutil" "os" "path/filepath" "sync" yaml "gopkg.in/yaml.v2" ) // Config specifies the runtime config struct type Config struct { OverrideProfile *string `yaml:"lastOverrideProfile,omitempty"` ActiveProfile string `yaml:"activeProfile,omitempty"...
package cloudfoundry import ( "crypto/tls" "encoding/json" "errors" "github.com/nrekretep/cloudpaint/adapter/cloudfoundry/v3" "net/http" "net/url" "strings" ) // CloudControllerConfig provides Cloud Foundry specific configuration options type CloudControllerConfig struct { Username string Password st...
package sora import ( "fmt" "github.com/pion/webrtc/v2" ) // Signaling の型定義は以下のURLを参照 // https://sora-doc.shiguredo.jp/signaling_type type connectMessage struct { Type string `json:"type"` Role Role `json:"role"` ChannelID st...
package main import ( "encoding/json" "fmt" "net/http" "os" "strconv" "strings" "time" domain "trip-route/domain" csvparser "trip-route/services/csv" "trip-route/services/utils" ) type SearchResponse struct { From string To string Path string Price uint64 } type Connection struct { From string ...
// // Copyright (c) 2020 SSH Communications Security Inc. // // All rights reserved. // package hoststore import "github.com/SSHcom/privx-sdk-go/api/rolestore" // Source of host objects type Source string // Source constants const ( UI = Source("UI") SCAN = Source("SCAN") ) // Address is fully qualified domain...
/* * This file is part of impacca. Copyright (C) 2013 and above Shogun <<EMAIL>>. * Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit. */ package utils import ( "fmt" "io/ioutil" "os" "path/filepath" "regexp" "strings" "time" "github.com/Masterminds/semver" "gi...
package main import ( "errors" "flag" "log" "os" "os/signal" "strings" "time" "github.com/lab5e/clusterfunk/pkg/funk" "github.com/lab5e/clusterfunk/pkg/funk/sharding" "github.com/lab5e/clusterfunk/pkg/toolbox" "github.com/lab5e/gotoolbox/netutils" ) const numShards = 10000 func waitForExit() { terminate...
// Copyright (c) 2004-present Facebook All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package viewer_test import ( "context" "database/sql" "errors" "net/url" "os" "regexp" "strconv" "testing" "time" "github.com/DATA-DOG/go-sqlmo...
package service import ( "strings" "golang.org/x/net/context" "github.com/kuadrant/authorino/pkg/cache" "github.com/kuadrant/authorino/pkg/common" "github.com/kuadrant/authorino/pkg/common/log" "github.com/kuadrant/authorino/pkg/config" envoy_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"...
// Copyright 2020 - Offen Authors <<EMAIL>> // SPDX-License-Identifier: Apache-2.0 package config import ( "errors" "fmt" "os" "path" "runtime" "time" "github.com/joho/godotenv" "github.com/kelseyhightower/envconfig" "github.com/offen/offen/server/keys" "github.com/offen/offen/server/mailer" "github.com/o...
// 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writ...
package mysql import ( "bytes" "io" "strings" "github.com/bokwoon95/go-structured-query/sqgen" ) type Table struct { Schema string Name string StructName string RawType string Constructor string Fields []TableField } // TableField represents a field in a database table // // In the M...
package app import ( "crypto/md5" "errors" "fmt" "github.com/CharLemAznable/gokits" . "github.com/CharLemAznable/varys/base" "github.com/kataras/golog" "time" ) var configCache *gokits.CacheTable var tokenCache *gokits.CacheTable func cacheInitialize() { configCache = gokits.CacheExpi...
// Code generated by go-swagger; DO NOT EDIT. package networks // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com...
package cloud189 import ( "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/hex" "encoding/pem" "fmt" "log" "regexp" "strconv" "time" "github.com/buger/jsonparser" "github.com/go-resty/resty/v2" ) func sign(client *resty.Client) int { rand := strconv.FormatInt(time.Now().UnixNano()/1e6, 10) url := "ht...
package sha256 // https://csrc.nist.gov/csrc/media/publications/fips/180/4/final/documents/fips180-4-draft-aug2014.pdf import ( "encoding/binary" ) // H0 is the initial hash value. var H0 = []uint32{ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19} // K is sixty-four...
// Copyright 2021-2022 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law...
package parser import ( "io" "io/ioutil" "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) func ParseFragments(ctx *ParseContext, source io.Reader, done <-chan interface{}) <-chan types.DocumentFragment { resultStream ...
// Copyright © 2022 Meroxa, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
package cmd import ( "context" "fmt" "sort" "strings" humanize "github.com/dustin/go-humanize" flags "github.com/jessevdk/go-flags" "github.com/mitchellh/cli" "github.com/nerdalize/nerd/svc" ) //JobList command type JobList struct { *command } //JobListFactory creates the command func JobListFactory(ui cli...
package main import ( "net" "time" log "github.com/Sirupsen/logrus" "github.com/netCommonsEU/PeerStreamer-go-grapes" "github.com/netCommonsEU/PeerStreamer-go-ml" ) type rtpStream struct { RTP chan []uint8 RTCP chan []uint8 } type psTemporalBuffer struct { PacketAssembly *ml.PacketAssembly LastUpdated t...
package move import ( "math" "testing" "time" "github.com/downflux/game/engine/fsm/action" "github.com/downflux/game/engine/gamestate/dirty" "github.com/downflux/game/engine/id/id" "github.com/downflux/game/engine/status/status" "github.com/downflux/game/engine/visitor/visitor" "github.com/downflux/game/path...
package main import ( "encoding/base64" "fmt" "regexp" "strconv" "strings" "testing" "time" "github.com/nspcc-dev/neo-go/internal/random" "github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "github.com/nspc...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: add_action_to_role.proto package identityd2 import ( fmt "fmt" _ "github.com/envoyproxy/protoc-gen-validate/validate" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = ...
package sql //////////////////////////////////////////////////////////////////////////////////////////////// /// Imports //////////////////////////////////////////////////////////////////////////////////////////////// import ( "fmt" "log" "strings" "github.com/helyx-io/commute-importer/database" "github.com/hely...
package dslengine import "fmt" type ( // Definition is the common interface implemented by all definitions. Definition interface { // Context is used to build error messages that refer to the definition. Context() string } // DefinitionSet contains DSL definitions that are executed as one unit. // The slic...
package catalog import ( "fmt" "strconv" "strings" "time" "github.com/dhontecillas/dynlimits/pkg/ratelimit" "github.com/gomodule/redigo/redis" ) const ( RedisKeyLimitsVersion string = "dynlimits_limits_version" RedisKeyCatalogVersion string = "dynlimits_catalog_version" RedisKeyUpdating ...
package server import ( "github.com/jotitan/music_server/logger" "github.com/jotitan/music_server/music" "io" "io/ioutil" "net" "net/http" "os" "path/filepath" "strconv" "strings" ) //MusicServer manage all request of music server. Delegate to many objects type MusicServer struct { // Folder where indexes ...
package api import ( "context" "encoding/json" "fmt" "github.com/jtorvald/temporal-dispatch-poc/schema" "github.com/jtorvald/temporal-dispatch-poc/workflows" "log" "net/http" "reflect" "strings" "time" ) type workflowEndpoint struct { workflowClient *workflows.WorkflowClient } const format = "2006-01-02 1...
// Package departurevision parses an HTML table showing departure information. // // Consider this package highly experimental and subject to break without warning // due to the fragile parsing logic used here. Prefer to use the njtapi package // wherever possible for a more stable and robust interface. package depart...
// Copyright (c) 2021, Oracle and/or its affiliates. // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. package main import ( "flag" "fmt" "github.com/verrazzano/verrazzano/tools/analysis/internal/util/buildlog" "github.com/verrazzano/verrazzano/tools/analysis...
package main import ( "fmt" "github.com/containernetworking/plugins/pkg/ns" "github.com/j-keck/arping" "io/ioutil" "log" "net" "strings" "syscall" "unsafe" ) func main() { GetNotifyArp("bond0") // test //sigs := make(chan os.Signal, 1) ////done := make(chan bool, 1) //signal.Notify( // sigs, // syscall...
// Copyright © 2020, 2021 Attestant 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/LICENSE-2.0 // // Unless required by applicable law or a...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: protob/signature.proto package common import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is ...
package main import ( "fmt" "log" "os" "os/signal" "syscall" "cloud.google.com/go/pubsub" "context" "encoding/json" "github.com/dghubble/go-twitter/twitter" "github.com/dghubble/oauth1" "strconv" "strings" ) /* #ledhouse 4b green 1 #ledhouse <[1-4]><a|b|c> <red|green|blue> <[0-10]> */ const ( gcpPro...
/* Copyright 2012 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
/* Copyright 2019 LitmusChaos 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 main import ( "fmt" Log "github.com/kevinchapron/BasicLogger/Logging" speedsensor "github.com/kevinchapron/FSHK/speedsensor/code" "github.com/kevinchapron/FSHK/speedsensor/code/BLE" "github.com/montanaflynn/stats" "sort" "time" ) var targets = []string{"ce:b4:75:29:91:b2", "c5:c8:af:cd:44:6b", "f1:ba:d...
// Copyright 2020-2021 The Datafuse Authors. // // SPDX-License-Identifier: Apache-2.0. package labelrunperf import ( "context" githubcli "datafuselabs/test-infra/chatbots/github" "datafuselabs/test-infra/chatbots/plugins" "fmt" "regexp" "strings" "github.com/google/go-github/v35/github" "github.com/rs/zerolo...
package kaifa import ( "bytes" "github.com/stretchr/testify/assert" "testing" "time" ) var ( testFrame = []byte{ 0x01, // DestAddr 0x00, 0x01, // SrcAddr 0x10, // ControlField 0x56, 0x1b, // Hdr Checksum 0xe6, // LSAP Dest 0xe7, // LSAP Src ...
package wunderdns import ( "context" "crypto/tls" "errors" "net" "net/http" "net/url" "sigs.k8s.io/external-dns/endpoint" "sigs.k8s.io/external-dns/plan" "sigs.k8s.io/external-dns/provider" "strings" ) const ( viewPrivate = "private" viewPublic = "public" domainsCacheExpiry = 3600 // 1 hou...
package GoPolygons import ( "math" ) type Line struct { PointA Point PointB Point } type Rect struct { Left float64 Top float64 Right float64 Bottom float64 } func NewLineByPoint(ptA Point, ptB Point) Line { return Line{PointA: ptA, PointB: ptB} } func NewLine(x1 float64, y1 float64, x2 float64, y2 f...
package torpedo_history_plugin import ( "errors" "fmt" "strconv" "strings" "time" "gopkg.in/mgo.v2/bson" common "github.com/tb0hdan/torpedo_common" "github.com/tb0hdan/torpedo_common/database" "github.com/tb0hdan/torpedo_registry" "regexp" "sort" ) type SearchOption struct { SearchOptions []string Lim...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: tensorflow/core/protobuf/saved_model.proto package protobuf 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 ...
// Copyright (c) 2016 <NAME>, Inc. // Use of this source code is governed by the Apache License 2.0 // that can be found in the COPYING file. package daemon // This file holds the Symlink type, which represents symlinks import ( "fmt" "github.com/aristanetworks/quantumfs" "github.com/aristanetworks/quantumfs/uti...
// Code generated by protoc-gen-go. // source: google.golang.org/genproto/googleapis/genomics/v1/position.proto // DO NOT EDIT! package google_genomics_v1 // import "google.golang.org/genproto/googleapis/genomics/v1" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import _ "google....
package api // // Copyright 2020 Telenor Digital 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 l...
package server2 import ( "crypto/tls" "fmt" "github.com/NiuStar/log" "github.com/NiuStar/utils" "github.com/NiuStar/server2/STNet" "github.com/gin-gonic/gin" _ "github.com/go-sql-driver/mysql" "golang.org/x/net/websocket" xlog "log" "net" "net/http" "os" "path/filepath" "time" "github.com/DeanThompson/g...
package main import ( "bufio" "bytes" "fmt" "os" ) func main() { reader := bufio.NewReader(os.Stdin) var buf bytes.Buffer tc := readNum(reader) for tc > 0 { tc-- n, k := readTwoNums(reader) E := make([][]int, n-1) for i := 0; i < n-1; i++ { E[i] = readNNums(reader, 2) } Q := make([][]int, k)...
package mqtt import ( "errors" "fmt" "time" "github.com/dartali/hermes" "github.com/elliotchance/orderedmap" ) var ( ErrInvalidEventsList = errors.New("invalid_events") ErrInvalidHandler = errors.New("invalid_handler") ErrNoHandler = errors.New("no_handlers") ) func IsEventBusID(rid hermes.Receiv...
package klog import ( "cloud.google.com/go/civil" "errors" "fmt" "regexp" "strconv" gotime "time" ) // Time represents a wall clock time. It can be shifted to the adjacent dates. type Time interface { Hour() int Minute() int MidnightOffset() Duration IsYesterday() bool IsTomorrow() bool IsToday() bool Is...
package p2p import ( "context" "crypto/rand" "sync" "cherrychain/notify" logging "cherrychain/clogging" libp2p "github.com/libp2p/go-libp2p" crypto "github.com/libp2p/go-libp2p-crypto" "github.com/libp2p/go-libp2p-host" dht "github.com/libp2p/go-libp2p-kad-dht" inet "github.com/libp2p/go-libp2p-net" mult...
package gitissue import ( "context" "encoding/json" "io/ioutil" "os" "strings" "github.com/google/go-github/github" ) // Issues Pull all issues and write them to .issue/issues.json. // Pulls both open and closed issues. // Used to update issues.json. // Method for accessing issue.json. // Returns last pull if ...
package subscription import ( "context" "encoding/json" "fmt" "time" "github.com/google/uuid" "github.com/imrenagi/go-payment" "github.com/imrenagi/go-payment/invoice" ) // New creates empty subscription with valid UUID func New() *Subscription { return &Subscription{ Number: uuid.New().String(), // TODO...
// Copyright (c) 2018, <NAME> <<EMAIL>> // All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found s the LICENSE file. // Package mmdb is a Go library for downloading and updating // MaxMind GeoLite2 databases. // // Functions will download tar archive, extract the datab...
package token import ( "fmt" "strconv" ) // Pos describes a source position via its line and col location, it is represented // by concatenating two 32-bit integers representing line and col. type Pos uint64 func newPos(line uint32, col uint32) Pos { return Pos(uint64(line)<<32 | uint64(col)) } // decompose Pos ...
package gmail import ( "context" "encoding/base64" "io" "io/ioutil" "os" "golang.org/x/oauth2/google" "golang.org/x/oauth2/jwt" "google.golang.org/api/gmail/v1" "google.golang.org/api/option" ) // Service encapsulates the needed configuration settings to make successful // Gmail api calls // The struct meth...
// Copyright 2017 NDP Systèmes. All Rights Reserved. // See LICENSE file for full licensing details. package nbutils import ( "fmt" "math" "strconv" ) // CastToInteger casts the given val to int64 if it is // a number type. Returns an error otherwise func CastToInteger(val interface{}) (int64, error) { switch va...
package sort import ( "errors" ) const ( QUICKSORT_PIVOT_FIRST = 1 << iota // pick first element as privot QUICKSORT_PIVOT_MIDDLE // pick middle element as pivot QUICKSORT_PIVOT_LAST // pick last element as pivot QUICKSORT_PIVOT_MEDIAN_OF_THREE //...
// Copyright (c) 2015-2021 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 // (...
package _import import ( "archive/tar" "bufio" "bytes" "encoding/binary" "fmt" "io" "unsafe" "github.com/segmentio/encoding/json" "github.com/BOOMfinity-Developers/GoThink/pkg" r "gopkg.in/rethinkdb/rethinkdb-go.v6" ) type databaseImport struct { name string conn *r.Session tables []string...
package insidescraper import ( "encoding/json" "errors" ) // Site contains all site data. type Site struct { Sections map[string]SiteSection Lessons map[string]Lesson // IDs of all top level sections. TopLevel []TopItem } // SiteSection describes a section of a site. type SiteSection struct { *SiteData ID ...
package constants type PokeType struct { Name string `json:"name"` TypeID int `json:"id"` WeakDef int `json:"weak_def"` StrongDef int `json:"strong_def"` NoEffect int `json:"immune"` } func (t PokeType) String() string { return t.Name } // All Pokemon types, as a mask const ( IDNormal =...
package wx import ( "context" "fmt" "io/ioutil" "net/http" "net/url" "path/filepath" ) // HTTPMethod http request method type HTTPMethod string const ( MethodGet HTTPMethod = "GET" MethodPost HTTPMethod = "POST" MethodUpload HTTPMethod = "UPLOAD" ) // HTTPClient is the interface that do http request t...
// Copyright 2021 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 ...
/* * gocmd * For the full copyright and license information, please view the LICENSE.txt file. */ package gocmd import ( "os" "testing" . "github.com/smartystreets/goconvey/convey" ) var osArgs []string func init() { osArgs = make([]string, len(os.Args)) copy(osArgs, os.Args) } func resetArgs() { os.Args...
package kubernetes import ( "fmt" "os" "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" k8s "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcm...
/* 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 distributed under the License ...
// Copyright 2020 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 ...
// Copyright 2017 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 newdb import ( "bytes" "encoding" "encoding/binary" "fmt" "io" "reflect" "strings" ) var ( // IntType enum of Type int IntType = &Type{Name: reflect.TypeOf(int64(0)).Name(), Len: Sizeof(int64(0))} // StringType enum of Type string StringType = &Type{Name: reflect.TypeOf("").Name(), Len: 16} ) // ...
package main import ( "errors" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" "go.uber.org/zap" ) // Constants /// Sort Key i...
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
package main import ( "fmt" "math" "math/rand" "os" "strings" "github.com/alexislozano/go-raytracing/camera" "github.com/alexislozano/go-raytracing/hitable" "github.com/alexislozano/go-raytracing/material" "github.com/alexislozano/go-raytracing/ray" "github.com/alexislozano/go-raytracing/vec3" ) func rando...
package gam import ( "encoding/json" "encoding/xml" "fmt" "github.com/mxmCherry/openrtb" "github.com/prebid/prebid-server/adapters" "github.com/prebid/prebid-server/config" "github.com/prebid/prebid-server/errortypes" "github.com/prebid/prebid-server/openrtb_ext" "math/rand" "net/http" "net/url" "time" ) ...
/* * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available. * Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. * Yo...
/* Copyright © 2021 NAME HERE <EMAIL ADDRESS> 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 pebbleclient import ( "errors" "fmt" "io" "io/ioutil" "net/http" "net/url" "strings" "time" "github.com/jpillora/backoff" "golang.org/x/net/context" "golang.org/x/net/context/ctxhttp" ) const maxPartialBody = 64 * 1024 type options Options func (o options) merge(other *options) options { op :=...