domain

package
v0.0.0-...-c3818ae Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URL

type URL struct {
	ID             interface{} `json:"-" bson:"_id,omitempty" db:"id"`
	UserID         interface{} `json:"-" bson:"user_id" db:"user_id"`
	Hash           string      `json:"hash" bson:"hash" db:"hash"`
	OriginalURL    string      `json:"original_url" bson:"original_url" db:"original_url" binding:"required"`
	CreationDate   time.Time   `json:"creation_date" bson:"creation_date" db:"creation_date"`
	ExpirationDate time.Time   `json:"expiration_date" bson:"expiration_date" db:"expiration_date"`
}

type URLRepository

type URLRepository interface {
	CreateURL(ctx context.Context, url URL) (interface{}, error)
	GetURLByHash(ctx context.Context, hash string) (URL, error)
}

type User

type User struct {
	ID       interface{} `json:"-" bson:"_id,omitempty" db:"id"`
	Name     string      `json:"name" bson:"name" db:"name" binding:"required"`
	Username string      `json:"username" bson:"username" db:"username" binding:"required"`
	Password string      `json:"password" bson:"password_hash" db:"password_hash" binding:"required"`
}

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, user User) (interface{}, error)
	Get(ctx context.Context, username, password string) (User, error)
	Update(ctx context.Context, user User) error
	Delete(ctx context.Context, username, password string) error
	UsernameExists(ctx context.Context, username string) (bool, error)
}

Jump to

Keyboard shortcuts

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