svc

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceNotSetInContext = "service is not set in context"
)

Functions

This section is empty.

Types

type AdminUser

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

func NewAdminUser

func NewAdminUser(r *repo.Repository) *AdminUser

func (*AdminUser) Connection

func (s *AdminUser) Connection(ctx context.Context, where *ent.AdminUserWhereInput, orderBy *ent.AdminUserOrder, skip *int, first *int, last *int) (*ent.AdminUserConnection, error)

func (*AdminUser) Create

func (*AdminUser) CreateMany

func (s *AdminUser) CreateMany(ctx context.Context, data []ent.CreateAdminUserInput) ([]*ent.AdminUser, error)

func (*AdminUser) CreateManyTx

func (s *AdminUser) CreateManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateAdminUserInput) ([]*ent.AdminUser, error)

func (*AdminUser) CreateTx

func (s *AdminUser) CreateTx(ctx context.Context, tx *ent.Tx, data ent.CreateAdminUserInput) (*ent.AdminUser, error)

func (*AdminUser) Delete

func (*AdminUser) DeleteMany

func (s *AdminUser) DeleteMany(ctx context.Context, where ent.AdminUserWhereInput) (int, error)

func (*AdminUser) DeleteManyTx

func (s *AdminUser) DeleteManyTx(ctx context.Context, tx *ent.Tx, where ent.AdminUserWhereInput) (int, error)

func (*AdminUser) DeleteTx

func (s *AdminUser) DeleteTx(ctx context.Context, tx *ent.Tx, where ent.AdminUserWhereUniqueInput) (*ent.AdminUser, error)

func (*AdminUser) Get

func (s *AdminUser) Get(ctx context.Context, where *ent.AdminUserWhereInput, orderBy *ent.AdminUserOrder, skip *int, first *int, last *int) ([]*ent.AdminUser, error)

func (*AdminUser) GetOne

func (*AdminUser) GetOneTx

func (s *AdminUser) GetOneTx(ctx context.Context, tx *ent.Tx, where ent.AdminUserWhereUniqueInput) (*ent.AdminUser, error)

func (*AdminUser) GetTx

func (s *AdminUser) GetTx(ctx context.Context, tx *ent.Tx, where *ent.AdminUserWhereInput, orderBy *ent.AdminUserOrder, skip *int, first *int, last *int) ([]*ent.AdminUser, error)

func (*AdminUser) Update

func (*AdminUser) UpdateMany

func (s *AdminUser) UpdateMany(ctx context.Context, where ent.AdminUserWhereInput, data ent.UpdateAdminUserInput) (int, error)

func (*AdminUser) UpdateManyTx

func (s *AdminUser) UpdateManyTx(ctx context.Context, tx *ent.Tx, where ent.AdminUserWhereInput, data ent.UpdateAdminUserInput) (int, error)

func (*AdminUser) UpdateTx

func (*AdminUser) Upsert

func (*AdminUser) UpsertMany

func (s *AdminUser) UpsertMany(ctx context.Context, data []ent.CreateAdminUserInput) (int, error)

func (*AdminUser) UpsertManyTx

func (s *AdminUser) UpsertManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateAdminUserInput) (int, error)

func (*AdminUser) UpsertTx

func (s *AdminUser) UpsertTx(ctx context.Context, tx *ent.Tx, data ent.CreateAdminUserInput) (*ent.AdminUser, error)

type Entity

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

func NewEntity

func NewEntity(schemaManager SchemaManager) *Entity

func (Entity) CreateEntity

func (e Entity) CreateEntity(ctx context.Context, data entity.CreateEntityInput) (*entity.Entity, error)

func (Entity) DeleteEntity

func (e Entity) DeleteEntity(ctx context.Context, where entity.EntityWhereUniqueInput) (*entity.Entity, error)

func (Entity) Entities

func (Entity) Entities(ctx context.Context) ([]*entity.Entity, error)

func (Entity) Entity

func (Entity) EntityEdges

func (Entity) EntityEdges(ctx context.Context, obj *entity.Entity) ([]*entity.Edge, error)

func (Entity) EntityFields

func (Entity) EntityFields(ctx context.Context, obj *entity.Entity) ([]*entity.Field, error)

func (Entity) EntityRelatedEntity

func (Entity) EntityRelatedEntity(ctx context.Context, obj *entity.Edge) (*entity.Entity, error)

func (Entity) Fields

func (Entity) Fields(ctx context.Context) ([]*entity.Field, error)

func (Entity) UpdateEntity

type File

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

func NewFile

func NewFile(r *repo.Repository) *File

func (*File) Connection

func (s *File) Connection(ctx context.Context, where *ent.FileWhereInput, orderBy *ent.FileOrder, skip *int, first *int, last *int) (*ent.FileConnection, error)

func (*File) Create

func (s *File) Create(ctx context.Context, data ent.CreateFileInput) (*ent.File, error)

func (*File) CreateMany

func (s *File) CreateMany(ctx context.Context, data []ent.CreateFileInput) ([]*ent.File, error)

func (*File) CreateManyTx

func (s *File) CreateManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateFileInput) ([]*ent.File, error)

func (*File) CreateTx

func (s *File) CreateTx(ctx context.Context, tx *ent.Tx, data ent.CreateFileInput) (*ent.File, error)

func (*File) Delete

func (s *File) Delete(ctx context.Context, where ent.FileWhereUniqueInput) (*ent.File, error)

func (*File) DeleteMany

func (s *File) DeleteMany(ctx context.Context, where ent.FileWhereInput) (int, error)

func (*File) DeleteManyTx

func (s *File) DeleteManyTx(ctx context.Context, tx *ent.Tx, where ent.FileWhereInput) (int, error)

func (*File) DeleteTx

func (s *File) DeleteTx(ctx context.Context, tx *ent.Tx, where ent.FileWhereUniqueInput) (*ent.File, error)

func (*File) Get

func (s *File) Get(ctx context.Context, where *ent.FileWhereInput, orderBy *ent.FileOrder, skip *int, first *int, last *int) ([]*ent.File, error)

func (*File) GetOne

func (s *File) GetOne(ctx context.Context, where ent.FileWhereUniqueInput) (*ent.File, error)

func (*File) GetOneTx

func (s *File) GetOneTx(ctx context.Context, tx *ent.Tx, where ent.FileWhereUniqueInput) (*ent.File, error)

func (*File) GetTx

func (s *File) GetTx(ctx context.Context, tx *ent.Tx, where *ent.FileWhereInput, orderBy *ent.FileOrder, skip *int, first *int, last *int) ([]*ent.File, error)

func (*File) Update

func (s *File) Update(ctx context.Context, where ent.FileWhereUniqueInput, data ent.UpdateFileInput) (*ent.File, error)

func (*File) UpdateMany

func (s *File) UpdateMany(ctx context.Context, where ent.FileWhereInput, data ent.UpdateFileInput) (int, error)

func (*File) UpdateManyTx

func (s *File) UpdateManyTx(ctx context.Context, tx *ent.Tx, where ent.FileWhereInput, data ent.UpdateFileInput) (int, error)

func (*File) UpdateTx

func (s *File) UpdateTx(ctx context.Context, tx *ent.Tx, where ent.FileWhereUniqueInput, data ent.UpdateFileInput) (*ent.File, error)

func (*File) Upsert

func (s *File) Upsert(ctx context.Context, data ent.CreateFileInput) (*ent.File, error)

func (*File) UpsertMany

func (s *File) UpsertMany(ctx context.Context, data []ent.CreateFileInput) (int, error)

func (*File) UpsertManyTx

func (s *File) UpsertManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateFileInput) (int, error)

func (*File) UpsertTx

func (s *File) UpsertTx(ctx context.Context, tx *ent.Tx, data ent.CreateFileInput) (*ent.File, error)

type FileManager

type FileManager interface {
	Save(ctx context.Context, fileId string) (*ent.File, error)
	Get(ctx context.Context, fileId string) (*ent.File, error)
}

type Permission

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

func NewPermission

func NewPermission(r *repo.Repository) *Permission

func (*Permission) Connection

func (s *Permission) Connection(ctx context.Context, where *ent.PermissionWhereInput, orderBy *ent.PermissionOrder, skip *int, first *int, last *int) (*ent.PermissionConnection, error)

func (*Permission) Create

func (*Permission) CreateMany

func (s *Permission) CreateMany(ctx context.Context, data []ent.CreatePermissionInput) ([]*ent.Permission, error)

func (*Permission) CreateManyTx

func (s *Permission) CreateManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreatePermissionInput) ([]*ent.Permission, error)

func (*Permission) CreateTx

func (s *Permission) CreateTx(ctx context.Context, tx *ent.Tx, data ent.CreatePermissionInput) (*ent.Permission, error)

func (*Permission) Delete

func (*Permission) DeleteMany

func (s *Permission) DeleteMany(ctx context.Context, where ent.PermissionWhereInput) (int, error)

func (*Permission) DeleteManyTx

func (s *Permission) DeleteManyTx(ctx context.Context, tx *ent.Tx, where ent.PermissionWhereInput) (int, error)

func (*Permission) DeleteTx

func (s *Permission) DeleteTx(ctx context.Context, tx *ent.Tx, where ent.PermissionWhereUniqueInput) (*ent.Permission, error)

func (*Permission) Get

func (s *Permission) Get(ctx context.Context, where *ent.PermissionWhereInput, orderBy *ent.PermissionOrder, skip *int, first *int, last *int) ([]*ent.Permission, error)

func (*Permission) GetOne

func (*Permission) GetOneTx

func (s *Permission) GetOneTx(ctx context.Context, tx *ent.Tx, where ent.PermissionWhereUniqueInput) (*ent.Permission, error)

func (*Permission) GetTx

func (s *Permission) GetTx(ctx context.Context, tx *ent.Tx, where *ent.PermissionWhereInput, orderBy *ent.PermissionOrder, skip *int, first *int, last *int) ([]*ent.Permission, error)

func (*Permission) Update

func (*Permission) UpdateMany

func (*Permission) UpdateManyTx

func (s *Permission) UpdateManyTx(ctx context.Context, tx *ent.Tx, where ent.PermissionWhereInput, data ent.UpdatePermissionInput) (int, error)

func (*Permission) UpdateTx

func (*Permission) Upsert

func (*Permission) UpsertMany

func (s *Permission) UpsertMany(ctx context.Context, data []ent.CreatePermissionInput) (int, error)

func (*Permission) UpsertManyTx

func (s *Permission) UpsertManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreatePermissionInput) (int, error)

func (*Permission) UpsertTx

func (s *Permission) UpsertTx(ctx context.Context, tx *ent.Tx, data ent.CreatePermissionInput) (*ent.Permission, error)

type Role

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

func NewRole

func NewRole(r *repo.Repository) *Role

func (*Role) Connection

func (s *Role) Connection(ctx context.Context, where *ent.RoleWhereInput, orderBy *ent.RoleOrder, skip *int, first *int, last *int) (*ent.RoleConnection, error)

func (*Role) Create

func (s *Role) Create(ctx context.Context, data ent.CreateRoleInput) (*ent.Role, error)

func (*Role) CreateMany

func (s *Role) CreateMany(ctx context.Context, data []ent.CreateRoleInput) ([]*ent.Role, error)

func (*Role) CreateManyTx

func (s *Role) CreateManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateRoleInput) ([]*ent.Role, error)

func (*Role) CreateTx

func (s *Role) CreateTx(ctx context.Context, tx *ent.Tx, data ent.CreateRoleInput) (*ent.Role, error)

func (*Role) Delete

func (s *Role) Delete(ctx context.Context, where ent.RoleWhereUniqueInput) (*ent.Role, error)

func (*Role) DeleteMany

func (s *Role) DeleteMany(ctx context.Context, where ent.RoleWhereInput) (int, error)

func (*Role) DeleteManyTx

func (s *Role) DeleteManyTx(ctx context.Context, tx *ent.Tx, where ent.RoleWhereInput) (int, error)

func (*Role) DeleteTx

func (s *Role) DeleteTx(ctx context.Context, tx *ent.Tx, where ent.RoleWhereUniqueInput) (*ent.Role, error)

func (*Role) Get

func (s *Role) Get(ctx context.Context, where *ent.RoleWhereInput, orderBy *ent.RoleOrder, skip *int, first *int, last *int) ([]*ent.Role, error)

func (*Role) GetOne

func (s *Role) GetOne(ctx context.Context, where ent.RoleWhereUniqueInput) (*ent.Role, error)

func (*Role) GetOneTx

func (s *Role) GetOneTx(ctx context.Context, tx *ent.Tx, where ent.RoleWhereUniqueInput) (*ent.Role, error)

func (*Role) GetTx

func (s *Role) GetTx(ctx context.Context, tx *ent.Tx, where *ent.RoleWhereInput, orderBy *ent.RoleOrder, skip *int, first *int, last *int) ([]*ent.Role, error)

func (*Role) Update

func (s *Role) Update(ctx context.Context, where ent.RoleWhereUniqueInput, data ent.UpdateRoleInput) (*ent.Role, error)

func (*Role) UpdateMany

func (s *Role) UpdateMany(ctx context.Context, where ent.RoleWhereInput, data ent.UpdateRoleInput) (int, error)

func (*Role) UpdateManyTx

func (s *Role) UpdateManyTx(ctx context.Context, tx *ent.Tx, where ent.RoleWhereInput, data ent.UpdateRoleInput) (int, error)

func (*Role) UpdateTx

func (s *Role) UpdateTx(ctx context.Context, tx *ent.Tx, where ent.RoleWhereUniqueInput, data ent.UpdateRoleInput) (*ent.Role, error)

func (*Role) Upsert

func (s *Role) Upsert(ctx context.Context, data ent.CreateRoleInput) (*ent.Role, error)

func (*Role) UpsertMany

func (s *Role) UpsertMany(ctx context.Context, data []ent.CreateRoleInput) (int, error)

func (*Role) UpsertManyTx

func (s *Role) UpsertManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateRoleInput) (int, error)

func (*Role) UpsertTx

func (s *Role) UpsertTx(ctx context.Context, tx *ent.Tx, data ent.CreateRoleInput) (*ent.Role, error)

type SchemaManager

type SchemaManager interface {
	WriteEntityToSchema(entityTemplateData generator.EntityTemplateData) error
	RemoveEntityFromSchema(fileName string) error
	BackupSchema() error
	Generate(ctx context.Context, entities []entity.Entity) error
	RevertSchema() error
}

type Service

type Service struct {
	// Node                  svc.Node
	Entity     *Entity
	Permission svc.Permission
	Role       svc.Role
	User       svc.User
	AdminUser  svc.AdminUser
	File       svc.File
}

func New

func New(repository *repo.Repository, schemaManager generator.SchemaManager) *Service

type User

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

func NewUser

func NewUser(r *repo.Repository) *User

func (*User) Connection

func (s *User) Connection(ctx context.Context, where *ent.UserWhereInput, orderBy *ent.UserOrder, skip *int, first *int, last *int) (*ent.UserConnection, error)

func (*User) Create

func (s *User) Create(ctx context.Context, data ent.CreateUserInput) (*ent.User, error)

func (*User) CreateMany

func (s *User) CreateMany(ctx context.Context, data []ent.CreateUserInput) ([]*ent.User, error)

func (*User) CreateManyTx

func (s *User) CreateManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateUserInput) ([]*ent.User, error)

func (*User) CreateTx

func (s *User) CreateTx(ctx context.Context, tx *ent.Tx, data ent.CreateUserInput) (*ent.User, error)

func (*User) Delete

func (s *User) Delete(ctx context.Context, where ent.UserWhereUniqueInput) (*ent.User, error)

func (*User) DeleteMany

func (s *User) DeleteMany(ctx context.Context, where ent.UserWhereInput) (int, error)

func (*User) DeleteManyTx

func (s *User) DeleteManyTx(ctx context.Context, tx *ent.Tx, where ent.UserWhereInput) (int, error)

func (*User) DeleteTx

func (s *User) DeleteTx(ctx context.Context, tx *ent.Tx, where ent.UserWhereUniqueInput) (*ent.User, error)

func (*User) Get

func (s *User) Get(ctx context.Context, where *ent.UserWhereInput, orderBy *ent.UserOrder, skip *int, first *int, last *int) ([]*ent.User, error)

func (*User) GetOne

func (s *User) GetOne(ctx context.Context, where ent.UserWhereUniqueInput) (*ent.User, error)

func (*User) GetOneTx

func (s *User) GetOneTx(ctx context.Context, tx *ent.Tx, where ent.UserWhereUniqueInput) (*ent.User, error)

func (*User) GetTx

func (s *User) GetTx(ctx context.Context, tx *ent.Tx, where *ent.UserWhereInput, orderBy *ent.UserOrder, skip *int, first *int, last *int) ([]*ent.User, error)

func (*User) Update

func (s *User) Update(ctx context.Context, where ent.UserWhereUniqueInput, data ent.UpdateUserInput) (*ent.User, error)

func (*User) UpdateMany

func (s *User) UpdateMany(ctx context.Context, where ent.UserWhereInput, data ent.UpdateUserInput) (int, error)

func (*User) UpdateManyTx

func (s *User) UpdateManyTx(ctx context.Context, tx *ent.Tx, where ent.UserWhereInput, data ent.UpdateUserInput) (int, error)

func (*User) UpdateTx

func (s *User) UpdateTx(ctx context.Context, tx *ent.Tx, where ent.UserWhereUniqueInput, data ent.UpdateUserInput) (*ent.User, error)

func (*User) Upsert

func (s *User) Upsert(ctx context.Context, data ent.CreateUserInput) (*ent.User, error)

func (*User) UpsertMany

func (s *User) UpsertMany(ctx context.Context, data []ent.CreateUserInput) (int, error)

func (*User) UpsertManyTx

func (s *User) UpsertManyTx(ctx context.Context, tx *ent.Tx, data []ent.CreateUserInput) (int, error)

func (*User) UpsertTx

func (s *User) UpsertTx(ctx context.Context, tx *ent.Tx, data ent.CreateUserInput) (*ent.User, error)

Jump to

Keyboard shortcuts

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