config

package
v1.4.21 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Code generated by godddx, DO AVOID EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddConfigInput

type AddConfigInput struct {
	Type string `json:"type"`
	Data Ext    `json:"data"`
}

type Config

type Config struct {
	ID        string   `gorm:"primaryKey" json:"id"`
	CreatedAt orm.Time `gorm:"column:created_at;notNull;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt orm.Time `gorm:"column:updated_at;notNull;default:CURRENT_TIMESTAMP" json:"updated_at"`
	Type      string   `gorm:"column:type;notNull;default:''" json:"type"`
	Ext       Ext      `gorm:"column:ext;notNull;default:'{}';type:jsonb" json:"data"`
}

Config domain model

func (*Config) TableName

func (*Config) TableName() string

TableName database table name

type ConfigStorer

type ConfigStorer interface {
	List(context.Context, *[]*Config, orm.Pager, ...orm.QueryOption) (int64, error)
	Get(context.Context, *Config, ...orm.QueryOption) error
	Create(context.Context, *Config) error
	Update(context.Context, *Config, func(*Config), ...orm.QueryOption) error
	Delete(context.Context, *Config, ...orm.QueryOption) error

	FirstOrCreate(*Config) error
}

ConfigStorer Instantiation interface

type Core

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

Core business domain

func NewCore

func NewCore(store Storer) Core

NewCore create business domain

func (Core) CreateConfig added in v1.4.21

func (c Core) CreateConfig(ctx context.Context, in *AddConfigInput) (*Config, error)

CreateConfig Insert into database

func (Core) DeleteConfig added in v1.4.21

func (c Core) DeleteConfig(ctx context.Context, id int) (*Config, error)

DeleteConfig Delete object

func (Core) GetConfig

func (c Core) GetConfig(ctx context.Context, id int) (*Config, error)

GetConfig Query a single object

func (Core) ListConfigs added in v1.4.21

func (c Core) ListConfigs(ctx context.Context, in *FindConfigInput) ([]*Config, int64, error)

ListConfigs Paginated search

func (Core) UpdateConfig added in v1.4.21

func (c Core) UpdateConfig(ctx context.Context, in *EditConfigInput, id int) (*Config, error)

UpdateConfig Update object information

type EditConfigInput

type EditConfigInput struct {
	Type string `json:"type"`
	Data Ext    `json:"data"`
}

type Ext

type Ext struct {
	SIP *SIPConfig `json:"sip,omitempty"`
}

Ext domain model

func (*Ext) Scan

func (i *Ext) Scan(input any) error

Scan implements orm.Scaner.

type FindConfigInput

type FindConfigInput struct {
	web.PagerFilter
	Type string `form:"type"`
	Data Ext    `form:"data"`
}

type SIPConfig

type SIPConfig struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	ID       string `json:"id"`
	Password string `json:"password"`
}

type Storer

type Storer interface {
	Config() ConfigStorer
}

Storer data persistence

Directories

Path Synopsis
store
configdb
Code generated by godddx, DO AVOID EDIT.
Code generated by godddx, DO AVOID EDIT.

Jump to

Keyboard shortcuts

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