model

package
v0.0.0-...-70c7384 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound         = errors.New("not found")
	ErrIdentifierExists = errors.New("identifier already exists")
	ErrInvalidURL       = errors.New("invalid url")
	ErrUserIsNotMember  = errors.New("user is not member of the organization")
	ErrInvalidToken     = errors.New("invalid token")
)

Functions

This section is empty.

Types

type ShortenInput

type ShortenInput struct {
	RawURL     string
	Identifier Option[string]
	CreatedBy  string
}

type Shortening

type Shortening struct {
	Identifier  string    `json:"identifier"`
	CreatedBy   string    `json:"created_by"`
	OriginalURL string    `json:"original_url"`
	Visits      int64     `json:"visits"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type User

type User struct {
	IsActive    bool   `json:"is_verified,omitempty"`
	GitHubLogin string `json:"gh_login"`

	// TODO: should we store it in something like Vault?
	GitHubAccessKey string    `json:"gh_access_key,omitempty"`
	CreatedAt       time.Time `json:"created_at,omitempty"`
}

type UserClaims

type UserClaims struct {
	jwt.RegisteredClaims
	User `json:"user_data"`
}

Jump to

Keyboard shortcuts

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