text stringlengths 3.08k 10.4k |
|---|
//Copyright 2019. <NAME>. All right reserved.
//Nucleic Acid Sequence
package NASeq
import (
"bytes"
"math/rand"
"os"
"strconv" //string convert
"time"
)
//enum
type NA int
const (
Adenine = 0 + iota
Cytosine
Guanine
Thymine
)
/*class variables*/
//public
var DEBUG bool = false
//private
var seq bytes.Bu... |
// Copyright 2016 Iron.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 agreed to in writ... |
// Package cloudsigmarepl is a repl for the CloudSigma REST API.
package main
import (
"fmt"
"github.com/russmack/cloudsigma"
"github.com/russmack/replizer"
"os"
)
var (
session *Session
)
// Session struct holds properties that we don't want to have to specify repeatedly.
type Session struct {
Location string... |
// Package subr is a light wrapper over the flag package for sub-command
// handling.
package subr // import "github.com/tr-d/subr"
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"os"
"reflect"
"strings"
)
// Status ...
type Status int
// Statuses
const (
Safeword Status = iota + 1
HelpInvoked
NoArgs
ParseError... |
package ecs
import (
"github.com/aws/aws-sdk-go/service/ecs"
)
// ContainerConfig represents changes we can make to containers
type ContainerConfig struct {
CPU *int64 `json:"cpu" yaml:"cpu"`
Environment map[string]string `json:"environment" yaml:"environment"`
Image *st... |
// Copyright 2020 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package main
import (
"bufio"
"errors"
"fmt"
"os"
"regexp"
"strings"
"time"
"github.com/urfave/cli/v2"
)
const (
// Box Drawings
lightHorizontal = "\u2500" // ─
lightVertical = "\u2502" // │
lightUpAndRight = "\u2514" // └
lightVerticalAndRight = "\u251C" // ├
// Basic Latin
space... |
package service
import (
"fmt"
"github.com/duanhf2012/origin/event"
"github.com/duanhf2012/origin/log"
"github.com/duanhf2012/origin/profiler"
"github.com/duanhf2012/origin/rpc"
"github.com/duanhf2012/origin/util/timer"
"github.com/duanhf2012/origin/util/timewheel"
"reflect"
"runtime"
"sync"
"sync/atomic"
)... |
// Code generated by jig; DO NOT EDIT.
//go:generate jig
package MergeMapTo
import (
"fmt"
"sync"
"sync/atomic"
"github.com/reactivego/scheduler"
"github.com/reactivego/subscriber"
)
//jig:name Scheduler
// Scheduler is used to schedule tasks to support subscribing and observing.
type Scheduler = scheduler.S... |
package staker
import (
"context"
"math/big"
"time"
"github.com/offchainlabs/arbitrum/packages/arb-node-core/ethbridge"
"github.com/offchainlabs/arbitrum/packages/arb-util/core"
"github.com/offchainlabs/arbitrum/packages/arb-util/inbox"
"github.com/pkg/errors"
)
type InboxReader struct {
// Only in run threa... |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... |
package go_thunder
import (
"bytes"
"fmt"
"github.com/clarketm/json" // "encoding/json"
"io/ioutil"
"strconv"
"util"
)
type IP struct {
UUID string `json:"uuid,omitempty"`
Dhcp int `json:"dhcp,omitempty"`
Ipv4Address []Address `json:"address-list,omitempty"`
}
type Address struct {
I... |
// Copyright 2018 hIMEI
//
// 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 writin... |
/*
This code was present in older versions of k8s.io/client-go
Original code is
Copyright 2014 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://... |
package main
import (
"bufio"
"bytes"
"errors"
"io"
"time"
)
type Commit struct {
Hash string
Author string
Date time.Time
Title string
Message string
Tag string // Optional tag, e.g. v0.1.
}
// Parses a git log with the following format:
//
// hash: $commit_hash
// author: $authour_name
// d... |
package termbin
import (
"net"
"strconv"
"time"
"github.com/yunginnanet/Rate5"
"golang.org/x/tools/godoc/util"
ipa "inet.af/netaddr"
)
var (
// Msg is a channel for status information during concurrent server operations
Msg chan Message
// Reply is a channel to receive messages to send our client upon compl... |
// Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
package filter
import (
"context"
"encoding/json"
scimJSON "github.com/imulab/go-scim/pkg/core/json"
"github.com/imulab/go-scim/pkg/core/prop"
"github.com/imulab/go-scim/pkg/core/spec"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"io/ioutil"
"os"
"testing"
)
func TestFromForPrope... |
package service
import (
"errors"
"server/app/api/request"
"server/app/model"
"server/app/model/admins"
"server/app/model/authorities"
"server/app/model/authority_menu"
"server/app/model/authority_resources"
"server/library/global"
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/frame/g"
)
// CreateAu... |
/*
Copyright 2020 The arhat.dev 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 service
import (
"context"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/iancoleman/strcase"
"github.com/minio/minio-go/v7"
"github.com/unionj-cloud/go-doudou-tutorials/wordcloud/wordcloud-bff/config"
"github.com/unionj-cloud/go-doudou-tutorials/wordcloud/wordcloud-bff/vo"
makerclient "git... |
// Copyright 2016-2021, 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... |
// Copyright 2018 ePoxy 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 auth
import (
"errors"
"net"
"sync"
"sync/atomic"
"time"
"github.com/agubarev/hometown/pkg/client"
"github.com/google/uuid"
)
// TODO: consider storing some client fingerprint inside the session
const (
SRevokedByLogout uint32 = 1 << iota
SRevokedByExpiry
SRevokedBySystem
SRevokedByClient
SCreat... |
package data
import (
"encoding/binary"
"fmt"
"reflect"
"github.com/modest-sql/common"
)
type dbTypeID uint8
const (
dbIntegerTypeID dbTypeID = iota
dbFloatTypeID
dbBooleanTypeID
dbDateTimeTypeID
dbCharTypeID
)
const (
dbIntegerSize = 8
dbFloatSize = 8
dbDateTimeSize = 8
dbBooleanSize = 1
)
type... |
package fsys
import (
"io"
"io/fs"
"os"
"path"
"strings"
"github.com/schwarzlichtbezirk/wpk"
)
// ChunkFile structure gives access to nested into package file.
// wpk.NestedFile interface implementation.
type ChunkFile struct {
wpk.FileReader
tags wpk.TagSlice // has fs.FileInfo interface
wpkf *os.File
}
/... |
package pgTrigger
import (
"errors"
"fmt"
"r3/db"
"r3/schema"
"r3/schema/lookups"
"r3/tools"
"r3/types"
"strings"
"github.com/gofrs/uuid"
"github.com/jackc/pgx/v4"
)
func Del_tx(tx pgx.Tx, id uuid.UUID) error {
nameMod, nameRel, err := lookups.GetPgTriggerNamesById_tx(tx, id)
if err != nil {
return er... |
package main
import (
"crypto/rand"
"encoding/base64"
"encoding/json"
"reflect"
"strings"
"github.com/mattermost/mattermost-plugin-api/experimental/telemetry"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-plugin-gitlab/server/gitlab"
)
// confi... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudfront
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type CreateOriginRequestPolicyInput struct {
_ struct{} `type:"structur... |
/*
Copyright 2021 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package service
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc packag... |
package userPack
import (
"../../database"
"../../helpers"
"github.com/go-pg/pg/orm"
"github.com/satori/go.uuid"
"reflect"
"strings"
"time"
)
const CACHEKEY = "User-"
var USER_ROLES = map[int]string{1: "admin", 2: "leadership", 3: "caller", 4: "pm", 5: "manager", 6: "copywriter", 7: "guest"}
var USER_ROLES_RU... |
// Copyright 2018 <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 writi... |
package memdb
import (
"sort"
"time"
"go.uber.org/atomic"
"github.com/lindb/lindb/pkg/lockers"
"github.com/lindb/lindb/pkg/timeutil"
pb "github.com/lindb/lindb/rpc/proto/field"
"github.com/lindb/lindb/series/field"
"github.com/lindb/lindb/tsdb/tblstore/metricsdata"
)
//go:generate mockgen -source ./timeseri... |
package db
//go:generate msgp
import (
"time"
blake2b "github.com/minio/blake2b-simd"
)
// StringHeapIDSize is the number of bytes a StringHeapID
// takes up when converted to bytes.
const StringHeapIDSize = 4
// StringHeapID maps to a stored string identifier.
//
// This creates a layer of indir... |
// Copyright © 2016 <NAME> (<EMAIL>)
//
// 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... |
package config
import (
"fmt"
"log"
"os"
)
type RegionalConfig struct {
SKU string
Locale string
Currency string
}
type TwitterConfig struct {
ConsumerKey string
ConsumerSecret string
AccessToken string
AccessSecret string
}
type TwilioConfig struct {
AccountSID string
Token ... |
// Copyright 2016, <NAME> <<EMAIL>>
// See the LICENSE file for more details.
package main
import (
"fmt"
glfw "github.com/go-gl/glfw/v3.1/glfw"
mgl "github.com/go-gl/mathgl/mgl32"
fizzle "github.com/tbogdala/fizzle"
graphics "github.com/tbogdala/fizzle/graphicsprovider"
opengl "github.com/tbogdala/fizzle/gra... |
// Package cmd contains the primary logic of the xo command-line application.
package xo
import (
"context"
"database/sql"
"fmt"
"github.com/alecthomas/kingpin"
"github.com/calebhiebert/xo/loader"
"github.com/calebhiebert/xo/models"
xo "github.com/calebhiebert/xo/types"
"github.com/gobwas/glob"
"github.com/xo... |
package main
import (
"bufio"
"fmt"
"html/template"
"io/ioutil"
"os"
"os/exec"
"regexp"
"strings"
"github.com/gomarkdown/markdown"
)
type Row struct {
Doc string
DocSpan int
DocHTML template.HTML
Code string
CodeHTML template.HTML
CodeEmpty bool
FirstCode bool
}
type Example struct {... |
package main
import (
"bufio"
"bytes"
"context"
"flag"
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"time"
)
// You wouldn't think our child could start before us, but I have observed it; maybe due to rounding?
var start = time.Now().Unix() - 1
func main() {
var (
flagProcessExporter... |
// SPDX-License-Identifier: Apache-2.0
// Copyright © 2022 Wrangle Ltd
package index
import (
"fmt"
"io"
"sort"
"sync"
)
type ReadWriteSeekCloser interface {
io.Reader
io.Seeker
io.Closer
io.Writer
}
// HashSet is an high performance lookup table which can act
// like a set of 16 bytes slices. It borrows id... |
package tv
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
)
//const qqurl = "http://egame.qq.com/livelist?layoutid=hot&name=%E7%83%AD%E9%97%A8%E7%9B%B4%E6%92%AD"
//const qqmoreurl = "http://share.egame.qq.com/cgi-bin/pgg_skey_async_fcgi?&cgi_module=pgg_live_read_svr&cgi_method=get_liv... |
// Copyright 2017 NDP Systèmes. 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 applica... |
package name
import (
"math/rand"
"regexp"
"strings"
"time"
"github.com/nboughton/go-roll"
"github.com/nboughton/swnt/dice"
)
var badPrefix = regexp.MustCompile(`[cflmnr][^aeiouyh]`)
func init() {
rand.Seed(time.Now().UnixNano())
}
// Name generator. This is a primitive first effort that will be refined ove... |
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package cmd
import (
"context"
"fmt"
"sort"
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"
"github.com/oasisprotocol/oasis-sdk/cli/cmd/common"
cliConfig "github.com/oasisprotocol/oasis-sdk/cli/config"
"github.com/oasisprotocol/oasis-sdk/cli/table"
"github.com/oasisprotocol/oasis-sdk/client-sdk/... |
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// V... |
package pool
import (
"fmt"
"net"
"github.com/apcera/continuum/common/fqn"
"github.com/apcera/continuum/common/ipam"
"github.com/apcera/continuum/util/netutil"
"github.com/apcera/util/uuid"
)
// TODO(awander): move this to fqn.go eventually
const POOL_RESOURCE = "network"
// we don't allow arbitrarly large ne... |
package httphelper
import (
"bytes"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
"github.com/go-chi/chi"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
)
const (
BackendRequestTimeout = 15 * time.Second // time after which re... |
package fragment
import (
"fmt"
"log"
"strings"
"discovery-artifact-manager/snippetgen/common/metadata"
)
// currentMergeVersion contains the version identifier of the current merging algorithm. This
// identifier will be included in merged CodeFragments.GenerationVersion
const currentMergeVersion = "1"
// simp... |
// Copyright 2022 Franklin "Snaipe" Mathieu.
//
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
package reflectutil
import (
stdenc "encoding"
"fmt"
"os"
"reflect"
"strconv"
"strings"
"unicode"
"snai.pe/boa/encoding"
)
func UnmarshalText(to reflect.Value, ... |
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
package fakessh
import (
"context"
"io"
"io/ioutil"
"net"
"net/http"
"os"
"path/filepath"
"github.com/hash... |
// Copyright 2016 The ksched 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... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0-devel
// protoc v3.11.2
// source: pubkey.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/p... |
// ----------------------------------------------------------------------------
// Copyright (c) <NAME>, 2020
// Licensed under the MIT License.
//
// Dapr compatible REST API service for orders
// ----------------------------------------------------------------------------
package main
import (
"encoding/json"
"fm... |
/* users.go
_________________________________
Holds all user functions for Kylixor Discord Bot
<NAME>
kylixor.com
*/
package main
import (
"database/sql"
"fmt"
"time"
"github.com/bwmarrin/discordgo"
)
//----- U S E R M A N A G E M E N T -----
// CreateUser - create user with default value... |
// This is example of nRF24L01 based remote servo.
// See ../../minidev/nrfrc for transmiter application that can controll it.
package main
import (
"delay"
"fmt"
"mmio"
"rtos"
"nrf24"
"stm32/nrfdci"
"stm32/hal/dma"
"stm32/hal/exti"
"stm32/hal/gpio"
"stm32/hal/irq"
"stm32/hal/spi"
"stm32/hal/system"
"s... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"context"
"errors"
"fmt"
"github.com/facebookincubator/ent/dialect/sql/sqlgraph"
"github.com/facebookincubator/ent/schema/field"
"github.com/minskylab/collecta/ent/input"
"github.com/minskylab/collecta/ent/question"
"github.com/minskylab/collecta/u... |
package entity
import (
"context"
"gxt-park-assets/internal/app/schema"
"time"
"github.com/jinzhu/gorm"
)
// GetPcProjectDB 成本项目管理
func GetPcProjectDB(ctx context.Context, defDB *gorm.DB) *gorm.DB {
return getDBWithModel(ctx, defDB, PcProject{})
}
// SchemaPcProject 成本项目管理
type SchemaPcProject schema.PcProject... |
package layer
import "github.com/codingbeard/tfkg/layer/constraint"
import "github.com/codingbeard/tfkg/layer/initializer"
import "github.com/codingbeard/tfkg/layer/regularizer"
import tf "github.com/galeone/tensorflow/tensorflow/go"
type LConv3D struct {
activation string
activityRegularizer regularizer.R... |
package drlwe
import (
"github.com/ldsec/lattigo/v2/ring"
"github.com/ldsec/lattigo/v2/rlwe"
"github.com/ldsec/lattigo/v2/utils"
)
// KeySwitchingProtocol is an interface describing the local steps of a generic RLWE CKS protocol
type KeySwitchingProtocol interface {
AllocateShare(level int) *CKSShare
GenShare(sk... |
// Copyright 2017 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 ... |
// Code generated by protoc-gen-go.
// source: vtctldata.proto
// DO NOT EDIT!
/*
Package vtctldata is a generated protocol buffer package.
It is generated from these files:
vtctldata.proto
It has these top-level messages:
ExecuteVtctlCommandRequest
ExecuteVtctlCommandResponse
*/
package vtctldata
import proto "... |
package sublevel
import (
"log"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/syndtr/goleveldb/leveldb/util"
)
/* basic db management */
/* opens an abstract DB for the given file.
the abstract DB is said to be "a... |
package register
import (
"errors"
"fmt"
"log"
"net"
"sync"
"google.golang.org/grpc"
"github.com/gwbeacon/gwbeacon/lib"
"golang.org/x/net/context"
"google.golang.org/grpc/peer"
"github.com/gwbeacon/gwbeacon/lib/rpc"
)
type server struct {
lib.Server
sync.Mutex
timeBase int32
ids map[string]uint... |
package test
import (
"context"
"math"
"os"
"sync"
"testing"
"time"
ydb "github.com/ydb-platform/ydb-go-sdk/v3"
"github.com/ydb-platform/ydb-go-sdk/v3/table"
"github.com/ydb-platform/ydb-go-sdk/v3/trace"
)
type stats struct {
sync.Mutex
min int
inFlight int
balance int
max int
waited int
... |
package handler
import (
"encoding/json"
"net/http"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/Lunchr/luncher-api/db"
"github.com/Lunchr/luncher-api/db/model"
"github.com/Lunchr/luncher-api/facebook"
"github.com/Lunchr/luncher-api/router"
"github.com/Lunchr/luncher-api/session"
"github.com/julien... |
// author: <NAME>
// site: https://programmaticponderings.com
// license: MIT License
// purpose: RESTful Go implementation of github.com/jdkato/prose/v2 package
// for text processing, including tokenization, part-of-speech tagging, and named-entity extraction
// by https://github.com/jdkato/prose/tr... |
package udt
import (
"io"
"math"
"net"
"time"
)
const (
sock_state_new = 0
sock_state_handshake_init = 1
sock_state_handshake_finish = 2
sock_state_connected = 3
)
/*
udtSocket encapsulates a UDT socket between a local and remote address pair, as
defined by the UDT specification. udtSo... |
package gameboy
import (
"context"
"fmt"
"io"
"io/ioutil"
"github.com/scottyw/tetromino/gameboy/audio"
"github.com/scottyw/tetromino/gameboy/controller"
"github.com/scottyw/tetromino/gameboy/cpu"
"github.com/scottyw/tetromino/gameboy/display"
"github.com/scottyw/tetromino/gameboy/interrupts"
"github.com/sco... |
package application
import (
"context"
"fmt"
"flamingo.me/flamingo/v3/core/auth"
"flamingo.me/flamingo/v3/framework/web"
"flamingo.me/flamingo/v3/framework/flamingo"
cartDomain "flamingo.me/flamingo-commerce/v3/cart/domain/cart"
)
type (
// EventReceiver - handles events from other packages
EventReceiver s... |
// Copyright © 2018 Bitgrip <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
package crontab
import (
"encoding/json"
"errors"
// "fmt"
"github.com/astaxie/beego/logs"
"github.com/midoks/novelsearch/app/libs"
"github.com/midoks/novelsearch/app/models"
"html"
"strconv"
"strings"
"time"
)
type BookLinkInfo struct {
Name string
Url string
}
//小说内容更新
func CronNovelContentList(v *mod... |
package main
import (
"bufio"
"fmt"
"log"
"regexp"
"strings"
"time"
"github.com/cespare/hasty"
)
func init() {
addSolutions(17, (*problemContext).problem17)
}
func (ctx *problemContext) problem17() {
clay := make(ivec2Set)
scanner := bufio.NewScanner(ctx.f)
for scanner.Scan() {
line := scanner.Bytes()
... |
package lua
import (
"math"
"unsafe"
)
// #cgo LDFLAGS: -lluajit-5.1 -ldl -lm
//#include "glua.h"
import "C"
func pushToLua(L *C.struct_lua_State, args ...interface{}) {
for _, arg := range args {
switch arg.(type) {
case string:
cStr := C.CString(arg.(string))
defer C.free(unsafe.Pointer(cStr))
C.l... |
package main
import (
"fmt"
"log"
"os"
"os/signal"
hashpkg "github.com/reecerussell/adaptive-password-hasher"
core "github.com/reecerussell/open-social"
"github.com/reecerussell/open-social/cmd/users/handler"
"github.com/reecerussell/open-social/cmd/users/password"
"github.com/reecerussell/open-social/cmd/u... |
// *** 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 v2
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a cluster within an instance. Note t... |
package store
import (
"errors"
"fmt"
"minitube/models"
"minitube/utils"
"time"
)
var log = utils.Sugar
var timeout = 600 * time.Millisecond
// store's error
var (
ErrStoreFailed = errors.New("Store Error")
ErrRedisFailed = fmt.Errorf("%w From Redis", ErrStoreFailed)
ErrMySQLFailed = fm... |
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package main
import (
"database/sql"
"flag"
"fmt"
"garden/tools/pgperf/model"
"io/ioutil"
"log"
"math/rand"
"net/http"
_ "net/http/pprof"
"os"
"regexp"
"strings"
"sync"
"time"
_ "github.com/lib/pq"
yaml "gopkg.in/yaml.v2"
)
var pms = []int{1, 200, 2000}
func main() {
go func() {
log.Println(http.... |
package netx
import (
"bytes"
"encoding/binary"
"fmt"
"github.com/pkg/errors"
"net"
"strings"
)
func NewDNSMessage(buffer *bytes.Buffer) (*DNSMessage, error) {
// 用bytes.Buffer类型来逐个字节读取后处理的优点就是不需要自己计算读取偏移值
// 这个对于Question和Answer这种第一段长度不固定的内容处理非常方便
id := binary.BigEndian.Uint16(buffer.Next(2))
flag := binary... |
package sources
import (
"context"
"fmt"
"time"
"github.com/f-taxes/f-taxes/backend/applog"
"github.com/f-taxes/f-taxes/backend/ftx"
. "github.com/f-taxes/f-taxes/backend/global"
jobmanager "github.com/f-taxes/f-taxes/backend/jobManager"
"github.com/f-taxes/f-taxes/backend/transactions"
"github.com/kataras/g... |
package utils
import (
"encoding/hex"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/oasisprotocol/oasis-core/go/common/cbor"
"github.com/starfishlabs/oasis-evm-web3-gateway/model"
)
// New... |
package honeycomb
import (
"bytes"
"fmt"
"hash/crc32"
"io"
"sort"
"strings"
"sync"
"github.com/honeycombio/libhoney-go/transmission"
)
// TextSender implements the transmission.Sender interface by marshalling events to
// human-readable text and writing to the writer w, with optional colour
//
// the impleme... |
package gweb
import (
"github.com/chen-zyc/gweb/render"
"net/http"
"net/url"
)
// Param is a single URL parameter, consisting of a key and a value.
type Param struct {
Key string
Value string
}
// Params is a Param-slice, as returned by the router.
// The slice is ordered, the first URL parameter is also the ... |
/*
config loads and understands the tegola config format.
*/
package config
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"regexp"
"strings"
"syscall"
"time"
"github.com/BurntSushi/toml"
"github.com/go-spatial/tegola/internal/log"
)
// Config represents a tegola config file.
type Config struct {
// t... |
// Copyright 2015 <NAME>.
// All rights reserved. Use of this source code is
// governed by the MIT license, which can be found
// in the LICENSE file.
package temple
import (
"bytes"
"errors"
"github.com/albrow/prtty"
"github.com/go-humble/temple/temple/assets"
"go/format"
"io/ioutil"
"os"
"path/filepath"
"... |
package main
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
"time"
"drone-nomad/nomad"
)
const (
// SanitizeSuffix used when matching vars to sanitize
SanitizeSuffix = "_SANITIZE"
)
type (
// Repo contains information related to the repository
Repo struct {
Owner string `json:"owner" env:"DRONE_REP... |
package github
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
const noreleaseStr = "norelease"
const patchStr = "patch"
const minorStr = "minor"
const majorStr = "major"
// Version represents a semver version
// NORELEASE => no ve... |
package main
import (
"reflect"
"testing"
"github.com/BurntSushi/toml"
)
func TestURL(t *testing.T) {
type TU struct {
in string
outDst string
outRelative string
outCanonical string
}
cases := []TU{
TU{
"src/index.html",
"dst/index.html",
"/",
"https://seankhliao.com/",
... |
package api
import (
"encoding/json"
"errors"
"fmt"
"regexp"
"strings"
"github.com/mesosphere/dcos-edge-lb/pkg/apis/models"
"github.com/mesosphere/dklb/pkg/constants"
"github.com/mesosphere/dklb/pkg/util/pointers"
)
// BaseEdgeLBPoolSpec contains EdgeLB pool configuration properties that are common to both ... |
package gochinadns
import (
"context"
"sort"
"time"
"github.com/miekg/dns"
"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
)
// Server represents a DNS Server instance
type Server struct {
*serverOptions
UDPCli *dns.Client
TCPCli *dns.Client
UDPServer *dns.Server
TCPServer *dns.Server
}
/... |
// tool-compensate generates a design based on the example here:
// https://gitlab.com/gcmc/gcmc/blob/master/example/tool-compensate.gcmc
//
// Usage:
// go run examples/tool-compensate/main.go > tool-compensate.gcode
package main
import (
"fmt"
. "github.com/gmlewis/go-gcode/gcode"
"github.com/gmlewis/go-gcode/... |
package xconf
import (
"fmt"
"reflect"
"strings"
"github.com/sandwich-go/xconf/xfield"
)
// Struct Struct类型定义
type Struct struct {
raw interface{}
value reflect.Value
tagName string
tagNameDefaultValue string
fieldTagConvertor FieldTagConvertor
}
// NewStruct 构造S... |
//+build !svcw
package svcw
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
"golang.org/x/tools/imports"
)
const (
genHead = "//+build svcw\n// Code generated by SvcWrap. DO NOT EDIT.\n\n"
)
var (
l = log.New(os.Stdout, "[SVCW] ", 0)
modPath = getGoMod... |
// Copyright (c) PavedRoad. All rights reserved.
// Licensed under the Apache2. See LICENSE file in the project root
// for full license information.
//
// Apache2
// User project / copyright / usage information
// Manage database of films
package main
import (
"database/sql"
"encoding/json"
"github.com/google/... |
package server
import (
"errors"
"net/http"
"regexp"
"strconv"
"strings"
jsoniter "github.com/json-iterator/go"
"github.com/sirupsen/logrus"
"github.com/iostrovok/aura-test/response"
"github.com/iostrovok/aura-test/storage"
)
const (
MaxAllowedExtendedTTL = int64(300)
DefaultTTL = int64(30)
W... |
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
"time"
flags "github.com/jessevdk/go-flags"
"github.com/k0kubun/pp"
datadog "github.com/zorkian/go-datadog-api"
)
const appName = "circleci-queue-to-datadog"
type options struct {
Usernames string `long:"usernames" descri... |
// Copyright (c) 2020 <NAME>, 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, publish, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.