Golang AppEngine Pack in the GAE environment

Source: Internet
Author: User

Package AppEngine

Import "Code.google.com/p/appengine-go/appengine"

The appengine Package provides basic function services for Google App Engine .

For more details see: https://developers.google.com/appengine/docs/go/

Index
  • Type Multierror
      • Func (M Multierror) Error () string
  • Func iscapabilitydisabled (err error) bool
  • Func istimeouterror (err error) bool
  • Func Isoverquota (err error) bool
  • Type GeoPoint
      • Func (g GeoPoint) Valid () bool
  • Type Context
      • Func Newcontext (req *http. Request) Context
      • Func Namespace (c context, Namespace string) (Context, error)
      • Func Timeout (c Context, D time. Duration) Context
  • Type Certificate
  • Func publiccertificates (c Context) ([]certificate, error)
  • Func signbytes (c Context, Bytes []byte) (String, []byte, error)
  • Func isdevappserver () bool
  • Func ServerSoftware () string
  • Func VersionID (c Context) string
  • Func AppID (c Context) string
  • Func InstanceID () string
  • Func RequestID (c Context) string
  • Func Datacenter () string
  • Func ServiceAccount (c Context) (String, error)
  • Func Defaultversionhostname (c Context) string
  • Func modulename (c Context) string
  • Func Modulehostname (c Context, module, version, instance string) (String, error)
  • Func Accesstoken (c Context, scopes. String) (token string, expiry time. Time, err Error)
  • Func Backendhostname (c Context, name string, index int) string
  • Func backendinstance (c Context) (name string, index int)
  • Type Blobkey
Type Multierror

The Mutierror is returned by the batch, containing the return error for each entry, error one by one corresponds to the entry that was executed, and the error for the successful entry is nil.

Type Multierror []error
Func (Multierror) Error
Func (M Multierror) Error () string
Func iscapabilitydisabled
Func iscapabilitydisabled (err error) bool

Returns whether the error was caused by an API call being banned.

Func Istimeouterror
Func istimeouterror (err error) bool

Returns whether the error is a time-out error.

Func Isoverquota
Func Isoverquota (err error) bool

Returns whether the error was caused by exceeding the quota limit for the API service.

Type GeoPoint
Lat Lng Float64}

GeoPoint represents a location that is represented by longitude values and dimension values.

Func (GeoPoint) Valid
Func (g GeoPoint) Valid () bool

Returns whether the position is legal, latitude value range [ -90, +], longitude value returned [ -180,.

Type Context
 type Context interface {   //organizes data into strings and records log     DEBUGF (format string, args ... interfa for debug level) ce{})    //similar DEBUGF, logging for info level     INFOF (format string, args ... interface{})    //similar Debu GF, logging for warning level log     WARNINGF (format string, args ... interface{})    //similar to DEBUGF, logging as Error level     Errorf (format string, args ... interface{})    //similar DEBUGF, recorded as critical level log     Criticalf (format string, args ... interface{})    //For internal use only     call (service, method String, in, out app) Engine_internal. Protomessage, opts *appengine_internal. calloptions) error   //For internal use only, please use AppID instead of     fullyqualifiedappid () string   //For internal use only and nbsp   Request () interface{}} 

the context represents a contextual environment for an executing HTTP request .

Func Newcontext
Func Newcontext (req *http. Request) Context

The Contextof the HTTP request that is running is returned, and the return value of the multiple calls is the same.

Func Namespace
Func Namespace (c context, Namespace string) (Context, error)

Returns an alternate context that runs within the specified namespace.

Func Timeout
Func Timeout (c Context, D time. Duration) Context

Returns an alternate Contextthat timed out after a specified time.

Type Certificate
KeyName Data  PEM -  encoded (+) Certificate}

Certificate represents a public certificate for an app .

Func publiccertificates
Func publiccertificates (c Context) ([]certificate, error)

A notarized copy of the app to verify the signature returned by the signbytes .

Func signbytes
Func signbytes (c Context, Bytes []byte) (String, []byte, error)

Sign the data using a private key that is proprietary to your app .

Func Isdevappserver
Func isdevappserver () bool

Returns whether the current app is running on a development version.

Func ServerSoftware
Func ServerSoftware () string

Returns the app Engine version of the current app , with a production version such as "Google app engine/x.y.z"and a development version like "Development/x.y".

Func VersionID
Func VersionID (c Context) string

Returns the version IDof the current app , in the format "x.y", where X is specified by App.yaml and Y is uploaded each time that version the number that is accumulated when the app is

Func AppID
Func AppID (c Context) string

Returns the AppIDof the current app .

Typically only the ID ( such as "AppID")is returned, and the domain name prefix ( such as "Example.com:appid")that is deployed in the custom domain name is included.

Func InstanceID
Func InstanceID () string

Returns a basic unique identifier for the current instance.

Func RequestID
Func RequestID (c Context) string

Returns the current request's private identification code.

Func Datacenter
Func Datacenter () string

Returns the identification number that the current instance operates in the data center.

Func defaultversionhostname
Func Defaultversionhostname (c Context) string

Returns the standard hostname ( shaped as "my-app.appspot.com")of the default version of the current app , used to construct the URL.

Func ServiceAccount
Func ServiceAccount (c Context) (String, error)

Returns a string representing the service account name in the email address format ( such as [email protected]).

Func modulename
Func modulename (c Context) string

Returns the module name of the current instance.

Func modulehostname
Func Modulehostname (c Context, module, version, instance string) (String, error)

Returns the host name of a module instance , with the module empty, the current instance's version is used (if it is not legal, the default version of the current instance is used), and if the instance is empty, the function returns the load-balanced host name.

Func Accesstoken
Func Accesstoken (c Context, scopes. String) (token string, expiry time. Time, err Error)

Generates a Oauth2 Pass token that represents the specified scope of the service account for the current app , and the token expires after the time exceeds expiry .

Func backendhostname
Func Backendhostname (c Context, name string, index int) string

Returns the standard host name for the specified back end. If index is-1, the function returns the load-balanced machine name of the end master.

Func backendinstance
Func backendinstance (c Context) (name string, index int)

Returns the name and index of the current backend instance, and returns "", 1 if it is not a back-end instance.

Type Blobkey
Type Blobkey string

Blobkey is the type of the blobstore key. This is defined here to avoid blobstore and datastore cycle dependencies.

Golang AppEngine Pack in the GAE environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.