Documentation
¶
Overview ¶
Package archivetest provides an in-memory archive.Store for tests of the packages that archive runs or serve archived objects.
Index ¶
- type Object
- type Store
- func (s *Store) Close() error
- func (s *Store) Get(_ context.Context, key string) (io.ReadCloser, error)
- func (s *Store) Keys() []string
- func (s *Store) Object(key string) (Object, bool)
- func (s *Store) Presign(_ context.Context, key string, ttl time.Duration, attachment string) (string, time.Time, error)
- func (s *Store) Put(_ context.Context, key string, body []byte, contentType string) error
- func (s *Store) Puts() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// PutErr, when set, is returned by every Put before anything is stored,
// simulating an unreachable bucket.
PutErr error
// Now tells time for presign expiry; nil means time.Now.
Now func() time.Time
// contains filtered or unexported fields
}
Store is an in-memory archive.Store with the real create-only semantics. The zero value is not usable; call New.
func (*Store) Presign ¶
func (s *Store) Presign( _ context.Context, key string, ttl time.Duration, attachment string, ) (string, time.Time, error)
Presign returns a fake https URL naming the key, the expiry and the attachment name, so tests can assert on all three.