Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ConfigureDB ¶
ConfigureDB initializes a mongo connection client and returns it
func GetDefaultCollection ¶
func GetDefaultCollection(db *mongo.Database) (col *mongo.Collection)
GetDefaultCollection returns the "secret" collection
func TestDbConnection ¶
TestDbConnection tests mongo connection by sending pings to the mongo database
Types ¶
type Secret ¶
type Secret struct { Hash string `json:"hash" bson:"hash" xml:"hash"` SecretText string `json:"secretText" bson:"secretText" yaml:"secretHash"` CreatedAt int64 `json:"createdAt" bson:"createdAt" yaml:"createdAt"` ExpiresAt int64 `json:"expiresAt" bson:"expiresAt" yaml:"expiresAt"` RemainingViews int `json:"remainingViews,string" bson:"remainingViews" yaml:"remainingViews"` }
Struct for containing secret
func (*Secret) CreateSecret ¶
CreateSecret method creates a new secret
func (*Secret) DeleteSecret ¶
DeleteSecrets method deletes a given secret
func (*Secret) UpdateSecret ¶
UpdateSecret method updates a given secret
Click to show internal directories.
Click to hide internal directories.