server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Database

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

func New

func New(FxArgs FxArgs) (*Database, error)

func (*Database) CreateServerWithConfig

func (database *Database) CreateServerWithConfig(
	ctx context.Context,
	server domain.Server,
) error

func (*Database) GetServerWithConfig

func (database *Database) GetServerWithConfig(ctx context.Context, guildID string) (*domain.Server, error)

type FxArgs added in v0.5.0

type FxArgs struct {
	fx.In

	SqliteClient *sqliteclient.SqliteClient
}

type Interface

type Interface interface {
	GetServerWithConfig(ctx context.Context, guildID string) (*domain.Server, error)
	CreateServerWithConfig(ctx context.Context, server domain.Server) error
}

type SchemaConfig

type SchemaConfig struct {
	bun.BaseModel `bun:"table:configs,alias:config"`

	ID      int           `bun:"id,pk,autoincrement"`
	GuildID string        `bun:"guild_id,notnull,unique"`
	Prefix  string        `bun:"prefix,notnull"`
	Server  *SchemaServer `bun:"rel:belongs-to,join:guild_id=guild_id"`
}

func NewSchemaConfig

func NewSchemaConfig(config *domain.Config) *SchemaConfig

type SchemaServer

type SchemaServer struct {
	bun.BaseModel `bun:"table:servers,alias:server"`

	ID      int           `bun:"id,pk,autoincrement"`
	GuildID string        `bun:"guild_id,notnull,unique"`
	Config  *SchemaConfig `bun:"rel:has-one,join:guild_id=guild_id"`
}

func NewSchemaServer

func NewSchemaServer(server *domain.Server) *SchemaServer

Jump to

Keyboard shortcuts

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