Versions in this module Expand all Collapse all v0 v0.2.1 Oct 9, 2026 v0.2.0 Oct 8, 2026 Changes in this version + type App struct + func New(t testing.TB, app *celerity.App, opts ...Option) *App + func NewWithResources(t testing.TB, app *celerity.App, p *Provider, opts ...Option) *App + func (a *App) Consume(t testing.TB, name string, bodies ...[]byte) *handler.BatchResult + func (a *App) ConsumeJSON(t testing.TB, name string, messages ...any) *handler.BatchResult + func (a *App) DELETE(t testing.TB, path string, opts ...RequestOption) *Response + func (a *App) Do(t testing.TB, method, path string, opts ...RequestOption) *Response + func (a *App) GET(t testing.TB, path string, opts ...RequestOption) *Response + func (a *App) Invoke(t testing.TB, name string, input any, out any) + func (a *App) PATCH(t testing.TB, path string, opts ...RequestOption) *Response + func (a *App) POST(t testing.TB, path string, opts ...RequestOption) *Response + func (a *App) PUT(t testing.TB, path string, opts ...RequestOption) *Response + func (a *App) Resources() *Provider + func (a *App) Schedule(t testing.TB, name string, input ...[]byte) + func (a *App) Send(t testing.TB, route string, body []byte, opts ...WebSocketMessage) + type Bucket struct + func NewBucket(name string) *Bucket + func (b *Bucket) Contents(key string) ([]byte, bool) + func (b *Bucket) Copy(ctx context.Context, sourceKey string, dest bucket.Destination, ...) (bucket.CopyResult, error) + func (b *Bucket) Delete(ctx context.Context, key string, opts ...bucket.DeleteOption) error + func (b *Bucket) DeleteMany(ctx context.Context, refs []bucket.ObjectRef) (bucket.DeleteManyResult, error) + func (b *Bucket) Exists(ctx context.Context, key string, opts ...bucket.ExistsOption) (bool, error) + func (b *Bucket) Get(ctx context.Context, key string, opts ...bucket.GetOption) (*bucket.Object, error) + func (b *Bucket) Info(ctx context.Context, key string, opts ...bucket.InfoOption) (bucket.ObjectInfo, error) + func (b *Bucket) Keys() []string + func (b *Bucket) Len() int + func (b *Bucket) List(ctx context.Context, prefix string, opts ...bucket.ListOption) ([]bucket.ObjectInfo, bucket.Cursor, error) + func (b *Bucket) Put(ctx context.Context, key string, body io.Reader, opts ...bucket.PutOption) (bucket.PutResult, error) + func (b *Bucket) SignedURL(ctx context.Context, key string, action bucket.SignAction, ...) (bucket.SignedURL, error) + func (b *Bucket) Versions(ctx context.Context, prefix string, opts ...bucket.ListOption) ([]bucket.ObjectVersion, bucket.Cursor, error) + type CacheStub struct + AppendFunc func(ctx context.Context, key string, value string) (int64, error) + ConnectionFunc func(ctx context.Context) (cache.Connection, error) + DecrementFunc func(ctx context.Context, key string, delta int64) (int64, error) + DeleteFunc func(ctx context.Context, key string) (bool, error) + DeleteManyFunc func(ctx context.Context, keys []string) (int64, error) + ExistsFunc func(ctx context.Context, key string) (bool, error) + ExpireFunc func(ctx context.Context, key string, ttl time.Duration) (bool, error) + GetFunc func(ctx context.Context, key string) (string, error) + GetManyFunc func(ctx context.Context, keys []string) (map[string]string, error) + GetSetFunc func(ctx context.Context, key string, value string) (string, error) + HashDeleteFunc func(ctx context.Context, key string, fields []string) (int64, error) + HashExistsFunc func(ctx context.Context, key string, field string) (bool, error) + HashGetAllFunc func(ctx context.Context, key string) (map[string]string, error) + HashGetFunc func(ctx context.Context, key string, field string) (string, error) + HashIncrementFunc func(ctx context.Context, key string, field string, delta int64) (int64, error) + HashKeysFunc func(ctx context.Context, key string) ([]string, error) + HashLenFunc func(ctx context.Context, key string) (int64, error) + HashSetFunc func(ctx context.Context, key string, fields map[string]string) error + IncrementFloatFunc func(ctx context.Context, key string, delta float64) (float64, error) + IncrementFunc func(ctx context.Context, key string, delta int64) (int64, error) + ListIndexFunc func(ctx context.Context, key string, index int64) (string, error) + ListLenFunc func(ctx context.Context, key string) (int64, error) + ListPopFunc func(ctx context.Context, key string, count int64, opts ...cache.EndOption) ([]string, error) + ListPushFunc func(ctx context.Context, key string, values []string, opts ...cache.EndOption) (int64, error) + ListRangeFunc func(ctx context.Context, key string, start int64, stop int64) ([]string, error) + ListTrimFunc func(ctx context.Context, key string, start int64, stop int64) error + PersistFunc func(ctx context.Context, key string) (bool, error) + RenameFunc func(ctx context.Context, key string, newKey string) error + ScanFunc func(ctx context.Context, opts ...cache.ScanOption) iter.Seq2[string, error] + SetAddFunc func(ctx context.Context, key string, members []string) (int64, error) + SetDiffFunc func(ctx context.Context, keys []string) ([]string, error) + SetFunc func(ctx context.Context, key string, value string, opts ...cache.SetOption) (bool, error) + SetIntersectFunc func(ctx context.Context, keys []string) ([]string, error) + SetIsMemberFunc func(ctx context.Context, key string, member string) (bool, error) + SetLenFunc func(ctx context.Context, key string) (int64, error) + SetManyFunc func(ctx context.Context, values map[string]string) error + SetMembersFunc func(ctx context.Context, key string) ([]string, error) + SetRemoveFunc func(ctx context.Context, key string, members []string) (int64, error) + SetUnionFunc func(ctx context.Context, keys []string) ([]string, error) + SortedSetAddFunc func(ctx context.Context, key string, members []cache.SortedSetMember) (int64, error) + SortedSetCountByScoreFunc func(ctx context.Context, key string, scores cache.ScoreRange) (int64, error) + SortedSetIncrementFunc func(ctx context.Context, key string, member string, delta float64) (float64, error) + SortedSetLenFunc func(ctx context.Context, key string) (int64, error) + SortedSetRangeByScoreFunc func(ctx context.Context, key string, scores cache.ScoreRange, ...) ([]cache.SortedSetMember, error) + SortedSetRangeFunc func(ctx context.Context, key string, start int64, stop int64, ...) ([]cache.SortedSetMember, error) + SortedSetRankFunc func(ctx context.Context, key string, member string, opts ...cache.RangeOption) (int64, error) + SortedSetRemoveByRankFunc func(ctx context.Context, key string, start int64, stop int64) (int64, error) + SortedSetRemoveByScoreFunc func(ctx context.Context, key string, scores cache.ScoreRange) (int64, error) + SortedSetRemoveFunc func(ctx context.Context, key string, members []string) (int64, error) + SortedSetScoreFunc func(ctx context.Context, key string, member string) (float64, error) + TTLFunc func(ctx context.Context, key string) (time.Duration, bool, error) + TransactionFunc func(ctx context.Context, queue func(cache.Tx)) ([]any, error) + TypeFunc func(ctx context.Context, key string) (cache.KeyType, error) + func NewCacheStub(name string) *CacheStub + func (s *CacheStub) Append(ctx context.Context, key string, value string) (int64, error) + func (s *CacheStub) Called(name string) bool + func (s *CacheStub) Calls() []string + func (s *CacheStub) Connection(ctx context.Context) (cache.Connection, error) + func (s *CacheStub) Decrement(ctx context.Context, key string, delta int64) (int64, error) + func (s *CacheStub) Delete(ctx context.Context, key string) (bool, error) + func (s *CacheStub) DeleteMany(ctx context.Context, keys []string) (int64, error) + func (s *CacheStub) Exists(ctx context.Context, key string) (bool, error) + func (s *CacheStub) Expire(ctx context.Context, key string, ttl time.Duration) (bool, error) + func (s *CacheStub) Get(ctx context.Context, key string) (string, error) + func (s *CacheStub) GetMany(ctx context.Context, keys []string) (map[string]string, error) + func (s *CacheStub) GetSet(ctx context.Context, key string, value string) (string, error) + func (s *CacheStub) HashDelete(ctx context.Context, key string, fields []string) (int64, error) + func (s *CacheStub) HashExists(ctx context.Context, key string, field string) (bool, error) + func (s *CacheStub) HashGet(ctx context.Context, key string, field string) (string, error) + func (s *CacheStub) HashGetAll(ctx context.Context, key string) (map[string]string, error) + func (s *CacheStub) HashIncrement(ctx context.Context, key string, field string, delta int64) (int64, error) + func (s *CacheStub) HashKeys(ctx context.Context, key string) ([]string, error) + func (s *CacheStub) HashLen(ctx context.Context, key string) (int64, error) + func (s *CacheStub) HashSet(ctx context.Context, key string, fields map[string]string) error + func (s *CacheStub) Increment(ctx context.Context, key string, delta int64) (int64, error) + func (s *CacheStub) IncrementFloat(ctx context.Context, key string, delta float64) (float64, error) + func (s *CacheStub) ListIndex(ctx context.Context, key string, index int64) (string, error) + func (s *CacheStub) ListLen(ctx context.Context, key string) (int64, error) + func (s *CacheStub) ListPop(ctx context.Context, key string, count int64, opts ...cache.EndOption) ([]string, error) + func (s *CacheStub) ListPush(ctx context.Context, key string, values []string, opts ...cache.EndOption) (int64, error) + func (s *CacheStub) ListRange(ctx context.Context, key string, start int64, stop int64) ([]string, error) + func (s *CacheStub) ListTrim(ctx context.Context, key string, start int64, stop int64) error + func (s *CacheStub) Persist(ctx context.Context, key string) (bool, error) + func (s *CacheStub) Rename(ctx context.Context, key string, newKey string) error + func (s *CacheStub) Scan(ctx context.Context, opts ...cache.ScanOption) iter.Seq2[string, error] + func (s *CacheStub) Set(ctx context.Context, key string, value string, opts ...cache.SetOption) (bool, error) + func (s *CacheStub) SetAdd(ctx context.Context, key string, members []string) (int64, error) + func (s *CacheStub) SetDiff(ctx context.Context, keys []string) ([]string, error) + func (s *CacheStub) SetIntersect(ctx context.Context, keys []string) ([]string, error) + func (s *CacheStub) SetIsMember(ctx context.Context, key string, member string) (bool, error) + func (s *CacheStub) SetLen(ctx context.Context, key string) (int64, error) + func (s *CacheStub) SetMany(ctx context.Context, values map[string]string) error + func (s *CacheStub) SetMembers(ctx context.Context, key string) ([]string, error) + func (s *CacheStub) SetRemove(ctx context.Context, key string, members []string) (int64, error) + func (s *CacheStub) SetUnion(ctx context.Context, keys []string) ([]string, error) + func (s *CacheStub) SortedSetAdd(ctx context.Context, key string, members []cache.SortedSetMember) (int64, error) + func (s *CacheStub) SortedSetCountByScore(ctx context.Context, key string, scores cache.ScoreRange) (int64, error) + func (s *CacheStub) SortedSetIncrement(ctx context.Context, key string, member string, delta float64) (float64, error) + func (s *CacheStub) SortedSetLen(ctx context.Context, key string) (int64, error) + func (s *CacheStub) SortedSetRange(ctx context.Context, key string, start int64, stop int64, ...) ([]cache.SortedSetMember, error) + func (s *CacheStub) SortedSetRangeByScore(ctx context.Context, key string, scores cache.ScoreRange, ...) ([]cache.SortedSetMember, error) + func (s *CacheStub) SortedSetRank(ctx context.Context, key string, member string, opts ...cache.RangeOption) (int64, error) + func (s *CacheStub) SortedSetRemove(ctx context.Context, key string, members []string) (int64, error) + func (s *CacheStub) SortedSetRemoveByRank(ctx context.Context, key string, start int64, stop int64) (int64, error) + func (s *CacheStub) SortedSetRemoveByScore(ctx context.Context, key string, scores cache.ScoreRange) (int64, error) + func (s *CacheStub) SortedSetScore(ctx context.Context, key string, member string) (float64, error) + func (s *CacheStub) TTL(ctx context.Context, key string) (time.Duration, bool, error) + func (s *CacheStub) Transaction(ctx context.Context, queue func(cache.Tx)) ([]any, error) + func (s *CacheStub) Type(ctx context.Context, key string) (cache.KeyType, error) + type Datastore struct + func NewDatastore(name string) *Datastore + func (d *Datastore) Atomically(ctx context.Context, partition string, ops []datastore.AtomicOp) error + func (d *Datastore) BatchGet(ctx context.Context, keys []datastore.Key, out any) ([]datastore.Key, error) + func (d *Datastore) BatchWrite(ctx context.Context, ops []datastore.BatchOp) ([]datastore.BatchOp, error) + func (d *Datastore) Delete(ctx context.Context, key datastore.Key, opts ...datastore.WriteOption) error + func (d *Datastore) Get(ctx context.Context, key datastore.Key, out any) (datastore.Revision, error) + func (d *Datastore) Len() int + func (d *Datastore) Put(ctx context.Context, key datastore.Key, item any, ...) (datastore.Revision, error) + func (d *Datastore) Query(ctx context.Context, q datastore.Query, out any) (datastore.Cursor, error) + func (d *Datastore) Scan(ctx context.Context, s datastore.Scan, out any) (datastore.Cursor, error) + func (d *Datastore) Seed(key datastore.Key, item any) error + func (d *Datastore) Update(ctx context.Context, key datastore.Key, updates []datastore.Update, ...) (datastore.Revision, error) + type Option func(*App) + func WithClock(now func() time.Time) Option + func WithDeadline(d time.Duration) Option + func WithTraceContext(tc map[string]string) Option + type Provider struct + func Live(t testing.TB) *Provider + func LiveWith(t testing.TB, provider resources.Provider) *Provider + func Resources() *Provider + func (p *Provider) Bucket(ref resources.Ref) (bucket.Store, error) + func (p *Provider) BucketNamed(name string) *Bucket + func (p *Provider) Cache(ref resources.Ref) (cache.Client, error) + func (p *Provider) CacheNamed(name string) *CacheStub + func (p *Provider) Close(ctx context.Context) error + func (p *Provider) Datastore(ref resources.Ref) (datastore.Client, error) + func (p *Provider) DatastoreNamed(name string) *Datastore + func (p *Provider) Name() string + func (p *Provider) Queue(ref resources.Ref) (queue.Client, error) + func (p *Provider) QueueNamed(name string) *Queue + func (p *Provider) SQLDatabase(ref resources.Ref) (sqldb.Client, error) + func (p *Provider) Topic(ref resources.Ref) (topic.Client, error) + func (p *Provider) TopicNamed(name string) *Topic + func (p *Provider) WithDatabase(name string, client sqldb.Client) *Provider + type PublishedMessage struct + Body []byte + ID string + Options topic.SendOptions + func (m PublishedMessage) Text() string + type Queue struct + Refuse error + func NewQueue(name string) *Queue + func (q *Queue) Len() int + func (q *Queue) Reset() + func (q *Queue) Send(ctx context.Context, body []byte, opts ...queue.SendOption) (string, error) + func (q *Queue) SendBatch(ctx context.Context, entries []queue.BatchEntry) (queue.BatchResult, error) + func (q *Queue) Sent() []SentMessage + type RecordedSpan struct + Attrs []telemetry.Attr + Ended bool + Err error + Name string + Parent string + SpanID string + TraceID string + func (s RecordedSpan) Attr(key string) (any, bool) + type RequestOption func(*celerityhandler.Request) + func Body(body []byte) RequestOption + func Header(name, value string) RequestOption + func JSONBody(v any) RequestOption + func Query(name, value string) RequestOption + func SourceIP(ip string) RequestOption + type Response struct + Handler string + Result *celerityhandler.Result + func (r *Response) AssertStatus(t testing.TB, want int) *Response + func (r *Response) Body() []byte + func (r *Response) Decode(t testing.TB, out any) + func (r *Response) Error() error + func (r *Response) Header(name string) string + func (r *Response) Status() int + type SentMessage struct + Body []byte + ID string + Options queue.SendOptions + func (m SentMessage) Text() string + type Topic struct + Refuse error + func NewTopic(name string) *Topic + func (t *Topic) Len() int + func (t *Topic) Publish(ctx context.Context, body []byte, opts ...topic.SendOption) (string, error) + func (t *Topic) PublishBatch(ctx context.Context, entries []topic.BatchEntry) (topic.BatchResult, error) + func (t *Topic) Published() []PublishedMessage + func (t *Topic) Reset() + type Tracer struct + func NewTracer(t testing.TB) *Tracer + func (r *Tracer) AssertSpan(t testing.TB, name string) RecordedSpan + func (r *Tracer) Names() []string + func (r *Tracer) Reset() + func (r *Tracer) Span(name string) (RecordedSpan, bool) + func (r *Tracer) Spans() []RecordedSpan + func (r *Tracer) Start(ctx context.Context, name string, attrs ...telemetry.Attr) (context.Context, telemetry.Span) + type WebSocketMessage func(*handler.WebSocketMessage) + func Binary() WebSocketMessage + func From(connectionID string) WebSocketMessage