text stringlengths 3.08k 10.4k |
|---|
package virusscan
import (
"context"
"fmt"
"reflect"
avv1beta1 "github.com/mittwald/kube-av/pkg/apis/av/v1beta1"
"github.com/robfig/cron/v3"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"
"sigs... |
// *** 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 iam
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get information about a SSH ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sagemaker
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListProcessingJobsInput struct {
_ struct{} `type:"structure"`
// A filter that returns only processing jo... |
package main
import (
"context"
"fmt"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/cors"
"github.com/go-chi/render"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"sync/atomic"
"time"
)
// Rest - Rest is a rest server object
type Rest struct {
Versi... |
/*
Wrapper around the pty
Used to control (start, stop) and communicate with the tty
*/
// Most the code are taken from : https://github.com/elisescu/tty-share/blob/master/pty_master.go
package pty
import (
ptyDevice "github.com/creack/pty"
term "golang.org/x/crypto/ssh/terminal"
"log"
"os"
"os/exec"
"os/signal... |
// Package cms contains types and specialized functions for working
// with these.
package cms
import (
"net/mail"
"time"
"github.com/bahna/magazine/webserver/user"
"gopkg.in/mgo.v2/bson"
)
// Content represents a piece of content which belongs to one or several topics
// and one or several authors.
type Content... |
package util
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"runtime"
"runtime/debug"
"strings"
"github.com/atlassian/git-lob/Godeps/_workspace/src/github.com/mitchellh/go-homedir"
)
var (
// Console output (can be overridden by changing)
consoleErr io.Writer = os.Stderr
consoleOut ... |
// Copyright (c) 2020 Red Hat, Inc.
//
// The Universal Permissive License (UPL), Version 1.0
//
// Subject to the condition set forth below, permission is hereby granted to any
// person obtaining a copy of this software, associated documentation and/or data
// (collectively the "Software"), free of charge and under a... |
package internal
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/google/go-github/v42/github"
)
func (r *Backup) Run() {
if err := r.Init(); err != nil {
os.Exit(1)
return
}
if r.EnableStar {
_ = r.SaveStar()
} else {
fmt.Println("Star is disabled")
}
if r.EnableFollo... |
package main
import (
"bytes"
"context"
"fmt"
"io"
"github.com/asalih/guardian/waf/engine"
"net"
"net/http"
"net/url"
"time"
"golang.org/x/crypto/acme/autocert"
"github.com/asalih/guardian/response"
"github.com/asalih/guardian/data"
"github.com/asalih/guardian/models"
"github.com/asalih/guardian/re... |
package chongyun
import (
"fmt"
"github.com/genshinsim/gcsim/pkg/core"
)
func (c *char) Attack(p map[string]int) (int, int) {
f, a := c.ActionFrames(core.ActionAttack, p)
ai := core.AttackInfo{
Abil: fmt.Sprintf("Normal %v", c.NormalCounter),
ActorIndex: c.Index,
AttackTag: core.AttackTagNormal,
I... |
package proto
// go:generate make generate
import (
"encoding/json"
"fmt"
"runtime/debug"
"time"
"github.com/MagalixTechnologies/uuid-go"
"github.com/golang/snappy"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const (
ResourceRequirementKindSet = "set"
ResourceRequirementKindDe... |
// Copyright(c) 2018 DSiSc Group 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 gosparkpost
import (
"context"
"encoding/json"
"fmt"
"strings"
"github.com/pkg/errors"
)
// https://www.sparkpost.com/api#/reference/recipient-lists
var RecipientListsPathFormat = "/api/v%d/recipient-lists"
// RecipientList is the JSON structure accepted by and returned from the SparkPost Recipient Lis... |
// +build integration
package main
import (
"context"
"encoding/json"
"fmt"
"testing"
"time"
"github.com/google/uuid"
"github.com/jackc/pgx/v4"
"github.com/stretchr/testify/require"
"github.com/osbuild/osbuild-composer/internal/jobqueue"
"github.com/osbuild/osbuild-composer/internal/jobqueue/dbjobqueue"
... |
package tcp
import (
"errors"
"time"
"github.com/hsheth2/logs"
)
func (c *TCB) packetSender() {
// TODO: deal with data in urgSend buffers
c.sendBufferUpdate.L.Lock()
defer c.sendBufferUpdate.L.Lock()
for {
/*logs*/ logs.Trace.Println(c.hash(), "Beginning send with sendBuffer len:", len(c.sendBuffer))
if... |
package windowmanager
import (
"fmt"
"log"
"time"
"github.com/BurntSushi/xgb/xproto"
"github.com/BurntSushi/xgbutil"
"github.com/BurntSushi/xgbutil/ewmh"
"github.com/BurntSushi/xgbutil/xevent"
"github.com/BurntSushi/xgbutil/xprop"
"github.com/BurntSushi/xgbutil/xwindow"
"github.com/janbina/swm/internal/util... |
package main
import (
"encoding/json"
. "gopkg.in/check.v1"
"testing"
)
// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) { TestingT(t) }
type TasksS struct{}
var _ = Suite(&TasksS{})
func testJson() []byte {
json := []byte(`{
"tasks": [
{
"appId": "/task1",
"id": "task1",
"host... |
package wire
import (
"bytes"
"io"
"math"
"reflect"
"testing"
)
func allocType(t *testing.T, src interface{}) (dst interface{}) {
t.Helper()
srcType := reflect.TypeOf(src)
if srcType.Kind() == reflect.Ptr {
dst = reflect.New(srcType.Elem()).Interface()
} else {
dst = reflect.New(srcType).Interface()
}
... |
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package db 数据库操作底层接口定义以及实现包括:leveldb、
// memdb、mvcc、badgerdb、pegasus、ssdb
package db
import (
"bytes"
"fmt"
"github.com/33cn/chain33/types"
... |
package streamer_test
import (
"bytes"
"errors"
"fmt"
"os"
"testing"
"time"
require "github.com/lyraproj/dgo/dgo_test"
"github.com/lyraproj/dgo/streamer"
"github.com/lyraproj/dgo/vf"
)
type badWriter int
func (b badWriter) Write(p []byte) (n int, err error) {
return 0, errors.New(`bang`)
}
func ExampleJS... |
package gomq
import (
"crypto/tls"
"crypto/x509"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"github.com/Shopify/sarama"
cluster "github.com/bsm/sarama-cluster"
"github.com/dynamicgo/config"
"github.com/dynamicgo/slf4go"
mq "github.com/inwecrypto/gomq"
)
var logger = slf4go.Get("mq")
// AliyunProduc... |
package iowrap
import (
"io"
)
// LimitReadCloser will return a limited hasCall closer.
func LimitReadCloser(r io.ReadCloser, n int64) *LimitedReadCloser {
return &LimitedReadCloser{r, io.LimitReader(r, n)}
}
// LimitedReadCloser hasCall from underlying r and provide Close as well.
type LimitedReadCloser struct {
... |
// Copyright 2017 clair authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"os/exec"
"os/signal"
"path"
"strings"
"syscall"
"time"
"github.com/kamasamikon/miego/conf"
"github.com/kamasamikon/miego/klog"
)
// KService : Micro Service definition
type KService struct {
// Base info
ServiceName string... |
package collectors
import "strings"
// Collector specifies a single metrics collector identifier.
type Collector string
// Collectors specifies a list of metrics collectors.
type Collectors []Collector
const (
crioPrefix = "crio_"
// Subsystem is the namespace where the metrics are being registered.
Subsystem =... |
// 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 controller
import (
"context"
"fmt"
"strings"
"go.chromium.org/luci/common/logging"
crimsonconfig "go.chromium.org/luci/machine-db/api/c... |
package vpx
import "unsafe"
const VPX_TS_MAX_PERIODICITY = 16
const VPX_TS_MAX_LAYERS = 5
const VPX_MAX_LAYERS = 12
const VPX_SS_MAX_LAYERS = 5
const VPX_SS_DEFAULT_LAYERS = 1
const VPX_ENCODER_ABI_VERSION = 25
const VPX_CODEC_CAP_PSNR = 0x10000
const VPX_CODEC_CAP_OUTPUT_PARTITION = 0x20000
const VPX_CODEC_USE_PSNR ... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package opsworks
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/opsworks/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
/*
Copyright 2021.
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 un... |
package quadtree
import (
vec "github.com/etic4/vecmath"
rl "github.com/gen2brain/raylib-go/raylib"
)
//Centered ...
type Centered interface {
Center() vec.Vec2
Width() float64
Height() float64
Intersect(Centered) bool
}
//Quadtree ...
type Quadtree struct {
points []Centered
maxPoints int
divided bool... |
package main
import (
"os"
"regexp"
"strconv"
"sync"
"github.com/cloudflare/pint/internal/checks"
"github.com/cloudflare/pint/internal/config"
"github.com/cloudflare/pint/internal/discovery"
"github.com/cloudflare/pint/internal/output"
"github.com/cloudflare/pint/internal/parser"
"github.com/cloudflare/pint... |
package gui
import (
"fmt"
"reflect"
"strconv"
"strings"
"github.com/gdamore/tcell"
"github.com/gofrs/uuid"
"github.com/rivo/tview"
)
const (
moveNext int = iota + 1
movePre
)
type Tree struct {
*tview.TreeView
OriginRoot *tview.TreeNode
}
func NewTree() *Tree {
t := &Tree{
TreeView: tview.NewTreeVie... |
package controller
import (
"encoding/json"
"fmt"
"mus_projekt/app/controller/protocol"
"mus_projekt/app/controller/templates"
"mus_projekt/app/model"
"mus_projekt/app/model/query"
"net/http"
"time"
)
/*
The arduino.go controller is managing all
incoming http requests for the arduino
the path variables wil... |
// Copyright 2018-2019 The logrange 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... |
// Code generated by go-swagger; DO NOT EDIT.
package retention
// 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.co... |
package pivotaltracker
import (
// Stdlib
"errors"
"fmt"
"os"
"strconv"
// Internal
"github.com/salsaflow/salsaflow/action"
"github.com/salsaflow/salsaflow/errs"
"github.com/salsaflow/salsaflow/log"
"github.com/salsaflow/salsaflow/prompt"
"github.com/salsaflow/salsaflow/prompt/storyprompt"
"github.com/sal... |
package main
import (
"encoding/hex"
"encoding/json"
"fmt"
"mime/multipart"
"net/http"
"os"
"time"
"unicode/utf8"
log "github.com/Sirupsen/logrus"
"github.com/go-redis/redis"
"github.com/gorilla/mux"
"github.com/kelseyhightower/envconfig"
uuid "github.com/satori/go.uuid"
)
const (
MULTIPART_FORM_BUFFER... |
// *** 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 efs
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for AWS::EFS::Acce... |
package pages
import (
"fmt"
"strings"
"github.com/sclevine/agouti"
"github.com/gky360/atsrv/constants"
"github.com/gky360/atsrv/models"
)
type TaskPage struct {
page *agouti.Page
contestID string
taskID string
}
func (p *TaskPage) Page() *agouti.Page {
return p.page
}
func (p *TaskPage) Hostname... |
package main
import (
"encoding/json"
"fmt"
"go/doc"
"go/parser"
"go/token"
"os"
)
// Func represents a function declaration.
type Func struct {
Doc string `json:"doc"`
Name string `json:"name"`
PackageName string `json:"packageName"`
PackageImportPath string `json:"packageI... |
package mbus
import (
"encoding/json"
"errors"
"fmt"
"sync"
"time"
"github.com/rs/zerolog/log"
"github.com/streadway/amqp"
"github.com/pedro-r-marques/workflow/pkg/engine"
)
const defaultMessageQueueName = "workflow-manager"
var errNotConnected = errors.New("unable to send message to RabbitMQ server: not c... |
/* license: https://mit-license.org
*
* DIM-SDK : Decentralized Instant Messaging Software Development Kit
*
* Written in 2021 by Moky <<EMAIL>>
*
* ==============================================================================
* The MIT License (MIT)
*
* Copyright (c) 2021 <NAM... |
package config
import (
"errors"
"fmt"
"gopkg.in/gcfg.v1"
"os"
"path/filepath"
"scyd/cronsched"
"scyd/sched"
"strings"
)
const DEFAULT_RUN_DIR = "/var/lib/scylla"
const DEFAULT_CONNECT_TIMEOUT = 20
const DEFAULT_READ_TIMEOUT = 86400
const DEFAULT_MAX_RUN_HISTORY = 50
type PoolSpec struct {
Name string
H... |
package deploy
import (
"errors"
"fmt"
"strconv"
"strings"
"time"
"github.com/sirupsen/logrus"
v1 "k8s.io/api/batch/v1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"ntci/ci-build/k8s/dataBus"
"ntci/ci-build/k8s/... |
// Copyright 2021 Orange SA
//
// 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... |
package redis
import (
"crypto/md5"
"fmt"
se "github.com/billcoding/flygo/session"
"github.com/go-redis/redis"
"io"
"math/rand"
"net/http"
"os"
"strconv"
"strings"
"sync"
"time"
)
const defaultPrefixKey = "session:"
type provider struct {
keyPrefix string
options *redis.Options
client *redis.Clie... |
package brew
import (
"archive/tar"
"archive/zip"
"bytes"
"compress/gzip"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"time"
"github.com/manifoldco/promulgate/artifact"
"github.com/manifoldco/promulgate/git"
)
var supportedReleases = []string{"high_sierra", "sierra", "el_capitan", "yosemite"}
//... |
package gonashi
import (
"strings"
"sync"
"time"
"github.com/eapache/channels"
"github.com/flemay/gatt"
)
var ClientOptions = []gatt.Option{
gatt.MacDeviceRole(gatt.CentralManager),
}
type Gonashi struct {
device gatt.Device
discovered *discovered
connected *konashiMap
}
func NewGonashi() (Gonashi, e... |
package main
import (
"encoding/json"
"fmt"
"time"
"github.com/gorilla/websocket"
)
type Client struct {
name string
id int
host bool
hadPong bool
ws *websocket.Conn
room *Room
lobby *Lobby
roomin chan string
wsin chan string
wsout chan string
control chan bool
w... |
package lazymap
import (
"math"
"sort"
"sync"
"time"
)
type ItemStatus int
const (
None ItemStatus = iota
Enqueued
Running
Done
Failed
Canceled
)
type LazyMap struct {
mux sync.RWMutex
m map[string]*lazyMapItem
expire time.Duration
errorExpire time.Duration
initExpi... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"log"
"net"
"net/http"
"os"
"strings"
"time"
"github.com/gavinwade12/sendkey"
"github.com/gavinwade12/sendkey/internal/app"
"github.com/gavinwade12/sendkey/internal/mysql"
"github.com/google/uuid"
"github.com/julienschmidt/httprouter"
"githu... |
// Copyright (c) 2020-2021 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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/license... |
package cisetup
import (
"fmt"
"strconv"
"strings"
"github.com/jfrog/jfrog-cli-core/utils/coreutils"
)
const (
m2pathCmd = "MVN_PATH=`which mvn` && export M2_HOME=`readlink -f $MVN_PATH | xargs dirname | xargs dirname`"
jfrogCliRtPrefix = "jfrog rt"
jfrogCliConfig = "jfrog c add"
jfro... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package iam
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the password policy ... |
package tis
import (
"errors"
"fmt"
"regexp"
"strings"
)
// GenerateLabelMap maps defined labels to instruction location
func GenerateLabelMap(instrArr []string) (map[string]int, error) {
labelRe := regexp.MustCompile(`^\s*(\w+):`)
labelMap := make(map[string]int)
for i, line := range instrArr {
matches := ... |
/*
Copyright 2017 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, ... |
/**
* Copyright (c) 2018 Dell Inc., or its subsidiaries. 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
*/
p... |
package arangodb
import (
"context"
"fmt"
"github.com/arangodb/go-driver"
"github.com/arangodb/go-driver/http"
"github.com/gofiber/utils"
"time"
)
// Storage interface that is implemented by storage providers
type Storage struct {
db driver.Database
gcInterval time.Duration
done chan struct{}
... |
package server
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"strings"
"github.com/gorilla/csrf"
log "github.com/sirupsen/logrus"
)
type middleware struct {
http.Handler
}
// IsAPICall returns true if request Accepts 'application/json'
func isApiCall(r *http.Request) bool ... |
// Copyright 2015 <<EMAIL>{AT}<EMAIL>>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package errors_test
import (
"encoding/json"
"fmt"
"log"
"reflect"
"runtime"
"strings"
"github.com/chai2010/errors"
)
func Example() {
err0 := ... |
/*
* Copyright (c) 2018 VMware Inc. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*
* 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/LI... |
package view
import (
"gioui.org/io/pointer"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/text"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
"gioui.org/x/component"
"golang.org/x/image/colornames"
"image"
"image/color"
"protonet.live/database"
"protonet.live/service"
"time"
)
type Lis... |
/*
Copyright (c) 2019 mad-day
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublice... |
package controllers
import (
"context"
"github.com/galenliu/gateway/api/models/container"
"github.com/galenliu/gateway/pkg/addon/devices"
messages "github.com/galenliu/gateway/pkg/ipc_messages"
"github.com/galenliu/gateway/pkg/logging"
"github.com/galenliu/gateway/pkg/util"
"github.com/gofiber/fiber/v2"
"githu... |
package nginx
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
"regexp"
"strconv"
"strings"
"github.com/GannettDigital/paas-api-utils/utilsHTTP"
"github.com/Sirupsen/logrus"
)
var runner utilsHTTP.HTTPRunner
// NAME - name of plugin
const NAME string = "nginx"
// PROVIDER -
const PROVIDER string = ... |
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... |
package slog_test
import (
"context"
"io"
"net"
"os"
"testing"
"time"
"go.opencensus.io/trace"
"golang.org/x/xerrors"
"cdr.dev/slog"
"cdr.dev/slog/sloggers/sloghuman"
"cdr.dev/slog/sloggers/slogstackdriver"
"cdr.dev/slog/sloggers/slogtest"
)
func Example() {
log := slog.Make(sloghuman.Sink(os.Stdout))
... |
package websocket
import (
"encoding/binary"
"net"
"sync"
"github.com/lesismal/nbio/nbhttp"
)
const (
maxFrameHeaderSize = 14
maxControlFramePayloadSize = 125
framePayloadSize = 4096 - maxFrameHeaderSize
)
// The message types are defined in RFC 6455, section 11.8.
const (
TextMessage in... |
package graduate
import (
"fmt"
"scholl/lesson"
"scholl/student"
)
type GraduateResult struct {
StudentName string
Final lesson.Score
IsGraduate bool
}
/* 'Re-typeing' ile gittikçe karmaşıklaşan ve ilk bakışta çok fazla anlam
ifade etmeyen tiplerin daha anlamlı hale gelmesini sağladık. Bu kodun
okunabil... |
// Copyright (C) 2022 Storj Labs, Inc.
// See LICENSE for copying information.
package db
import (
"context"
"database/sql"
"errors"
"strconv"
"strings"
"time"
logging "github.com/ipfs/go-log/v2"
_ "github.com/jackc/pgx/v4/stdlib" // registers pgx as a tagsql driver.
"github.com/spacemonkeygo/monkit/v3"
"gi... |
package monitor
import (
"context"
"github.com/nats-io/nuid"
"github.com/kubemq-io/kubemq-community/config"
pb "github.com/kubemq-io/protobuf/go"
"sync"
"github.com/kubemq-io/kubemq-community/pkg/logging"
"encoding/json"
"fmt"
"github.com/kubemq-io/kubemq-community/pkg/client"
)
const middlewareCommChan... |
package query
import (
"net/url"
"strconv"
"strings"
)
func Encode(value map[string]interface{}) string {
arr := make([]string, 0)
if value != nil {
for name, val := range value {
buildParams(url.QueryEscape(name), val, &arr)
}
}
return strings.Join(arr, "&")
}
func appendValue(prefix string, value int... |
package validate
import (
"fmt"
"sync"
pb2 "protoc/contractcode"
pb "protoc/gossip"
"crypto/md5"
"github.com/gogo/protobuf/proto"
"github.com/leesper/couchdb-golang"
)
const (
// DefaultBaseURL is the default address of CouchDB server.
DefaultBaseURL = "http://10.20.24.26:5984/"
)
//BlockInfo regarding t... |
package netlink
import (
"reflect"
"testing"
)
var (
tcpInfoData []byte
tcpInfo *TCPInfo
)
func init() {
tcpInfoData = []byte{
1, 0, 0, 0, 0, 7, 120, 1, 96, 216, 3, 0, 64,
156, 0, 0, 120, 5, 0, 0, 64, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 236, 216, 0, 0, 0, 0, 0, 0, 56... |
package skeleton
import (
"context"
"fmt"
"log"
"strconv"
logbookEntity "logbook/internal/entity/logbook"
packinglistEntity "logbook/internal/entity/packinglist"
"logbook/pkg/errors"
)
// LogBook ...
type LogBook interface {
GetFirebasePackingListData(ctx context.Context) ([]packinglistEntity.PackingList, er... |
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"path/filepath"
"strings"
"log"
"os"
"regexp"
"text/template"
"time"
"code.sajari.com/docconv"
"github.com/Masterminds/sprig"
"github.com/PuerkitoBio/goquery"
"github.com/gocolly/colly/v2"
"github.com/gocolly/colly/v2/debug"
)
type Configura... |
/*
Copyright 2016 - 2017 Huawei Technologies Co., Ltd. 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 applic... |
// Package ec2 implements various AWS EC2 operations.
package ec2
import (
"context"
"errors"
"fmt"
"time"
"github.com/aws/aws-k8s-tester/pkg/ctxutil"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface"
"github.com/a... |
package handlers
import (
"bytes"
"context"
"image/jpeg"
"mime/multipart"
"net/http"
"net/textproto"
"strconv"
"sync"
"time"
cameraservices "github.com/byuoitav/camera-services"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type stream struct {
sync.Mutex
subs map[chan []byte]struct{}
done chan struc... |
package mark
import (
"bufio"
"io"
"os"
)
type parseState struct {
*Document
line string
index, lineNum int
start, startName, startUri int
endDefName int
canDefine bool
opened, referencing, defining bool
code, multiCode ... |
// Copyright 2019 Altinity Ltd and/or its affiliates. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... |
/*
Copyright 2015 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 law or agreed to in ... |
package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func main() {
scanner := bufio.NewScanner(os.Stdin)
tc := readNum(scanner)
for tc > 0 {
n := readNum(scanner)
points := make([][]int, n)
for i := 0; i < n; i++ {
points[i] = readNNums(scanner, 2)
}
res := solve(n, points)
for _, ans := range res... |
package blobstore
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
remoteexecution "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
"github.com/buildbarn/bb-storage/pkg/util"
"github.com/google/uuid"
"google.golang.org/genproto/googleapis/bytestream"
"google.golang.org/grpc"
"google.go... |
// DONTCOVER
// nolint
package v04
import (
"encoding/hex"
"encoding/json"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// ModuleName nolint
ModuleName = "oracle"
)
type (
// GenesisState - all oracle state that must be provided at genesis
GenesisState struct {
Params Params ... |
// 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... |
// Copyright (c) 2021 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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/LIC... |
package kafka
import (
"bufio"
"bytes"
"time"
)
// Message is a data structure representing gxkafka messages.
type Message struct {
// Topic is reads only and MUST NOT be set when writing messages
Topic string
// Partition is reads only and MUST NOT be set when writing messages
Partition int
Offset int64
... |
package odoo
import (
"fmt"
)
// MailTestSimple represents mail.test.simple model.
type MailTestSimple struct {
LastUpdate *Time `xmlrpc:"__last_update,omptempty"`
CreateDate *Time `xmlrpc:"create_date,omptempty"`
CreateUid *Many2One `xmlrpc:"create_uid,omptempty... |
package client
import (
"crypto/tls"
"crypto/x509"
"fmt"
"sync"
"github.com/blang/vfs"
"github.com/go-logr/logr"
"github.com/google/uuid"
. "github.com/icza/gox/gox"
"github.com/pkg/errors"
"github.com/yugabyte/yb-tools/yugatool/api/yb/master"
"github.com/yugabyte/yb-tools/yugatool/api/yugatool/config"
"g... |
package tftypes
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
)
// Type is an interface representing a Terraform type. It is only meant to be
// implemented by the tftypes package. Types define the shape and
// characteristics of data coming from or being sent to Terraform.
type Type interface {
// ... |
// MIT License
// Copyright (c) 2019 <NAME>
// 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, p... |
// Package gocoverutil implements merging of go cover profiles and running go test -cover with correct flags.
package gocoverutil
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"golang.org/x/tools/cover"
)
type byLines []cover.ProfileBlock
func (bl byLines) Len() i... |
// Copyright 2015 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
/**
* Copyright 2020 Appvia Ltd <<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 ... |
package api
import (
"strings"
"time"
"github.com/allenai/bytefmt"
)
type JobKind string
const (
JobKindExecution JobKind = "execution"
JobKindSession JobKind = "session"
)
type Job struct {
Kind JobKind `json:"kind"`
// Identity
ID string `json:"id"`
Name string `json:"name,omitempty"`... |
package gcli
import (
"fmt"
"strings"
"github.com/gookit/color"
)
/*************************************************************
* console log
*************************************************************/
var level2name = map[uint]string{
VerbError: "ERROR",
VerbWarn: "WARNING",
VerbInfo: "INFO",
VerbDe... |
package archive_test
import (
"bytes"
"fmt"
"io"
"testing"
"github.com/cihub/seelog/archive"
"github.com/cihub/seelog/archive/gzip"
"github.com/cihub/seelog/archive/tar"
"github.com/cihub/seelog/archive/zip"
"github.com/cihub/seelog/io/iotest"
)
const (
gzipType = "gzip"
tarType = "tar"
zipType = "zip"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.