CombinedText
stringlengths
4
3.42M
// Copyright (c) 2015 Couchbase, 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 w...
package messenger import ( "encoding/json" "fmt" "net/http" "time" ) const ( // WebhookURL is where the Messenger client should listen for webhook events. WebhookURL = "/webhook" ) // Options are the settings used when creating a Messenger client. type Options struct { // Verify sets whether or not to be in t...
package format import ( "testing" "github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/plans" "github.com/mitchellh/colorstring" "github.com/zclconf/go-cty/cty" ) func TestResourceChange_primitiveTypes(t *testing.T) { testCases := map[str...
// Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. // Copyright (c) 2006-2015 Sippy Software, Inc. All rights reserved. // Copyright (c) 2015 Andrii Pylypenko. All rights reserved. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permit...
package consul import ( "errors" "sort" "strconv" "strings" "text/template" "time" "github.com/BurntSushi/ty/fun" "github.com/Sirupsen/logrus" "github.com/cenk/backoff" "github.com/containous/traefik/job" "github.com/containous/traefik/log" "github.com/containous/traefik/provider" "github.com/containous/...
// // Copyright 2016-2018 Bryan T. Meyers <bmeyers@datadrake.com> // // 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 requir...
// Copyright 2013 tsuru authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package docker import ( "encoding/json" "fmt" "net" "net/http" "net/http/httptest" "net/url" "strconv" "strings" "github.com/fsouza/go-dockerclient/te...
package main import ( "eaciit/gdrj/model" "eaciit/gdrj/modules" "os" "github.com/eaciit/dbox" "github.com/eaciit/orm/v1" "github.com/eaciit/toolkit" // "strings" "time" ) var conn dbox.IConnection var count int var ( t0 time.Time fiscalyear, iscount, scount int data ...
// Package db to connect to mongodb package db import ( "errors" "fmt" "github.com/MG-RAST/AWE/lib/conf" "github.com/MG-RAST/AWE/vendor/github.com/MG-RAST/golib/mgo" "time" ) const ( DbTimeout = time.Duration(time.Second * 10) ) var ( Connection connection ) type connection struct { dbname string usernam...
package data import ( "bytes" "time" "appengine" "appengine/datastore" "bacaberita/parser" "bacaberita/utils" ) type Feed struct { Title string Link string Description string Date time.Time ImageUrl string ImageTitle string ImageLink string Url string Updated time.Time C...
package model import ( "fmt" "time" "strings" "encoding/json" "github.com/boltdb/bolt" "../cfg" ) const ( BUCKET_INDEX = "index" ) type Meta struct { Posts int PerPage int Pages int Drafts int UpdatedAt time.Time } func (meta *Meta) init() { meta.Posts = 0 meta.PerPage = cfg.Int("ui.per...
// Copyright 2017 tsuru authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package integration import ( "fmt" "io/ioutil" "os" "regexp" "strings" "time" tsuruNet "github.com/tsuru/tsuru/net" "gopkg.in/check.v1" ) var ( T ...
// Copyright 2016 CoreOS, 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...
package hashstructure import ( "encoding/binary" "fmt" "hash" "hash/crc64" "hash/fnv" "io" "reflect" "sort" ) // HashOptions are options that are available for hashing. type HashOptions struct { // Hasher is the hash function to use. If this isn't set, it will // default to CRC-64. CRC probably isn't the be...
package hashstructure import ( "encoding/binary" "fmt" "hash" "hash/crc64" "hash/fnv" "io" "reflect" "sort" ) // HashOptions are options that are available for hashing. type HashOptions struct { // Hasher is the hash function to use. If this isn't set, it will // default to CRC-64. CRC probably isn't the be...
package docker import ( "bufio" "bytes" "context" "fmt" "github.com/ViBiOh/docker-deploy/jsonHttp" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/...
package model import ( "encoding/json" "fmt" "io" "strings" ) type Metadata struct { APIVersion string EndpointPrefix string JSONVersion string ServiceAbbreviation string ServiceFullName string SignatureVersion string TargetPrefix string Protocol string Chec...
// Copyright 2015 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
package models import ( "fmt" "github.com/jinzhu/gorm" "net/url" "time" ) type Image struct { gorm.Model Src string `json:"src"` Tags []Tag `gorm:"many2many:images_tags"` Date time.Time `gorm:"not null" json:"date"` ChatID int64 `gorm:"not null" json:"-"` Chat Chat `gorm:"ForeignKey...
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "errors" "fmt" "io/ioutil" "os" "path" "path/filepath" "sort" "strings" "time" "unicode/utf8" "github.com/Unknwon/cae/zip...
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "bytes" "errors" "fmt" "html/template" "io/ioutil" "os" "os/exec" "path" "path/filepath" "regexp" "sort" "strings" "time...
package models import ( "database/sql" "fmt" e "github.com/techjanitor/pram-get/errors" u "github.com/techjanitor/pram-get/utils" ) // TagsModel holds the parameters from the request and also the key for the cache type TagsModel struct { Ib uint Term string Result TagsType } // TagsType is the top leve...
package models import ( "time" "krypton-server/options" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) var ( Todo *_Todo todoCollection = "todo" todoIndexes = []mgo.Index{} ) type _Todo struct{} type TodoModel struct { Id bson.ObjectId `bson:"_id" json:"-"` Uid string `bson:"uid" json...
package models import ( "encoding/json" "fmt" "reflect" "regexp" "time" "github.com/dockercn/docker-bucket/utils" ) const ( ORG_MEMBER = "M" ORG_OWNER = "O" ) type User struct { Username string // Password string // Repositories string //用户的所有 Respository Organizations string //用户所属的所有组织 Em...
// Copyright 2014 The Gogs Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package models import ( "container/list" "context" "crypto/sha256" "crypto/subtle" "encoding/h...
package buf import "github.com/bufbuild/buf/internal/pkg/cli/clicobra" const version = "0.9.0-dev" // Main is the main. func Main(use string, options ...RootCommandOption) { clicobra.Main(newRootCommand(use, options...), version) } // NewRootCommand creates a new root Command. func NewRootCommand(use string, optio...
package console import ( "fmt" "sort" "strings" "sync" "time" "github.com/cenkalti/rain/internal/jsonutil" "github.com/cenkalti/rain/internal/rpctypes" "github.com/cenkalti/rain/rainrpc" "github.com/jroimartin/gocui" ) const ( // pages torrents int = iota help ) const ( // tabs general int = iota sta...
package console import ( "fmt" "io" "os" "sort" "strings" "sync" "time" "github.com/cenkalti/rain/internal/jsonutil" "github.com/cenkalti/rain/internal/rpctypes" "github.com/cenkalti/rain/rainrpc" "github.com/jroimartin/gocui" ) const ( // pages torrents int = iota sessionStats addTorrent help ) con...
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package derrors defines internal error values to categorize the different // types error semantics we support. package derrors import ( "errors" "fmt" "n...
// Copyright 2014 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cache import ( "context" "fmt" "go/ast" "go/parser" "go/scanner" "go/token" "os" "path/filepath" "strings" "sync" "golang.org/x/tools/inter...
package app import ( "fmt" "github.com/mohae/contour" jww "github.com/spf13/jwalterweatherman" ) // BuildDistro creates a build based on the target distro's defaults. The // ArgsFilter contains information on the target distro and any overrides that // are to be applied to the build. Returns either a processing ...
package emailnotifier import ( "errors" "fmt" "koding/db/mongodb/modelhelper" socialmodels "socialapi/models" "socialapi/workers/notification/models" "github.com/koding/logging" "github.com/koding/rabbitmq" "github.com/koding/worker" "github.com/robfig/cron" "github.com/sendgrid/sendgrid-go" "github.com/st...
package models import ( "errors" "time" "github.com/guregu/null" ) // [BENCHMARK] 0.000 sec / 0.000 sec func GetActiveWarsByID(id int64) ([]CRESTRef, error) { w := []CRESTRef{} if err := database.Select(&w, ` SELECT K.id, crestRef, type FROM (SELECT defenderID AS id FROM evedata.wars WHERE (timeFinished =...
// +build go1.3 /* * Licensed to Qualys, Inc. (QUALYS) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * QUALYS licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
/* 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 modules import ( "compress/gzip" "crypto/aes" "crypto/cipher" "crypto/rand" "crypto/sha256" "fmt" "io" "os" "time" "code.cloudfoundry.org/bytefmt" ) func init() { Modules["cpu"] = &CPU{} } type CPU struct { Sha256 float64 Gzip float64 Aes float64 } func (stat *CPU) Run() error { zero, e...
/** * 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...
package main import ( "encoding/pem" "fmt" "io/ioutil" "net" "os" "os/exec" "strconv" "strings" "github.com/pkg/errors" "github.com/spf13/cobra" "golang.org/x/sys/unix" "gopkg.in/yaml.v2" lxd "github.com/lxc/lxd/client" "github.com/lxc/lxd/lxd/cluster" "github.com/lxc/lxd/lxd/network" "github.com/lxc...
package network import ( "bufio" "encoding/binary" "fmt" "hash/fnv" "io" "io/ioutil" "math/rand" "net" "os" "os/exec" "reflect" "strconv" "strings" "sync" "github.com/pkg/errors" "github.com/lxc/lxd/lxd/apparmor" "github.com/lxc/lxd/lxd/cluster" "github.com/lxc/lxd/lxd/cluster/request" "github.com...
package network import ( "context" "encoding/binary" "fmt" "io/ioutil" "net" "net/http" "os" "os/exec" "reflect" "strconv" "strings" "sync" "time" "github.com/mdlayher/netx/eui64" "github.com/pkg/errors" "github.com/lxc/lxd/client" "github.com/lxc/lxd/lxd/apparmor" "github.com/lxc/lxd/lxd/cluster" ...
// Copyright 2016 CoreOS, 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...
package network import ( "bufio" "encoding/binary" "fmt" "hash/fnv" "io" "io/ioutil" "math/rand" "net" "os" "os/exec" "reflect" "strconv" "strings" "sync" "github.com/pkg/errors" "github.com/lxc/lxd/lxd/apparmor" "github.com/lxc/lxd/lxd/cluster" "github.com/lxc/lxd/lxd/daemon" "github.com/lxc/lxd/...
package drivers import ( "fmt" "io" "io/ioutil" "os" "os/exec" "path/filepath" "sort" "strings" "time" "github.com/pkg/errors" "golang.org/x/sys/unix" "github.com/lxc/lxd/lxd/operations" "github.com/lxc/lxd/shared" "github.com/lxc/lxd/shared/idmap" ) // MinBlockBoundary minimum block boundary size to ...
package render import ( "io" "os" "path/filepath" "github.com/vito/booklit" ) type RenderingEngine interface { booklit.Visitor FileExtension() string Render(io.Writer) error } type Writer struct { Engine RenderingEngine Destination string } func (writer Writer) WriteSection(section *booklit.Section) err...
package utils import ( "database/sql" _ "github.com/mattn/go-sqlite3" "fmt" "log" "objects" "time" ) func DbInit() error { var err error = nil var db *sql.DB = nil var stmt *sql.Stmt = nil db, err = sql.Open(DB_TYPE, DB_NAME) if err != nil { log.Println("init, Error opening db", DB_NAME, ", err=", err) ...
package compute import "fmt" // EntitySummary is used to group an entity Id and name together for serialisation / deserialisation purposes. type EntitySummary struct { // The entity Id. ID string `json:"id"` // The entity name. Name string `json:"name"` } // IPRange represents an IPvX range. type IPRange interfa...
package html import ( "code.google.com/p/go.net/html" "errors" "github.com/slyrz/newscat/util" "io" "net/url" "unicode" ) const ( // We remember a few special node types when descending into their // children. AncestorArticle = 1 << iota AncestorAside AncestorBlockquote AncestorList ) // Document is a pa...
// Copyright (c) Ilia Kravets, 2015. All rights reserved. PROVIDED "AS IS" // WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. See LICENSE file for details. package bats import ( "encoding/binary" "errors" "code.google.com/p/gopacket" "my/errs" "my/itto/verify/packet" ) /********************************************...
package html //#include "helper.h" import "C" import ( "unsafe" "os" "gokogiri/xml" . "gokogiri/util" "bytes" ) var fragmentWrapperStart = []byte("<div>") var fragmentWrapperEnd = []byte("</div>") var fragmentWrapper = []byte("<html><body>") var bodySigBytes = []byte("<body") var ErrFailParseFragment = os.NewEr...
package applications import ( "context" "errors" "fmt" "log" "net/http" "strings" "time" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk...
package http import ( "net" "net/http" ) type consumer struct { conn net.Conn close chan bool } func newConsumer(resp http.ResponseWriter) (*consumer, error) { conn, _, err := resp.(http.Hijacker).Hijack() if err != nil { return nil, err } conn.Write([]byte("HTTP/1.1 200 OK\n...
package http import ( "bufio" "bytes" "code.google.com/p/go.crypto/bcrypt" "compress/gzip" "crypto/rand" "fmt" "github.com/ian-kent/go-log/log" "net" nethttp "net/http" neturl "net/url" "strings" "encoding/json" "encoding/base64" ) type Response struct { session *Session writer nethttp.ResponseW...
package cmd import ( "compress/gzip" "encoding/json" "fmt" "os" "path/filepath" "strconv" "time" "github.com/go-errors/errors" "github.com/privacybydesign/gabi" "github.com/privacybydesign/gabi/big" "github.com/privacybydesign/gabi/keyproof" "github.com/privacybydesign/irmago/internal/common" "github.com...
/* _ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 Weaviate. All rights reserved. * LICENSE: https://github.com/weaviate/weaviate/...
/* This package contains the blog's models and holds the database connection globally but as an unexported value. */ package models import ( "database/sql" _ "github.com/go-sql-driver/mysql" "log" ) var db *sql.DB const ( SQL_POST_BY_ID = ` SELECT idPost, slug, title, abstract, body, date, idUser, users.name, ...
/* Copyright 2015 The Httpgzip Authors. See the AUTHORS file at the top-level directory of this distribution and at <https://xi2.org/x/httpgzip/m/AUTHORS>. This file is part of Httpgzip. Httpgzip is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Lic...
package mini import ( "github.com/stretchr/testify/assert" "os" "path" "strings" "testing" ) func TestSimpleIniFile(t *testing.T) { simpleIni := `first=alpha second=beta third="gamma bamma" fourth = 'delta' int=32 float=3.14 true=true false=false #comment ; comment` filepath := path.Join(os.TempDir(), "simpl...
/* Copyright 2015 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 dynago type queryRequest struct { TableName string IndexName string `json:",omitempty"` // Filtering and query expressions KeyConditionExpression string `json:",omitempty"` FilterExpression string `json:",omitempty"` ProjectionExpression string `json:",omitempty"` expressionAttributes Capacit...
package config import ( "path/filepath" "sync" ) var ( mutex sync.Mutex Values = make(map[int]interface{}) ) const ( BASEDIR = iota APPDIR ) func SetBaseDir(path string) error { mutex.Lock() defer mutex.Unlock() absPath, err := filepath.Abs(path) if err != nil { return err } Values[BASEDIR] = filepath...
// Copyright 2012, 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package testing import ( "bufio" "crypto/tls" "crypto/x509" "fmt" "io" "io/ioutil" "net" "os" "os/exec" "path/filepath" "strconv" "strings" stdtesting "testing" "time" "github.com/juju/loggo" "labix.org...
/* Copyright 2013 Tamás Gulácsi Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwar...
package metrin import ( "bytes" "html/template" "time" "github.com/aws/aws-sdk-go/service/cloudwatch" ) // BuildPrintStringInput - includes params and datapoints type BuildPrintStringInput struct { Params *cloudwatch.GetMetricStatisticsInput Datapoints []*cloudwatch.Datapoint TemplateString strin...
/* Copyright (c) 2016 VMware, 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 main provides the monstache binary package main import ( "bytes" "context" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/json" "errors" "flag" "fmt" "github.com/BurntSushi/toml" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/coreos/go-systemd/daemon" "github.com/evanphx/json-p...
// package main provides the monstache binary package main import ( "bytes" "context" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/json" "errors" "flag" "fmt" "io/ioutil" "log" "math" "net/http" "net/http/pprof" "os" "os/signal" "plugin" "reflect" "regexp" "strconv" "strings" "sync" "s...
package moldova import ( "bytes" "errors" "fmt" "math/rand" "os" "strconv" "strings" "testing" "time" ) type TestComparator func(string) error type TestCase struct { Template string Comparator TestComparator ParseFailure bool WriteFailure bool } var GUIDCases = []TestCase{ { Template: "{guid}"...
// Copyright 2016 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...
package modd import ( "io/ioutil" "os" "path/filepath" "reflect" "strings" "testing" "time" "github.com/cortesi/modd/conf" "github.com/cortesi/modd/utils" "github.com/cortesi/moddwatch" "github.com/cortesi/termlog" ) const timeout = 2 * time.Second func touch(p string) { p = filepath.FromSlash(p) d := ...
package msg import ( "time" ) type Service struct { UUID string Name string Version string Environment string Region string Host string Port uint16 TTL uint32 // Seconds Expires time.Time Callback map[string]*Callback `json:"-"` // Callbacks are found by ...
// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
package msgp // size of every object on the wire, // plus type information. gives us // constant-time type information // for traversing composite objects. // var sizes = [256]bytespec{ mnil: {size: 1, extra: constsize, typ: NilType}, mfalse: {size: 1, extra: constsize, typ: BoolType}, mtrue: {size: 1, ...
package hatchery import ( "fmt" "os/exec" "sync" "time" "github.com/ovh/cds/engine/log" "github.com/ovh/cds/sdk" ) // Interface describe an interface for each hatchery mode (mesos, local) type Interface interface { Init() error KillWorker(worker sdk.Worker) error SpawnWorker(model *sdk.Model, job *sdk.Pipel...
package rt_test import ( "fmt" "io" "io/ioutil" "os" "reflect" "regexp" "testing" "time" "veyron.io/veyron/veyron2/options" "veyron.io/veyron/veyron2/rt" "veyron.io/veyron/veyron2/security" "veyron.io/veyron/veyron2/vlog" "veyron.io/veyron/veyron/lib/expect" "veyron.io/veyron/veyron/lib/flags/consts" ...
package stripe import ( "net/url" "strconv" ) // Subscription Statuses const ( SubscriptionTrialing = "trialing" SubscriptionActive = "active" SubscriptionPastDue = "past_due" SubscriptionCanceled = "canceled" SubscriptionUnpaid = "unpaid" ) // see https://stripe.com/docs/api#subscription_object type Sub...
package jiffy import ( "time" ) var ( // The maximum number of messages to buffer in a subscription. ResponseBufferSize = 100 ) type Subscription struct { Name string Topic *Topic Response chan *Message uuid string expireAt time.Time } func NewSubscription(name string, topic *Topic, ttl time.Dura...
// Package s3 provides an interface to Amazon S3 oject storage package s3 // FIXME need to prevent anything but ListDir working for s3:// /* Progress of port to aws-sdk * Don't really need o.meta at all? What happens if you CTRL-C a multipart upload * get an incomplete upload * disappears when you delete the b...
/* 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, ...
/* moves is a convenience package that implements composable Moves to make it easy to implement common logic. The Base move type is a very simple move that implements the basic stubs necessary for your straightforward moves to have minimal boilerplate. Although it's technically optional, a lot of the magic features th...
package recurrence import ( . "github.com/smartystreets/goconvey/convey" "testing" "time" ) func TestMonthly(t *testing.T) { Convey("With a monthly recurrence on the first day every 3 months", t, func() { r := Recurrence{ Type: Monthly, Location: time.UTC, Frequence: 3, Start: time.Date(20...
package mp import ( "bufio" "bytes" "crypto/sha1" "crypto/subtle" "encoding/base64" "encoding/hex" "encoding/xml" "github.com/ridewindx/mel" "github.com/ridewindx/mel/binding" "sort" "sync" "sync/atomic" "unsafe" "go.uber.org/zap" "github.com/jiudaoyun/wechat" "net/http" "fmt" "encoding/json" "strin...
package movingmedian import ( "container/heap" "math" ) type elt struct { f float64 idx int } type float64Heap []*elt func (h float64Heap) Len() int { return len(h) } func (h float64Heap) Swap(i, j int) { h[i], h[j] = h[j], h[i] h[i].idx = i h[j].idx = j } func (h *float64Heap) Push(x interface{}) { e :=...
package apiserver_test import ( "errors" "fmt" "io" . "launchpad.net/gocheck" "launchpad.net/juju-core/charm" "launchpad.net/juju-core/juju/testing" "launchpad.net/juju-core/rpc" "launchpad.net/juju-core/state" "launchpad.net/juju-core/state/api" "launchpad.net/juju-core/state/api/params" "launchpad.net/juj...
// Copyright 2015 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd // +build linux darwin freebsd package cups /* #cgo freebsd CFLAGS: -I/usr/local/include #cgo free...
// package main provides the monstache binary package main import ( "bytes" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/json" "errors" "flag" "fmt" "github.com/BurntSushi/toml" "github.com/coreos/go-systemd/daemon" "github.com/evanphx/json-patch" "github.com/globalsign/mgo" "github.com/globalsi...
package missinggo type ( // A function that returns equality, and less than. Used for lazily evaluating arguments. SameLessFunc func() (same, less bool) // A helper for long chains of "less-than" comparisons, where later comparisons are only // required if earlier ones haven't resolved the comparison. MultiLess s...
package memcart_mock import ( "errors" "fmt" "github.com/grantek/fkmd/memcart" "io" //"io/ioutil" //"os" ) type MockMemCart struct { banks []*MockMemBank currentbank int } func (mc *MockMemCart) NumBanks() int { return len(mc.banks) } func (mc *MockMemCart) AddBank(mb *MockMemBank) { //mc.banks = ap...
package main import ( "crypto/md5" "encoding/base64" "errors" "fmt" "net/http" "sync" "github.com/Sirupsen/logrus" "github.com/dgrijalva/jwt-go" "github.com/TykTechnologies/openid2go/openid" "github.com/TykTechnologies/tyk/apidef" "github.com/TykTechnologies/tyk/user" ) const OIDPREFIX = "openid" type O...
package main import ( "encoding/json" "fmt" "net/url" "os" "os/exec" "strings" "github.com/blang/mpv" "github.com/cnt0/twitch-streamsniper/api" ) const ( ytdl = "youtube-dl" mpvSocket = "/tmp/mpvsocket" ) func main() { c := mpv.NewClient(mpv.NewIPCClient(mpvSocket)) if u, err := url.Parse(os.Args[...
package mqtt import ( "bytes" "reflect" "testing" gbt "github.com/huin/gobinarytest" ) var bitCnt = uint32(0) func Test(t *testing.T) { msg := Connect{ ProtocolName: "MQIsdp", ProtocolVersion: 3, UsernameFlag: true, PasswordFlag: true, WillRetain: false, WillQos: 1, WillFlag...
package objc import ( "github.com/mkrautz/variadic" "math" "reflect" "unsafe" ) func unpackStruct(val reflect.Value) []uintptr { memArgs := []uintptr{} for i := 0; i < val.NumField(); i++ { v := val.Field(i) kind := v.Kind() switch kind { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, ref...
/* http://www.apache.org/licenses/LICENSE-2.0.txt Copyright 2015 Intel 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 ...
// Copyright (c) 2014 Couchbase, 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 w...
// Copyright (c) 2014 Couchbase, 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 w...
// Package main defines the nectar command line tool. package main import ( "bytes" "encoding/csv" "flag" "fmt" "io" "io/ioutil" "math/rand" "net/http" "os" "path/filepath" "sort" "strconv" "strings" "sync" "sync/atomic" "time" "github.com/gholt/brimtext" "github.com/troubling/nectar" ) var ( glob...
package nessie import ( "encoding/json" "fmt" "io/ioutil" "net/http" "net/http/httptest" "testing" ) func TestDoRequest(t *testing.T) { // Test structure to be serialized. type payload struct { A int `json:"a"` } authToken := "some token" var tests = []struct { method string resource string...
package bus import ( "net" "log" "golem-server/net/bus/containers" "strconv" ) const ( busAddress = "/tmp/golem_bus.sock" ) var hostPool []containers.Host /* EventBusListener Will be the backend bus which messages will be passed over Using a unix socket to make it more efficient. Does not have any TC...
// Copyright 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package maas import ( "encoding/base64" "fmt" "net/url" "strings" "sync" "time" "launchpad.net/gomaasapi" "launchpad.net/juju-core/agent" "launchpad.net/juju-core/cloudinit" "launchpad.net/juju-core/constraints" ...
// Copyright 2013 tsuru authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package juju import ( "bufio" "fmt" "github.com/globocom/config" "github.com/globocom/tsuru/app" "github.com/globocom/tsuru/db" "github.com/globocom/tsuru...