Documentation ¶
Overview ¶
The purge-cache service, typically available at `purge-cache.taskcluster.net`, is responsible for publishing a pulse message for workers, so they can purge cache upon request.
This document describes the exchange offered for workers by the cache-purge service.
See: https://docs.taskcluster.net/reference/core/purge-cache/exchanges
How to use this package ¶
This package is designed to sit on top of http://godoc.org/github.com/taskcluster/pulse-go/pulse. Please read the pulse package overview to get an understanding of how the pulse client is implemented in go.
This package provides two things in addition to the basic pulse package: structured types for unmarshaling pulse message bodies into, and custom Binding interfaces, for defining the fixed strings for task cluster exchange names, and routing keys as structured types.
For example, when specifying a binding, rather than using:
pulse.Bind( "*.*.*.*.*.*.gaia.#", "exchange/taskcluster-queue/v1/task-defined", )
You can rather use:
queueevents.TaskDefined{WorkerType: "gaia"}
In addition, this means that you will also get objects in your callback method like *queueevents.TaskDefinedMessage rather than just interface{}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PurgeCache ¶
type PurgeCache struct { RoutingKeyKind string `mwords:"*"` ProvisionerID string `mwords:"*"` WorkerType string `mwords:"*"` }
When a cache purge is requested a message will be posted on this exchange with designated `provisionerId` and `workerType` in the routing-key and the name of the `cacheFolder` as payload
See https://docs.taskcluster.net/reference/core/purge-cache/exchanges#purgeCache
func (PurgeCache) ExchangeName ¶
func (binding PurgeCache) ExchangeName() string
func (PurgeCache) NewPayloadObject ¶
func (binding PurgeCache) NewPayloadObject() interface{}
func (PurgeCache) RoutingKey ¶
func (binding PurgeCache) RoutingKey() string
type PurgeCacheMessage ¶
type PurgeCacheMessage struct { // Name of cache to purge. Notice that if a `workerType` have multiple kinds // of caches (with independent names), it should purge all caches identified // by `cacheName` regardless of cache type. // // See https://schemas.taskcluster.net/purge-cache/v1/purge-cache-message.json#/properties/cacheName CacheName string `json:"cacheName"` // `provisionerId` under which the `workerType` we want to purge for exists. // // Syntax: ^([a-zA-Z0-9-_]*)$ // Min length: 1 // Max length: 22 // // See https://schemas.taskcluster.net/purge-cache/v1/purge-cache-message.json#/properties/provisionerId ProvisionerID string `json:"provisionerId"` // Message version // // Possible values: // * 1 // // See https://schemas.taskcluster.net/purge-cache/v1/purge-cache-message.json#/properties/version Version int64 `json:"version"` // `workerType` we wish to purge cache for. // // Syntax: ^([a-zA-Z0-9-_]*)$ // Min length: 1 // Max length: 22 // // See https://schemas.taskcluster.net/purge-cache/v1/purge-cache-message.json#/properties/workerType WorkerType string `json:"workerType"` }
Message reporting that a specific cache should be purged
See https://schemas.taskcluster.net/purge-cache/v1/purge-cache-message.json#