app

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound   = errors.New("not found")
	ErrBadRequest = errors.New("bad request")
)

Functions

This section is empty.

Types

type AdminServiceInterface added in v0.6.0

type AdminServiceInterface interface {
	// SavePURL saves a PURL for the given domain name.
	//
	// ErrBadRequest is returned if any parameter is invalid or the domain
	// does not exist.
	SavePURL(domain *models.Domain, name, target string) error

	// CreateDomain creates a new domain.
	//
	// ErrBadRequest is returned if the domain already exists.
	CreateDomain(domain string) (*models.Domain, error)

	// GetDomain returns the domain with the given name.
	//
	// ErrNotFound is returned if the domain does not exist.
	GetDomain(name string) (*models.Domain, error)
}

type ResolveServiceInterface added in v0.6.0

type ResolveServiceInterface interface {
	// Resolve tries to resolve a PURL based on the domain and purl name.
	//
	// ErrNotFound is returned if nothing was found.
	Resolve(domain, name string) (string, error)
}

type ServiceInterface

type ServiceInterface interface {
	AdminServiceInterface
	ResolveServiceInterface
}

func NewService added in v0.6.0

func NewService(db *gorm.DB) ServiceInterface

type UserService added in v0.7.0

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

func NewUserService added in v0.7.0

func NewUserService(db *gorm.DB) *UserService

func (*UserService) CreateUser added in v0.7.0

func (s *UserService) CreateUser(email string) (*models.User, error)

func (*UserService) CreateUserKey added in v0.7.0

func (s *UserService) CreateUserKey(user *models.User) (*models.UserKey, error)

func (*UserService) GetUser added in v0.7.0

func (s *UserService) GetUser(email string) (*models.User, error)

func (*UserService) GetUserByKey added in v0.7.0

func (s *UserService) GetUserByKey(key string) (*models.User, error)

func (*UserService) GetUserKey added in v0.7.0

func (s *UserService) GetUserKey(value string) (*models.UserKey, error)

type UserServiceInterface added in v0.7.0

type UserServiceInterface interface {
	CreateUser(email string) (*models.User, error)
	GetUser(email string) (*models.User, error)
	GetUserByKey(key string) (*models.User, error)

	CreateUserKey(user *models.User) (*models.UserKey, error)
	GetUserKey(value string) (*models.UserKey, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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