admin

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Code generated by ent, DO NOT EDIT.

Code generated by ent, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldLabel

func FieldLabel(name string) string

FieldLabel provides a label for an entity field name (ie, user_id -> User ID).

func GetEntityTypeNames

func GetEntityTypeNames() []string

Types

type EntityList

type EntityList struct {
	Columns     []string
	Entities    []EntityValues
	Page        int
	HasNextPage bool
}

type EntityValues

type EntityValues struct {
	ID     int
	Values []string
}

type Extension

type Extension struct {
	entc.DefaultExtension
}

Extension is the Ent extension that generates code to support the entity admin panel.

func (*Extension) Templates

func (*Extension) Templates() []*gen.Template

type Handler

type Handler struct {
	Config HandlerConfig
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(client *ent.Client, cfg HandlerConfig) *Handler

func (*Handler) Create

func (h *Handler) Create(ctx echo.Context, entityType string) error

func (*Handler) Delete

func (h *Handler) Delete(ctx echo.Context, entityType string, id int) error

func (*Handler) Get

func (h *Handler) Get(ctx echo.Context, entityType string, id int) (url.Values, error)

func (*Handler) List

func (h *Handler) List(ctx echo.Context, entityType string) (*EntityList, error)

func (*Handler) PasswordTokenCreate

func (h *Handler) PasswordTokenCreate(ctx echo.Context) error

func (*Handler) PasswordTokenDelete

func (h *Handler) PasswordTokenDelete(ctx echo.Context, id int) error

func (*Handler) PasswordTokenGet

func (h *Handler) PasswordTokenGet(ctx echo.Context, id int) (url.Values, error)

func (*Handler) PasswordTokenList

func (h *Handler) PasswordTokenList(ctx echo.Context) (*EntityList, error)

func (*Handler) PasswordTokenUpdate

func (h *Handler) PasswordTokenUpdate(ctx echo.Context, id int) error

func (*Handler) Update

func (h *Handler) Update(ctx echo.Context, entityType string, id int) error

func (*Handler) UserCreate

func (h *Handler) UserCreate(ctx echo.Context) error

func (*Handler) UserDelete

func (h *Handler) UserDelete(ctx echo.Context, id int) error

func (*Handler) UserGet

func (h *Handler) UserGet(ctx echo.Context, id int) (url.Values, error)

func (*Handler) UserList

func (h *Handler) UserList(ctx echo.Context) (*EntityList, error)

func (*Handler) UserUpdate

func (h *Handler) UserUpdate(ctx echo.Context, id int) error

type HandlerConfig

type HandlerConfig struct {
	ItemsPerPage int
	PageQueryKey string
	TimeFormat   string
}

type PasswordToken

type PasswordToken struct {
	Token     *string    `form:"token"`
	UserID    int        `form:"user_id"`
	CreatedAt *time.Time `form:"created_at"`
}

type User

type User struct {
	Name      string     `form:"name"`
	Email     string     `form:"email"`
	Password  *string    `form:"password"`
	Verified  bool       `form:"verified"`
	Admin     bool       `form:"admin"`
	CreatedAt *time.Time `form:"created_at"`
}

Jump to

Keyboard shortcuts

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