config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Code generated by gowebx, DO AVOID EDIT.

Code generated by gowebx, DO AVOID EDIT.

Code generated by gowebx, DO AVOID EDIT.

Code generated by gowebx, DO AVOID EDIT.

Code generated by gowebx, 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 {
	Find(context.Context, *[]*Config, orm.Pager, ...orm.QueryOption) (int64, error)
	Get(context.Context, *Config, ...orm.QueryOption) error
	Add(context.Context, *Config) error
	Edit(context.Context, *Config, func(*Config), ...orm.QueryOption) error
	Del(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) AddConfig

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

AddConfig Insert into database

func (*Core) DelConfig

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

DelConfig Delete object

func (*Core) EditConfig

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

EditConfig Update object information

func (*Core) FindConfig

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

FindConfig Paginated search

func (*Core) GetConfig

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

GetConfig Query a single object

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 interface{}) 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"`
	Domain   string `json:"domain"`
	Password string `json:"password"`
}

type Storer

type Storer interface {
	Config() ConfigStorer
}

Storer data persistence

Directories

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

Jump to

Keyboard shortcuts

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