Versions in this module Expand all Collapse all v1 v1.4.0 Oct 18, 2023 Changes in this version + func NewMemTable(table v.Table[Thing]) v.MemTable[Thing] + func NewTable(dbClient *dynamodb.Client, env string) v.Table[Thing] + type Service struct + EntityType string + Table v.TableReadWriter[Thing] + func NewMemService(env string) Service + func NewService(dbClient *dynamodb.Client, env string) Service + func (s Service) CountThings(ctx context.Context) (int64, error) + func (s Service) Create(ctx context.Context, t Thing) (Thing, []string, error) + func (s Service) Delete(ctx context.Context, id string) (Thing, error) + func (s Service) DeleteVersion(ctx context.Context, id, versionID string) (Thing, error) + func (s Service) Exists(ctx context.Context, id string) bool + func (s Service) FilterMessagesByTag(ctx context.Context, tag string, contains string, anyMatch bool) ([]v.TextValue, error) + func (s Service) FilterThingMessages(ctx context.Context, contains string, anyMatch bool) ([]v.TextValue, error) + func (s Service) Read(ctx context.Context, id string) (Thing, error) + func (s Service) ReadAllCountsByTag(ctx context.Context, tag string, sortByValue bool) ([]v.NumValue, error) + func (s Service) ReadAllDates(ctx context.Context) ([]string, error) + func (s Service) ReadAllMessagesByTag(ctx context.Context, tag string, sortByValue bool) ([]v.TextValue, error) + func (s Service) ReadAllTags(ctx context.Context) ([]string, error) + func (s Service) ReadAllThingIDs(ctx context.Context) ([]string, error) + func (s Service) ReadAllThingMessages(ctx context.Context, sortByValue bool) ([]v.TextValue, error) + func (s Service) ReadAllThingsByDate(ctx context.Context, day string) ([]Thing, error) + func (s Service) ReadAllThingsByDateAsJSON(ctx context.Context, day string) ([]byte, error) + func (s Service) ReadAllThingsByTag(ctx context.Context, tag string) ([]Thing, error) + func (s Service) ReadAllThingsByTagAsJSON(ctx context.Context, tag string) ([]byte, error) + func (s Service) ReadAllVersions(ctx context.Context, id string) ([]Thing, error) + func (s Service) ReadAllVersionsAsJSON(ctx context.Context, id string) ([]byte, error) + func (s Service) ReadAsJSON(ctx context.Context, id string) ([]byte, error) + func (s Service) ReadCountsByTag(ctx context.Context, tag string, reverse bool, limit int, offset string) ([]v.NumValue, error) + func (s Service) ReadDates(ctx context.Context, reverse bool, limit int, offset string) ([]string, error) + func (s Service) ReadMessageRangeByTag(ctx context.Context, tag string, from, to string, reverse bool) ([]v.TextValue, error) + func (s Service) ReadMessagesByTag(ctx context.Context, tag string, reverse bool, limit int, offset string) ([]v.TextValue, error) + func (s Service) ReadTags(ctx context.Context, reverse bool, limit int, offset string) ([]string, error) + func (s Service) ReadThingIDs(ctx context.Context, reverse bool, limit int, offset string) ([]string, error) + func (s Service) ReadThingMessageRange(ctx context.Context, from, to string, reverse bool) ([]v.TextValue, error) + func (s Service) ReadThingMessages(ctx context.Context, reverse bool, limit int, offset string) ([]v.TextValue, error) + func (s Service) ReadThingsByDate(ctx context.Context, day string, reverse bool, limit int, offset string) ([]Thing, error) + func (s Service) ReadThingsByDateAsJSON(ctx context.Context, day string, reverse bool, limit int, offset string) ([]byte, error) + func (s Service) ReadThingsByTag(ctx context.Context, tag string, reverse bool, limit int, offset string) ([]Thing, error) + func (s Service) ReadThingsByTagAsJSON(ctx context.Context, tag string, reverse bool, limit int, offset string) ([]byte, error) + func (s Service) ReadVersion(ctx context.Context, id, versionID string) (Thing, error) + func (s Service) ReadVersionAsJSON(ctx context.Context, id, versionID string) ([]byte, error) + func (s Service) ReadVersions(ctx context.Context, id string, reverse bool, limit int, offset string) ([]Thing, error) + func (s Service) ReadVersionsAsJSON(ctx context.Context, id string, reverse bool, limit int, offset string) ([]byte, error) + func (s Service) SumCountsByTag(ctx context.Context, tag string) (float64, error) + func (s Service) Update(ctx context.Context, t Thing) (Thing, []string, error) + func (s Service) VersionExists(ctx context.Context, id, versionID string) bool + type Thing struct + Count int + CreatedAt time.Time + ExpiresAt time.Time + ID string + Message string + Tags []string + UpdatedAt time.Time + VersionID string + func (t Thing) CompressedJSON() []byte + func (t Thing) CreatedOn() string + func (t Thing) Validate() []string