code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2013 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 ipv4 // An ICMPType represents a type of ICMP message. type ICMPType int func (typ ICMPType) String() string { s, ok := icmpTypes[typ] if !ok { r...
Go
// Copyright 2012 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 ipv4 import ( "net" "os" "syscall" "unsafe" ) // Please refer to the online manual; // http://msdn.microsoft.com/en-us/library/windows/desktop/ms...
Go
// Copyright 2013 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. // +build ignore // This program generates internet protocol constants by reading IANA // protocol registries. // // Usage: // go run gentest.go > iana_test.g...
Go
// Copyright 2011 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 proxy import ( "errors" "io" "net" "strconv" ) // SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address // with an optional ...
Go
// Copyright 2011 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 proxy provides support for a variety of protocols to proxy network // data. package proxy import ( "errors" "net" "net/url" "os" ) // A Dialer ...
Go
// Copyright 2011 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 proxy import ( "net" ) type direct struct{} // Direct is a direct proxy: one that makes network connections directly. var Direct = direct{} func (d...
Go
// Copyright 2011 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 proxy import ( "net" "strings" ) // A PerHost directs connections to a default Dialer unless the hostname // requested matches one of a number of ex...
Go
// Copyright 2012 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. // +build ignore package main // This program generates table.go and table_test.go. // Invoke as: // // go run gen.go -version "xxx" >table.go // go run...
Go
// Copyright 2012 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 publicsuffix provides a public suffix list based on data from // http://publicsuffix.org/. A public suffix is one under which Internet users // can d...
Go
// Copyright 2013 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 netutil provides network utility functions, complementing the more // common ones in the net package. package netutil import ( "net" "sync" ) //...
Go
// Copyright 2011 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 html import ( "code.google.com/p/go.net/html/atom" ) // A NodeType is the type of a Node. type NodeType uint32 const ( ErrorNode NodeType = iota T...
Go
// Copyright 2011 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 html import ( "strings" ) func adjustAttributeNames(aa []Attribute, nameMap map[string]string) { for i := range aa { if newName, ok := nameMap[aa[...
Go
// Copyright 2011 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 html import ( "bufio" "errors" "fmt" "io" "strings" ) type writer interface { io.Writer WriteByte(c byte) error // in Go 1.1, use io.ByteWriter...
Go
// Copyright 2011 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 html // Section 12.2.3.2 of the HTML5 specification says "The following elements // have varying levels of special parsing rules". // http://www.whatwg...
Go
// Package charset provides common text encodings for HTML documents. // // The mapping from encoding labels to encodings is defined at // http://encoding.spec.whatwg.org. package charset import ( "bytes" "io" "mime" "strings" "unicode/utf8" "code.google.com/p/go.net/html" "code.google.com/p/go.text/encoding" ...
Go
// +build ignore package main // Download http://encoding.spec.whatwg.org/encodings.json and use it to // generate table.go. import ( "encoding/json" "fmt" "log" "net/http" "strings" ) type enc struct { Name string Labels []string } type group struct { Encodings []enc Heading string } const specURL =...
Go
// Copyright 2010 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 html import ( "bytes" "errors" "io" "strconv" "strings" "code.google.com/p/go.net/html/atom" ) // A TokenType is the type of a Token. type Toke...
Go
// Copyright 2011 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 html import ( "strings" ) // parseDoctype parses the data from a DoctypeToken into a name, // public identifier, and system identifier. It returns a ...
Go
// Copyright 2010 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 html import ( "bytes" "strings" "unicode/utf8" ) // These replacements permit compatibility with old numeric entities that // assumed Windows-1252 ...
Go
// Copyright 2010 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 html import ( "errors" "fmt" "io" "strings" a "code.google.com/p/go.net/html/atom" ) // A parser implements the HTML5 parsing algorithm: // http...
Go
// Copyright 2010 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 html // All entities that do not end with ';' are 6 or fewer bytes long. const longestEntityWithoutSemicolon = 6 // entity is a map from HTML entity n...
Go
// Copyright 2010 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 html implements an HTML5-compliant tokenizer and parser. Tokenization is done by creating a Tokenizer for an io.Reader r. It is the caller's respons...
Go
// Copyright 2012 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 atom provides integer codes (also known as atoms) for a fixed set of // frequently occurring HTML strings: tag names and attribute keys such as "p" /...
Go
// Copyright 2012 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. // +build ignore package main // This program generates table.go and table_test.go. // Invoke as // // go run gen.go |gofmt >table.go // go run gen.go -test |...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package schema import ( "fmt" "os" "reflect" "strconv" "strings" "sync" ) // ---------------------------------------------------------------------------...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/schema fills a struct with form values. The basic usage is really simple. Given this struct: type Person struct { Name string Phone s...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package sessions import ( "fmt" "http" "os" "time" "appengine" "appengine/datastore" "appengine/memcache" "gorilla.googlecode.com/hg/gorilla/sessions" ...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/appengine/sessions implements session stores for Google App Engine's datastore and memcache. Usage is the same as described in gorilla/sessi...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package mux import ( "bytes" "fmt" "http" "os" "path" "regexp" "strings" "url" "gorilla.googlecode.com/hg/gorilla/context" ) // All error description...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/mux implements a request router and dispatcher. The name mux stands for "HTTP request multiplexer". Like the standard http.ServeMux, mux.Rou...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package sessions import ( "bytes" "crypto/aes" "crypto/cipher" "crypto/hmac" "crypto/rand" "crypto/subtle" "encoding/base64" "fmt" "gob" "hash" "htt...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/sessions provides cookie sessions and infrastructure for custom session back-ends. The key features are: * Dead simple basic API: use it as...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package context import ( "http" "sync" ) // DefaultContext is the default context instance. var DefaultContext = new(Context) // Maps request -> namespace ...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/context provides utilities to manage request contexts. A context stores global values for HTTP requests in a thread-safe manner. The origina...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package schema import ( "fmt" "os" "reflect" "strconv" "strings" "sync" ) // ---------------------------------------------------------------------------...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/schema fills a struct with form values. The basic usage is really simple. Given this struct: type Person struct { Name string Phone s...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package sessions import ( "fmt" "http" "os" "time" "appengine" "appengine/datastore" "appengine/memcache" "gorilla.googlecode.com/hg/gorilla/sessions" ...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/appengine/sessions implements session stores for Google App Engine's datastore and memcache. Usage is the same as described in gorilla/sessi...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package mux import ( "bytes" "fmt" "http" "os" "path" "regexp" "strings" "url" "gorilla.googlecode.com/hg/gorilla/context" ) // All error description...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/mux implements a request router and dispatcher. The name mux stands for "HTTP request multiplexer". Like the standard http.ServeMux, mux.Rou...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package sessions import ( "bytes" "crypto/aes" "crypto/cipher" "crypto/hmac" "crypto/rand" "crypto/subtle" "encoding/base64" "fmt" "gob" "hash" "htt...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/sessions provides cookie sessions and infrastructure for custom session back-ends. The key features are: * Dead simple basic API: use it as...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package context import ( "http" "sync" ) // DefaultContext is the default context instance. var DefaultContext = new(Context) // Maps request -> namespace ...
Go
// Copyright 2011 Rodrigo Moraes. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gorilla/context provides utilities to manage request contexts. A context stores global values for HTTP requests in a thread-safe manner. The origina...
Go
package hello import ( "fmt" "http" appengineSessions "gorilla.googlecode.com/hg/gorilla/appengine/sessions" "gorilla.googlecode.com/hg/gorilla/mux" "gorilla.googlecode.com/hg/gorilla/sessions" ) func init() { // Register a couple of routes. mux.HandleFunc("/", homeHandler).Name("home") mux.HandleFunc("/{salu...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package appengine_internal import ( "bufio" "http" "io" "log" "net" "os" "strconv" "sync" "appengine_internal/remote_api" "goprotobuf.googlecode.com/...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* The appengine_internal package supports Go programs for Google App Engine. Such programs do not call the this package directly. Instead, the program consists...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package appengine_internal import "http" // These functions are the dev implementations of the wrapper functions // in ../appengine/identity.go. See that file ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package appengine_internal // These functions are implementations of the wrapper functions // in ../appengine/identity.go. See that file for commentary. func A...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package appengine_internal import ( "strings" ) func parseFullAppID(appid string) (partition, domain, displayID string) { if i := strings.Index(appid, "~"); ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package main import ( "go/ast" ) var datastoreKeyFix = fix{ "datastore_key", datastoreKey, `Add an appengine.Context argument to datastore.NewKey and datas...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package main import ( "go/ast" ) var blobstoreUploadOptionsFix = fix{ "blobstore_upload_options", blobstoreUploadOptions, "Add an options argument to blobs...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package main import ( "go/ast" ) var datastoreTransactionOptionsFix = fix{ "datastore_transaction_options", datastoreTransactionOptions, "Add an options ar...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package main import ( "bytes" "os" "template" ) // MakeMain creates the synthetic main package for a Go App Engine app. func MakeMain(app *App, extraImports...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package main import ( "fmt" "go/ast" "go/parser" "go/token" "os" "path" "regexp" "sort" "strconv" "strings" ) // App represents an entire Go App Engi...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* go-app-builder is a program that builds Go App Engine apps. It takes a list of source file names, loads and parses them, deduces their package structure, cre...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. // Package urlfetch provides an http.RoundTripper implementation // for fetching URLs via App Engine's urlfetch service. package urlfetch import ( "fmt" "http...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package datastore import ( "fmt" "os" "reflect" "unicode" "utf8" "appengine" "goprotobuf.googlecode.com/hg/proto" pb "appengine_internal/datastore" ) ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package datastore import ( "os" "reflect" "appengine" "appengine_internal" "goprotobuf.googlecode.com/hg/proto" pb "appengine_internal/datastore" ) // ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package datastore import ( "fmt" "os" "reflect" "appengine" "goprotobuf.googlecode.com/hg/proto" pb "appengine_internal/datastore" ) const nilKeyErrStr...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package datastore import ( "fmt" "math" "os" "reflect" "strings" "appengine" "goprotobuf.googlecode.com/hg/proto" pb "appengine_internal/datastore" ) ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package datastore import ( "bytes" "encoding/base64" "gob" "os" "strconv" "strings" "appengine" "goprotobuf.googlecode.com/hg/proto" pb "appengine_in...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* Package datastore provides a client for App Engine's datastore service. Entities are the unit of storage and are associated with a key. A key consists of an ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package datastore import ( "fmt" "os" "reflect" "time" "appengine" "appengine_internal" "goprotobuf.googlecode.com/hg/proto" pb "appengine_internal/da...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* Package capability exposes information about outages and scheduled downtime for specific API capabilities. Example: if !capability.Enabled(c, "datastore_v3"...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* Package mail provides the means of sending email from an App Engine application. Example: msg := &mail.Message{ Sender: "romeo@montague.com", To: ...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package user import ( "http" "appengine" ) const ( hEmail = "X-AppEngine-Inbound-User-Email" hFederatedIdentity = "X-AppEngine-Inbound-User-Fe...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. // Package user provides a client for App Engine's user authentication service. package user import ( "os" "strings" "appengine" "appengine_internal" "gop...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* Package taskqueue provides a client for App Engine's taskqueue service. Using this service, applications may perform work outside a user's request. A Task ma...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. // Package memcache provides a client for App Engine's distributed in-memory // key-value store for small chunks of arbitrary data. // // The fundamental operati...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* The channel package implements the server side of App Engine's Channel API. Create creates a new channel associated with the given clientID, which must be un...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* Package delay provides a way to execute code outside the scope of a user request by using the taskqueue API. To declare a function that may be executed later...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. // Package blobstore provides a client for App Engine's persistent blob // storage service. package blobstore import ( "bufio" "fmt" "http" "io" "io/ioutil...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. /* Package log provides the means of querying an application's logs from within an App Engine application. Example: c := appengine.NewContext(r) query := &log...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. // Package appengine provides functionality that is common across // App Engine APIs. package appengine import ( "http" "os" "appengine_internal" ) // IsDe...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package appengine import ( "appengine_internal" ) // AppID returns the application ID for the current application. // The string will be a plain application I...
Go
// Copyright 2011 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 moustachio import ( "image" "image/draw" "freetype-go.googlecode.com/hg/freetype/raster" ) // moustache draws a moustache of the specified size an...
Go
// Copyright 2011 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. // On App Engine, the framework sets up main; we should be a different package. package moustachio import ( "bytes" "fmt" "http" "image" "image/jpeg" _ "...
Go
// Copyright 2011 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 resize import ( "image" "image/ycbcr" ) // Resize returns a scaled copy of the image slice r of m. // The returned image has width w and height h. f...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package mandelbrot import ( "bytes" "fmt" "http" "image" "image/png" "json" "strconv" "template" "appengine" "appengine/memcache" ) func init() { h...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package counter import ( "fmt" "http" "io" "os" "strconv" "appengine" "appengine/memcache" ) func serveError(c appengine.Context, w http.ResponseWriter...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package later import ( "fmt" "http" "appengine" "appengine/delay" ) func init() { http.HandleFunc("/", handle) } func handle(w http.ResponseWriter, r *h...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package transaction // This app demonstrates the datastore transaction API. // // A bank account is initialized with 4 million dollars, and 10 concurrent // wit...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package guestbook import ( "http" "io" "os" "template" "time" "appengine" "appengine/datastore" "appengine/user" ) type Greeting struct { Author str...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package helloworld import ( "fmt" "http" ) func init() { http.HandleFunc("/", handle) } func handle(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w...
Go
// Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package logviewer import ( "http" "os" "strconv" "strings" "template" "time" "appengine" "appengine/log" ) // appLevel holds data about a given applic...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2011 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2011 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 Google Inc. All rights reserved. // http://code.google.com/p/goprotobuf/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: ...
Go
package fs import ( "os" "io" ) var theFS map[string]*file var ro = false type file struct { data []byte } func init() { theFS = make(map[string]*file) } func SaveFile(name string, data []byte) os.Error { if !ro { theFS[name] = &file{ data: data } } else { return os.NewError("filestore is read only") } ...
Go
package main import ( "log" "fmt" "time" "http" "exp/draw" "exp/draw/x11" "image" "image/png" "image/jpeg" ) func imagePuller(urls chan string, imgs chan *image.Image) { for url := range urls { r, _, err := http.Get(url) if err == nil { log.Print("Fetched ", url) ctype, found := r.Header["Content-...
Go
// Copyright 2010 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 main import ( "os" ) type seekable []byte func NewSeekable(buf []byte) seekable { return buf } func (r seekable)ReadAt(p []byte, off int64) (n int...
Go
package main import ( "unsafe" ) var crt *[25 * 80]uint16 type ColoredChar struct { back uint8 fore uint8 char uint8 } const ( black uint8 = iota blue green cyan red magenta brown white ) func pokeScreen(c uint16, x, y int) { if crt == nil { // init on demand in case printf is called before // ini...
Go