Documentation ¶
Index ¶
- func InitArangoDB(ctx context.Context, cnf Config) (driver.Database, error)
- func InitArangoDbCollection(ctx context.Context, adb driver.Database, colName string, ...) (created bool, col driver.Collection, err error)
- func InitArangoDbEnsureTTLIndex(ctx context.Context, col driver.Collection, opt struct{ ... }) (created bool, err error)
- func InitArangoDbPersistentIndex(ctx context.Context, col driver.Collection, opt struct{ ... }) (created bool, err error)
- func StructToMap(structPtr any) (map[string]any, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitArangoDB ¶
InitArangoDB инициализирует подключение к БД если БД не существует то она будет создана
func InitArangoDbCollection ¶
func InitArangoDbCollection( ctx context.Context, adb driver.Database, colName string, opt *driver.CreateCollectionOptions, ) (created bool, col driver.Collection, err error)
InitArangoDbCollection инициализирует коллекцию если коллекции не существует то она будет создана
func InitArangoDbEnsureTTLIndex ¶
func InitArangoDbEnsureTTLIndex(ctx context.Context, col driver.Collection, opt struct { Field string // Имя поля с типом time.Time TTL time.Duration // Время жизни в секундах от времени указанном в поле Field Opt *driver.EnsureTTLIndexOptions }) (created bool, err error)
InitArangoDbEnsureTTLIndex инициализация EnsureTTLIndex в коллекции если EnsureTTLIndex не существует то он будет создан
func InitArangoDbPersistentIndex ¶
func InitArangoDbPersistentIndex(ctx context.Context, col driver.Collection, opt struct { Cols []string Opt *driver.EnsurePersistentIndexOptions }) (created bool, err error)
InitArangoDbPersistentIndex инициализирует PersistentIndex в коллекции если PersistentIndex не существует то он будет создан
Types ¶
type Config ¶
type Config struct { Endpoints []string `envconfig:"ARANGODB_ENDPOINTS" required:"true" json:"adb_endpoints"` User string `envconfig:"ARANGODB_USER" required:"true" json:"adb_user"` Password string `envconfig:"ARANGODB_PASSWORD" required:"true" json:"adb_password"` Database string `envconfig:"ARANGODB_DATABASE" required:"true" json:"adb_database"` }
Click to show internal directories.
Click to hide internal directories.