dao

package
v0.0.0-...-a783adc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Id         string `bson:"_id"`
	Props      any    `bson:"props"`
	Typ        string `bson:"typ"`
	CreateTime int64  `bson:"create_time"`
	UpdateTime int64  `bson:"update_time"`
}

Config defines for the MongoDB Collection "config"

type ConfigDao

type ConfigDao struct {
	// contains filtered or unexported fields
}

func NewConfigDao

func NewConfigDao(db *mongo.Database) *ConfigDao

func (*ConfigDao) FindByTyp

func (d *ConfigDao) FindByTyp(ctx context.Context, typ string) (*Config, error)

func (*ConfigDao) GetByTypes

func (d *ConfigDao) GetByTypes(ctx context.Context, types ...string) ([]*Config, error)

func (*ConfigDao) Increase

func (d *ConfigDao) Increase(ctx context.Context, field string) error

type IConfigDao

type IConfigDao interface {
	FindByTyp(ctx context.Context, typ string) (*Config, error)
	Increase(ctx context.Context, field string) error
	GetByTypes(ctx context.Context, types ...string) ([]*Config, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL