Documentation ¶
Overview ¶
Package count contains 'counter' filters for all the gae services. This serves as a set of simple example filters, and also enables other filters to test to see if certain underlying APIs are called when they should be (e.g. for the datastore mcache filter, for example).
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DSCounter ¶
type DSCounter struct { AllocateIDs Entry DecodeCursor Entry RunInTransaction Entry Run Entry Count Entry DeleteMulti Entry GetMulti Entry PutMulti Entry }
DSCounter is the counter object for the datastore service.
func FilterRDS ¶
FilterRDS installs a counter datastore filter in the context.
Example ¶
// Set up your context using a base service implementation (memory or prod) c := memory.Use(context.Background()) // Apply the counter.FilterRDS c, counter := FilterRDS(c) // functions use ds from the context like normal... they don't need to know // that there are any filters at all. someCalledFunc := func(c context.Context) { vals := []ds.PropertyMap{{ "FieldName": ds.MkProperty(100), "$key": ds.MkProperty(ds.NewKey(c, "Kind", "", 1, nil))}, } if err := ds.Put(c, vals); err != nil { panic(err) } } // Using the other function. someCalledFunc(c) someCalledFunc(c) // Then we can see what happened! fmt.Printf("%d\n", counter.PutMulti.Successes())
Output: 2
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry is a success/fail pair for a single API method. It's returned by the Counter interface.
type InfoCounter ¶
type InfoCounter struct { AppID Entry FullyQualifiedAppID Entry GetNamespace Entry Datacenter Entry DefaultVersionHostname Entry InstanceID Entry IsDevAppServer Entry IsOverQuota Entry IsTimeoutError Entry ModuleHostname Entry ModuleName Entry RequestID Entry ServerSoftware Entry ServiceAccount Entry VersionID Entry Namespace Entry AccessToken Entry PublicCertificates Entry SignBytes Entry }
InfoCounter is the counter object for the GlobalInfo service.
type MCCounter ¶
type MCCounter struct { NewItem Entry AddMulti Entry SetMulti Entry GetMulti Entry DeleteMulti Entry CompareAndSwapMulti Entry Increment Entry Flush Entry Stats Entry }
MCCounter is the counter object for the Memcache service.
type MailCounter ¶
MailCounter is the counter object for the Mail service.
func FilterMail ¶
func FilterMail(c context.Context) (context.Context, *MailCounter)
FilterMail installs a counter Mail filter in the context.
type ModuleCounter ¶
type ModuleCounter struct { List Entry NumInstances Entry SetNumInstances Entry Versions Entry DefaultVersion Entry Start Entry Stop Entry }
ModuleCounter is the counter object for the Module service.
func FilterModule ¶
func FilterModule(c context.Context) (context.Context, *ModuleCounter)
FilterModule installs a counter Module filter in the context.
type TQCounter ¶
type TQCounter struct { AddMulti Entry DeleteMulti Entry Lease Entry LeaseByTag Entry ModifyLease Entry Purge Entry Stats Entry }
TQCounter is the counter object for the TaskQueue service.
type UserCounter ¶
type UserCounter struct { Current Entry CurrentOAuth Entry IsAdmin Entry LoginURL Entry LoginURLFederated Entry LogoutURL Entry OAuthConsumerKey Entry }
UserCounter is the counter object for the User service.
func FilterUser ¶
func FilterUser(c context.Context) (context.Context, *UserCounter)
FilterUser installs a counter User filter in the context.