Documentation
¶
Overview ¶
Package objectstore provides deterministic test doubles for AppTheory object-store code.
Index ¶
- type Call
- type FakeStore
- func (s *FakeStore) Calls() []Call
- func (s *FakeStore) Delete(_ context.Context, input store.DeleteInput) error
- func (s *FakeStore) Get(_ context.Context, input store.GetInput) (*store.GetOutput, error)
- func (s *FakeStore) PresignPut(_ context.Context, input store.PresignPutInput) (*store.PresignPutOutput, error)
- func (s *FakeStore) Put(_ context.Context, input store.PutInput) (store.ObjectRef, error)
- func (s *FakeStore) SetClock(now func() time.Time)
- func (s *FakeStore) SetError(operation Operation, err error)
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
Operation Operation
Ref store.ObjectRef
MaxBytes int64
ContentLength int64
ChecksumSHA256 string
ExpiresIn int64
ContentType string
Metadata map[string]string
Payload []byte
}
Call is one recorded FakeStore operation.
type FakeStore ¶
type FakeStore struct {
// contains filtered or unexported fields
}
FakeStore is an in-memory Store and UploadGranter for tests.
FakeStore records calls in order, injects per-operation failures, and copies all byte slices and metadata maps at its boundary.
func (*FakeStore) Delete ¶
Delete removes the referenced object. An unversioned ref removes all versions for the bucket/key.
func (*FakeStore) PresignPut ¶
func (s *FakeStore) PresignPut(_ context.Context, input store.PresignPutInput) (*store.PresignPutOutput, error)
PresignPut mints a deterministic fake upload grant.
The URL encodes the signed constraints instead of hashing them, so tests can assert the exact grant without AWS. A real S3 store additionally signs the request host; the fake signs it too, which keeps the signed-header set identical between fake and real.
type Operation ¶
type Operation string
Operation names a Store operation recorded by FakeStore.
const ( // OperationPut records a Store.Put call. OperationPut Operation = "Put" // OperationGet records a Store.Get call. OperationGet Operation = "Get" // OperationDelete records a Store.Delete call. OperationDelete Operation = "Delete" // OperationPresignPut records an UploadGranter.PresignPut call. OperationPresignPut Operation = "PresignPut" )