role

package
v0.0.0-...-1bf48be Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRoleInput

type CreateRoleInput struct {
	Name string `json:"name"`
}

func (*CreateRoleInput) Role

func (cu *CreateRoleInput) Role() *Role

type Role

type Role struct {
	Id   int
	Name string
}

type RoleHandler

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

func NewRoleHandler

func NewRoleHandler(roleService *RoleService) *RoleHandler

func (*RoleHandler) Create

func (uh *RoleHandler) Create(w http.ResponseWriter, r *http.Request)

func (*RoleHandler) Delete

func (uh *RoleHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*RoleHandler) GetMany

func (uh *RoleHandler) GetMany(w http.ResponseWriter, r *http.Request)

func (*RoleHandler) GetOne

func (uh *RoleHandler) GetOne(w http.ResponseWriter, r *http.Request)

func (*RoleHandler) Update

func (uh *RoleHandler) Update(w http.ResponseWriter, r *http.Request)

type RoleOutput

type RoleOutput struct {
	Id   int    `json:"id,string"`
	Name string `json:"name"`
}

func NewRoleOutput

func NewRoleOutput(role *Role) *RoleOutput

type RoleRepository

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

func NewRoleRepository

func NewRoleRepository(dbPath string) *RoleRepository

func (*RoleRepository) Create

func (rr *RoleRepository) Create(ctx context.Context, role *Role) (*Role, error)

func (*RoleRepository) Delete

func (rr *RoleRepository) Delete(ctx context.Context, id int) error

func (*RoleRepository) GetMany

func (rr *RoleRepository) GetMany(ctx context.Context) ([]*Role, error)

func (*RoleRepository) GetManyById

func (rr *RoleRepository) GetManyById(ctx context.Context, ids []int) ([]*Role, error)

func (*RoleRepository) GetOne

func (rr *RoleRepository) GetOne(ctx context.Context, id int) (*Role, error)

func (*RoleRepository) Update

func (rr *RoleRepository) Update(ctx context.Context, role *Role) (*Role, error)

type RoleService

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

func NewRoleService

func NewRoleService(repo *RoleRepository) *RoleService

func (*RoleService) Create

func (rs *RoleService) Create(ctx context.Context, role *Role) (*Role, error)

func (*RoleService) Delete

func (rs *RoleService) Delete(ctx context.Context, id int) error

func (*RoleService) GetMany

func (rs *RoleService) GetMany(ctx context.Context) ([]*Role, error)

func (*RoleService) GetManyById

func (rs *RoleService) GetManyById(ctx context.Context, ids []int) ([]*Role, error)

func (*RoleService) GetOne

func (rs *RoleService) GetOne(ctx context.Context, id int) (*Role, error)

func (*RoleService) Update

func (rs *RoleService) Update(ctx context.Context, role *Role) (*Role, error)

type UpdateRoleInput

type UpdateRoleInput struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

func (*UpdateRoleInput) Role

func (cu *UpdateRoleInput) Role() *Role

Jump to

Keyboard shortcuts

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