Documentation
¶
Index ¶
- type MongoStorage
- func (m *MongoStorage) Delete(ctx context.Context, key string) error
- func (m *MongoStorage) Exists(ctx context.Context, key string) bool
- func (m *MongoStorage) List(ctx context.Context, prefix string, recursive bool) ([]string, error)
- func (m *MongoStorage) Load(ctx context.Context, key string) ([]byte, error)
- func (m *MongoStorage) Lock(ctx context.Context, key string) error
- func (m *MongoStorage) Stat(ctx context.Context, key string) (certmagic.KeyInfo, error)
- func (m *MongoStorage) Store(ctx context.Context, key string, value []byte) error
- func (m *MongoStorage) Unlock(ctx context.Context, key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoStorage ¶
type MongoStorage struct {
Collection *mongo.Collection
Locks *mongo.Collection
LockTTL time.Duration
InstanceID string // Unique identifier for this instance
}
MongoStorage implements certmagic.Storage using MongoDB.
func NewMongoStorage ¶
func NewMongoStorage(mongoClient *mongo.Client, database string) (*MongoStorage, error)
NewMongoStorage initializes the MongoStorage
func (*MongoStorage) Delete ¶
func (m *MongoStorage) Delete(ctx context.Context, key string) error
Delete deletes a key
func (*MongoStorage) Exists ¶
func (m *MongoStorage) Exists(ctx context.Context, key string) bool
Exists checks if a key exists
Click to show internal directories.
Click to hide internal directories.