text
stringlengths
3.08k
10.4k
package otkafka import ( "fmt" "time" "github.com/DoNewsCode/core/config" "github.com/DoNewsCode/core/contract" "github.com/DoNewsCode/core/di" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/opentracing/opentracing-go" "github.com/segmentio/kafka-go" ) /* Providers is a set of dep...
/* Copyright © 2021 <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 writin...
package cmd import ( "testing" "github.com/stretchr/testify/assert" ) func TestBadSortingKey(t *testing.T) { ts := make([]Response, 0) _, err := sortResponses("dummy_key", ts) assert.NotNil(t, err) } func TestSortOnStars(t *testing.T) { r1 := build("aaa", 9, 0, 0, 0) r2 := build("aac", 9, 0, 0, 0) r3 := bui...
// Code generated by gotdgen, DO NOT EDIT. package tg import ( "context" "errors" "fmt" "sort" "strings" "github.com/gotd/td/bin" "github.com/gotd/td/tdp" ) // No-op definition for keeping imports. var _ = bin.Buffer{} var _ = context.Background() var _ = fmt.Stringer(nil) var _ = strings.Builder{} var _ = e...
/** * (C) 2021 Geotab * * All files and artifacts in the repository at https://github.com/MEAE-GOT/W3C_VehicleSignalInterfaceImpl * are licensed under the provisions of the license provided by the LICENSE file in this repository. * **/ package main import ( "os" "fmt" "time" "strings" "strconv" "net/http" "enco...
// Tool to increment the version number, read and write rbxmk/version.go, then // create and tag a commit. Must run in root of repo. // // Increment major version: // // go run _tools/version.go +major // // Increment minor version: // // go run _tools/version.go +minor // // Increment patch version: // // ...
package sup_test import ( "bytes" "context" "encoding/hex" "errors" "flag" "fmt" "io/ioutil" "log" "os" "testing" "impractical.co/sup" "impractical.co/sup/memory" yall "yall.in" "yall.in/colour" ) type Factory interface { NewStorer(ctx context.Context) (sup.Storer, error) TeardownStorers() error } v...
package up9 import ( "bytes" "compress/zlib" "encoding/json" "fmt" "github.com/romana/rlog" "github.com/up9inc/mizu/shared" "io/ioutil" "log" "mizuserver/pkg/database" "mizuserver/pkg/models" "net/http" "net/url" "strings" "time" ) const ( AnalyzeCheckSleepTime = 5 * time.Second ) type GuestToken stru...
/* date: 2019-04-29 17:02:15 Instructions Output The action of a Caesar cipher is to replace each plaintext letter with a different one a fixed number of places up or down the alphabet. This program performs a variation of the Caesar shift. The shift increases by 1 for each character (on each iteration). If the shif...
package auth import ( "context" "crypto/x509" "encoding/json" "fmt" "net/http" "net/url" "strings" "sync" "go.aporeto.io/trireme-lib/controller/pkg/secrets" "go.aporeto.io/trireme-lib/controller/pkg/servicetokens" "go.aporeto.io/trireme-lib/controller/pkg/urisearch" "go.aporeto.io/trireme-lib/controller/p...
package slice import ( "bufio" "context" "errors" "flag" "fmt" "io" "os" "github.com/brimsec/zq/cmd/pcap/root" "github.com/brimsec/zq/pcap" "github.com/brimsec/zq/pcap/pcapio" "github.com/brimsec/zq/pkg/fs" "github.com/brimsec/zq/pkg/nano" "github.com/mccanne/charm" ) var Slice = &charm.Spec{ Name: "s...
package main import ( "log" "math" "github.com/unixpickle/model3d/model2d" "github.com/unixpickle/model3d/model3d" "github.com/unixpickle/model3d/render3d" ) const Thickness = 0.9 func main() { pumpkin := &model3d.SubtractedSolid{ Positive: PumpkinSolid{Scale: 1}, Negative: PumpkinSolid{Scale: Thickness}...
/* Package gqlclient is a simple client package for accessing GrpapQL APIs. */ package gqlclient import ( "bytes" "encoding/json" "errors" "io/ioutil" "net/http" "strings" "time" ) // GqlClient is an interface providing methods to execute GraphQl operations. type GqlClient interface { // Query sends a GraphQL...
package netbox // list is plain JSON list having structure nobody cares about type list []interface{} // Object is plain JSON object having structure nobody cares about type object map[string]interface{} // ContainerBrief is DTO definition of brief container's data, part of DeviceBrief type ContainerBrief struct { ...
// Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2018-present Datadog, Inc. // +build secrets,windows package secrets import ( "fmt" "os" "sysca...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package lifecycle_test import ( "bytes" "errors" "fmt" "os" pb "github.com/hyperledger/fabric-protos-go/peer" "github.com/hyperledger/fabric-sdk-go/pkg/client/resmgmt" . "github.com/onsi/ginkgo" . "github.co...
// 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...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: sync/mode.proto package sync // import "github.com/havoc-io/mutagen/pkg/sync" 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 v...
package utils import ( "bufio" "bytes" "encoding/binary" "fmt" "net" "os" "sort" "strconv" "strings" "unsafe" ) var nativeEndian binary.ByteOrder const UnknowFunctionName = "[unknown function]" type ksym struct { Addr uint64 Name string } var ksymsList []*ksym = make([]*ksym, 0) var ksymsProbe map[stri...
package priorityclasses import ( "context" context2 "github.com/loft-sh/vcluster/cmd/vcluster/context" "github.com/loft-sh/vcluster/pkg/util/loghelper" "github.com/loft-sh/vcluster/pkg/util/translate" schedulingv1 "k8s.io/api/scheduling/v1" "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/met...
package main import ( "context" "expvar" "flag" "fmt" "log" "net" "net/http" "os" "os/signal" "time" alog "github.com/apex/log" "github.com/apex/log/handlers/text" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sd...
package main import ( "bytes" "context" "crypto/subtle" "fmt" "log" "net/http" "time" nanoid "github.com/matoous/go-nanoid" "github.com/valyala/fasthttp" ) var ( mimes = map[imageType]string{ imageTypeJPEG: "image/jpeg", imageTypePNG: "image/png", imageTypeWEBP: "image/webp", } authHeaderMust []b...
package myxml import ( "bufio" "io/ioutil" "os" "path/filepath" "strings" "unicode/utf8" XML "github.com/lestrrat-go/libxml2" XMLtypes "github.com/lestrrat-go/libxml2/types" XMLxsd "github.com/lestrrat-go/libxml2/xsd" "github.com/pkg/errors" ) type DocWrapper interface { Doc() XMLtypes.Document Schema() ...
/** * @Author: vincent * @Description: * @File: service_info * @Version: 1.0.0 * @Date: 2022/6/2 21:37 */ package dao import ( "go-examples/course/gateway/go_gateway_demo/dto" "go-examples/course/gateway/go_gateway_demo/public" "time" "github.com/e421083458/gorm" "github.com/gin-gonic/gin" ) type Servic...
/** The MIT License (MIT) Copyright (c) 2014 <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, me...
package ui import ( "strconv" "time" "gioui.org/layout" "gioui.org/op/clip" "gioui.org/op/paint" "gioui.org/text" "gioui.org/unit" "gioui.org/widget" "git.sr.ht/~pierrec/giox/layoutx" "github.com/pierrec/games/blocks/internal/version" "github.com/pierrec/games/blocks/internal/widgets" ) type home struct ...
// Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lice...
package gardener import ( "encoding/json" "fmt" "io" "time" "code.cloudfoundry.org/garden" "code.cloudfoundry.org/lager" ) type container struct { logger lager.Logger handle string containerizer Containerizer volumizer Volumizer networker Networker propertyManager PropertyManager ...
// Code generated by go-swagger; DO NOT EDIT. package snmp_managers // 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 "githu...
package orchestrator import ( "fmt" "github.com/openebs/maya/pkg/nethelper" "github.com/openebs/maya/pkg/util" "github.com/openebs/maya/types/v1" ) // VolumeProvisionerProfile abstracts & exposes a persistent volume provisioner's // runtime features. // // NOTE: // A persistent volume provisioner can align to...
package common import ( "fmt" "github.com/spf13/pflag" "github.com/timescale/tsbs/internal/utils" "github.com/timescale/tsbs/pkg/targets/constants" "strings" "time" ) // Generator is a single entity which generates data from its respective measurements. type Generator interface { Measurements() []SimulatedMeas...
// Copyright © 2016 <NAME> <<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 agreed...
// Copyright (c) 2021 Cisco 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/LICE...
package cpu import ( "bytes" "fmt" "strings" ) type FileDesc struct { Name string Off uint64 Len uint64 } func (f *FileDesc) shift(off uint64) *FileDesc { if f != nil && off < f.Len { return &FileDesc{ Name: f.Name, Len: f.Len - off, Off: f.Off + off, } } return f } type Page struct { Add...
package main import ( "fmt" "log" "runtime" "strings" "github.com/go-gl/gl/v3.3-core/gl" "github.com/go-gl/glfw/v3.2/glfw" ) var vertexShaderSource1 = ` #version 330 in vec3 vp; void main() { gl_Position = vec4(vp, 1.0); } ` + "\x00" var vertexShaderSource2 = ` #version 330 in vec3 vp; void main() { gl_Posi...
// Cloud Driver Interface of CB-Spider. // The CB-Spider is a sub-Framework of the Cloud-Barista Multi-Cloud Project. // The CB-Spider Mission is to connect all the clouds with a single interface. // // * Cloud-Barista: https://github.com/cloud-barista // // This is Resouces interfaces of Cloud Driver. // // by CB...
package schema import ( "fmt" "strconv" "strings" "time" "github.com/gtopper/v3io-tsdb/pkg/aggregate" "github.com/v3io/v3io-tsdb/pkg/config" "github.com/gtopper/v3io-tsdb/pkg/utils" "github.com/pkg/errors" ) const ( Version = 2 ) func NewSchema(v3ioCfg *config.V3ioConfig, samplesIngestionRate, aggregationG...
package main import ( "context" "encoding/json" "fmt" "log" "os" "time" mqtt "github.com/eclipse/paho.mqtt.golang" "github.com/gomodule/redigo/redis" "github.com/hugoatease/garfunkel/clients" "github.com/hugoatease/garfunkel/credentials" "github.com/hugoatease/garfunkel/queue" kafka "github.com/segmentio/...
package main import ( "context" "encoding/base64" "encoding/json" "fmt" "io/ioutil" "log" "os" "strings" "github.com/gofiber/fiber" "github.com/jordan-wright/email" "github.com/matcornic/hermes/v2" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/gmail/v1" "gopkg.in/yaml.v2" ) ...
// Copyright (c) 2018 Aidos Developer // 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 user import ( "bufio" "fmt" "io" "os" "strconv" "strings" ) type User struct { Name string Pass string Uid int Gid int Gecos string Home string Shell string } type Group struct { Name string Pass string Gid int List []string } func parseLine(line string, v ...interface{}) { if line...
// Package ignorefs implements a wrapper that hides ignored files listed in '.kopiaignore' and in policies attached to directories. package ignorefs import ( "bufio" "context" "strings" "github.com/pkg/errors" "github.com/kopia/kopia/fs" "github.com/kopia/kopia/internal/ignore" "github.com/kopia/kopia/snapsho...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: go.chromium.org/luci/machine-db/api/common/v1/states.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....
package main import ( "encoding/json" "fmt" "strings" "io/ioutil" "strconv" "net/http" "./classes/sr" "./classes/helpers" "os" "./classes/common" "path/filepath" ) // RestService type RestService struct { servicePort int serviceName string basePath string packages map[string]*helpers.Pack...
package escache import "github.com/1340691923/ElasticView/platform-basic-libs/util" //一些需要用到的结构 type Json map[string]interface{} type Sort struct { Field string Ascending bool } type Page struct { PageNum int PageSize int } type EsConnectID struct { EsConnectID int `json:"es_connect"` } type EsMapGetPr...
package telegram import ( "github.com/pkg/errors" "github.com/pquerna/ffjson/ffjson" "github.com/strongo/bots-api-telegram" "github.com/strongo/bots-framework/core" "time" ) type tgWebhookInput struct { update *tgbotapi.Update // TODO: Make a pointer? logRequest func() } // TgWebhookInput is a wrapper of ...
/* Package cmd includes relayer commands Copyright © 2020 <NAME> <<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 applica...
package main import ( "bytes" "database/sql" "fmt" _ "github.com/mattn/go-sqlite3" "golang.org/x/text/runes" "golang.org/x/text/transform" "golang.org/x/text/unicode/norm" "io" "net/http" "os" "os/exec" "strings" "time" "unicode" "unicode/utf8" ) const ( version = "0.1.5" ) func NormalizeString(text ...
package keeper import ( "fmt" sdkErr "github.com/cosmos/cosmos-sdk/types/errors" "github.com/commercionetwork/commercionetwork/x/id/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/supply" ) type Keeper ...
/******* * Author: <NAME> * Date: 01/10/2020 * company: MoltenMinds ********/ package main import ( "bufio" "encoding/json" "fmt" "log" "os" "path/filepath" "strings" "github.com/MoltenMinds/ASAtoVSXParser/models" ) var filename = "input" var baseName = "input.txt" var outputFile = "-output" var interfaces...
package vim import ( "context" "errors" "log" "path/filepath" "github.com/kiteco/kiteco/kite-go/client/internal/plugins/vim" "github.com/kiteco/kiteco/kite-go/client/internal/plugins_new/editor" "github.com/kiteco/kiteco/kite-go/client/internal/plugins_new/fs" "github.com/kiteco/kiteco/kite-go/client/internal...
package itbit // GeneralReturn is a generalized return type to capture any errors type GeneralReturn struct { Code int `json:"code"` Description string `json:"description"` RequestID string `json:"requestId"` } // Ticker holds returned ticker information type Ticker struct { Pair string `jso...
package main import ( "fmt" "os" "os/signal" "regexp" "sort" "strings" "unicode" "github.com/bcicen/color" "github.com/bcicen/go-units" "github.com/bcicen/xiny/internal/command" "github.com/c-bata/go-prompt" ) var ( promptChar = "››› " Theme = []prompt.Option{ prompt.OptionPrefix(promptChar), promp...
package app import ( "encoding/base64" "net/smtp" "time" "github.com/k3a/html2text" "github.com/revel/revel" ) /*MailerConn contains all Mailer connection fields. */ type MailerConn struct { EMail string URL string User string Password string Suffix string } /*EMail contains all fields requi...
package terminal import ( "stued/editor" "stued/runes" "fmt" "io" "time" ) type Window struct { Scroll struct{ X, Y int } Rows, Cols int Editor *editor.Editor Name, status string } type InputHandler func(term *Window, r rune) (InputHandler, error) func (term *Window) ProcessEditorEvent(...
// Copyright (c) 2020 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 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 ...
// Copyright 2019 <NAME>. All rights reserved. // This software may be modified and distributed under the terms // of the Apache license. See the LICENSE file for details. package objects import ( utils "github.com/soldatov-s/go-gpss/internal" ) // Parameter for modification type Parameter struct { Name string ...
package main import ( "bytes" "errors" "fmt" "io" "sort" "strings" "time" "github.com/nicolagi/todoist" ) var errNotFound = errors.New("entity not found") func printAllProjects(w io.Writer) error { all := client.SearchProjects().WithIsArchived(0).WithIsDeleted(0).Results() sort.Sort(projectsByChildOrder(a...
package jobscheduler import ( "os" "log" "reflect" "errors" "time" "os/exec" "io/ioutil" "strconv" ) // Config contains basic config for the JobScheduler Instance type Config struct { Host string APIToken string `toml:"Api_Token"` // TODO: email server settings to send mail if jobscheduler stop...
// Copyright 2022 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 package watcher import ( "context" "fmt" "time" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" "k8s.io/klog/v2" "sigs.k8s.io/cli-utils/pkg/kstatus/polling/clusterreader" "...
package executor import ( "fmt" "github.com/davecgh/go-spew/spew" "github.com/yunify/qingcloud-cloud-controller-manager/pkg/apis" "github.com/yunify/qingcloud-cloud-controller-manager/pkg/errors" qcclient "github.com/yunify/qingcloud-sdk-go/client" qcservice "github.com/yunify/qingcloud-sdk-go/service" "k8s.io...
package indicators import ( "container/list" "errors" "github.com/thetruetrade/gotrade" ) // A Weighted Moving Average Indicator (Wma), no storage, for use in other indicators type WmaWithoutStorage struct { *baseIndicatorWithFloatBounds // private variables periodTotal float64 periodHistory *list.L...
// 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 router import ( "context" "net" "time" "chromiumos/tast/common/network/iw" "chromiumos/tast/ctxutil" "chromiumos/tast/remote/wificell/d...
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. // +build linux,cgo package user // #include <sys/types.h> // #include <pwd.h> // ...
// This package contains an implementation of pcsocgo // using the provided utilities. // // You can make your own if you like I guess. package main import ( "flag" "io" "log" "os" "os/signal" "strings" "syscall" "github.com/bwmarrin/discordgo" "github.com/unswpcsoc/pcsocgo/commands" "github.com/unswpcsoc/...
package server import ( "context" "encoding/binary" "errors" "fmt" "github.com/spf13/cobra" "net" "net/http" "sync" "time" "github.com/gobwas/ws" "github.com/gobwas/ws/wsutil" "github.com/sirupsen/logrus" ) // command of message const ( CommandPing = 100 CommandPong = 101 writeWait = time.Second * 1...
package main import ( "flag" "fmt" "log" "net/http" "sync" "time" "github.com/gofrs/uuid" "github.com/gorilla/websocket" ) var addr = flag.String("addr", "localhost:5000", "http service address") //when deploying to cloud, use instance private IP var upgrader = websocket.Upgrader{ CheckOrigin: func(r *http...
package main import ( "context" "fmt" "log" "net/http" "os" "os/signal" "runtime" "syscall" "time" "github.com/doitintl/gtoken/internal/gcp" "github.com/urfave/cli/v2" ) var ( // Version contains the current version. Version = "dev" // BuildDate contains a string with the build date. BuildDate = "unk...
// *** 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 apigateway import ( "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/go/pulumi" ) // Provides an HTTP Method Response for an API Ga...
package upvest import ( "fmt" "net/http" "github.com/pkg/errors" ) // HDBlock represents block object from historical data API type HDBlock struct { Number string `json:"number"` Hash string `json:"hash"` ParentHash string `json:"parentHash"` Nonce string `json:"...
// Copyright ©2013 The gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package mat64 import ( "math" "github.com/gonum/blas" "github.com/gonum/blas/blas64" ) type LQFactor struct { LQ *Dense lDiag []float64 } // LQ ...
// Copyright (C) 2017, 2018 <NAME>. All rights reserved. // Use of this source code is governed by the MIT // license, which can be found in the LICENSE file. package main import ( "bytes" "errors" "fmt" "io/ioutil" "os" "path" "path/filepath" "strings" "text/template" ) type templateParams map[string]inter...
package retention import ( "fmt" "time" "github.com/go-kit/log/level" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" "github.com/grafana/loki/pkg/util/filter" util_log "github.com/grafana/loki/pkg/util/log" "github.com/grafana/loki/pkg/validation" ) // IntervalFilter co...
package stats import ( "github.com/prometheus/client_golang/prometheus" "github.com/willena/s3-exporter/utils" "time" ) const METRICS_GROUP = "file_walker" type PrometheusStats struct { // Simple stats MaxDepth *prometheus.GaugeVec CollectDuration *prometheus.GaugeVec TotalObjectsSize *prometheus....
/* Copyright 2020-2022 The OpenEBS Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
// Copyright (c) 2016 shawn1m. All rights reserved. // Use of this source code is governed by The MIT License (MIT) that can be // found in the LICENSE file. // Package common provides common functions. package common import ( "net" "regexp" "strings" "github.com/miekg/dns" log "github.com/sirupsen/logrus" ) t...
package main import ( "fmt" "image" "unsafe" ) // #cgo pkg-config: libavcodec libavutil libswscale // #include <libavcodec/avcodec.h> // #include <libavutil/imgutils.h> // #include <libswscale/swscale.h> import "C" func frameData(frame *C.AVFrame) **C.uint8_t { return (**C.uint8_t)(unsafe.Pointer(&frame.data[0])...
/* Copyright 2018 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
package main import ( "fmt" "net/http" "os" "github.com/gorilla/mux" "github.com/bumblebeen/goweb/controllers" "gopkg.in/mgo.v2" "log" "github.com/bumblebeen/goweb/tools/middleware" "github.com/urfave/negroni" "time" "github.com/dgrijalva/jwt-go" "github.com/auth0/go-jwt-middleware" ) var port = os.Getenv...
/* 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 control import ( "bytes" "context" "github.com/goradd/goradd/pkg/html" "github.com/goradd/goradd/pkg/page" "reflect" ) type UnorderedListI interface { page.ControlI ItemListI GetItemsHtml(items []*ListItem) string DataManagerEmbedder SetBulletStyle(s string) UnorderedListI SetItemTag(s string) Unor...
package common import ( "fmt" "os" "time" rotatelogs "github.com/lestrrat-go/file-rotatelogs" "github.com/sirupsen/logrus" ) const timestampFormat = "2006-01-02T15:04:05.000" // JSONFormat print log in json format var JSONFormat bool // SetLogger set log level and format etc func SetLogger(logLevel uint32, js...
package cephbroker import ( "errors" "fmt" "os" "path/filepath" "code.cloudfoundry.org/cephbroker/utils" "code.cloudfoundry.org/goshims/ioutilshim" "code.cloudfoundry.org/goshims/osshim" "code.cloudfoundry.org/lager" "code.cloudfoundry.org/voldriver" "code.cloudfoundry.org/voldriver/driverhttp" "code.cloud...
// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lice...
package types import ( //"encoding/json" "fmt" "math/big" //"strconv" "github.com/ethereum/go-ethereum/common" ) // SubscriptionEvent is an enum signifies whether the incoming message is of type Subscribe or unsubscribe type SubscriptionEvent string // Enum members for SubscriptionEvent const ( SUBSCRIBE S...
// Copyright 2018 vogo. // Author: wongoo // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
// Copyright © 2013-2018 Galvanized Logic Inc. // Use is governed by a BSD-style license found in the LICENSE file. package main import ( "fmt" "time" "github.com/gazed/vu/device" "github.com/gazed/vu/load" "github.com/gazed/vu/math/lin" "github.com/gazed/vu/render" "github.com/gazed/vu/render/gl" ) // sf de...
/* Copyright 2018 The Multicluster-Controller 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...
package mite import ( "fmt" "github.com/leanovate/mite-go/domain" "net/url" "time" ) func fromCommand(c *domain.TimeEntryCommand) *timeEntryRequest { r := &timeEntryRequest{} if c.Date != nil { r.TimeEntry.Date = c.Date.String() } if c.Minutes != nil { r.TimeEntry.Minutes = c.Minutes.Value() } r.TimeEnt...
// 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 gmf /* #cgo pkg-config: libswresample #include "libswresample/swresample.h" #include <libavcodec/avcodec.h> #include <libavutil/frame.h> int gmf_sw_resample(SwrContext* ctx, AVFrame* dstFrame, AVFrame* srcFrame){ return swr_convert(ctx, dstFrame->data, dstFrame->nb_samples, (const uint8_t **)srcFrame->da...
package apns import ( "crypto/tls" "errors" "io" "log" "net" "strings" "sync" "time" "code.google.com/p/go.net/context" ) type client struct { gateway string certificateFile string certificateBase64 string keyFile string keyBase64 string } // PersistentClient opens a pers...
// 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 applicabl...
package fieldfilter import ( "fmt" "reflect" "strings" ) type Lanaguage = map[string]interface{} type Lanaguages = map[string]Lanaguage type Lang interface { Lang() Lanaguages } //根据过滤标签过滤单数据结构 // Tag // filter:"base" // filter:"self" // filter:"-" 禁显 // filter:"*" 全显(结构数组不过滤子字段) // filter:"base:*;...
package athenaviews /** * Panther is a scalable, powerful, cloud-native SIEM written in Golang/React. * Copyright (C) 2020 Panther Labs Inc * * 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 Fo...
package yarninstall import ( "bytes" "errors" "fmt" "os" "path/filepath" "strings" "github.com/paketo-buildpacks/packit/v2/fs" "github.com/paketo-buildpacks/packit/v2/pexec" "github.com/paketo-buildpacks/packit/v2/scribe" ) //go:generate faux --interface Summer --output fakes/summer.go type Summer interface...
package main import ( "bufio" "bytes" "fmt" "os" ) func main() { reader := bufio.NewReader(os.Stdin) tc := readNum(reader) var buf bytes.Buffer for tc > 0 { tc-- n, m := readTwoNums(reader) P := readNNums(reader, n-1) A := make([][]int, m) for i := 0; i < m; i++ { A[i] = readByFirst(reader) } ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: comment.proto package form_pb 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 a compil...
package game import ( "bytes" "github.com/satori/go.uuid" "github.com/valyala/fasthttp" "github.com/valyala/fastjson" "math/rand" "time" ) const ( RUNNING = "RUNNING" XWON = "X_WON" OWON = "O_WON" DRAW = "DRAW" ) const ( // chars DashChar = 45 XChar = 88 OChar = 79 // first move consta...