alias

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAliasAlreadyExists = errors.New("alias already exists")
View Source
var ErrAliasNotFound = errors.New("alias not found")

Functions

This section is empty.

Types

type Alias

type Alias struct {
	ID        int    `json:"id"`
	ContentID int    `json:"contentId"`
	Alias     string `json:"alias"`
}

type Repository

type Repository interface {
	Create(ctx context.Context, a *Alias) error
	DeleteByContentID(ctx context.Context, contentID int) error
	FindByAlias(ctx context.Context, alias string) (*Alias, error)
	FindByContentID(ctx context.Context, contentID int) ([]*Alias, error)
	FindAll(ctx context.Context) ([]*Alias, error)
}

type Service

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

func NewService

func NewService(repo Repository) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, contentID int, aliasStr string) error

func (*Service) DeleteByContentID

func (s *Service) DeleteByContentID(ctx context.Context, contentID int) error

func (*Service) FindAll

func (s *Service) FindAll(ctx context.Context) ([]*Alias, error)

func (*Service) FindByAlias

func (s *Service) FindByAlias(ctx context.Context, aliasStr string) (*Alias, error)

func (*Service) FindByContentID

func (s *Service) FindByContentID(ctx context.Context, contentID int) ([]*Alias, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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