core

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSessionParams

type CreateSessionParams struct {
	ID           uuid.UUID
	UserID       uuid.UUID
	AccessToken  string
	RefreshToken string
	UserDevice   UserDevice
}

type CreateUserParams

type CreateUserParams struct {
	ID             uuid.UUID
	FirstName      string
	LastName       string
	Phone          string
	Username       string
	Gender         string
	Email          string
	BirthDate      time.Time
	HashedPassword string
}

type GenerateTokenParam

type GenerateTokenParam struct {
	UserID    uuid.UUID
	SessionID uuid.UUID
	ClientIP  string
	UserAgent string
}

type SendNewSignInSessionParams

type SendNewSignInSessionParams struct {
	Name      string `json:"name"`
	Email     string `json:"email"`
	ClientIP  string `json:"client-ip"`
	UserAgent string `json:"user-agent"`
}

type Session

type Session struct {
	ID           uuid.UUID
	UserID       uuid.UUID
	AccessToken  string
	RefreshToken string
	UserDevice   UserDevice
	UpdatedAt    time.Time
	ExpiresAt    time.Time
}

type SetSessionIsBlockedParams

type SetSessionIsBlockedParams struct {
	ID        uuid.UUID
	IsBlocked bool
}

type TokenPayload

type TokenPayload struct {
	UserID    uuid.UUID
	SessionID uuid.UUID
	ClientIP  string
	UserAgent string
	IssuedAt  time.Time
	ExpiresAt time.Time
}

func (TokenPayload) MarshalBinary

func (t TokenPayload) MarshalBinary() ([]byte, error)

func (TokenPayload) UnmarshalBinary

func (t TokenPayload) UnmarshalBinary(data []byte) error

type UpdateSessionTokenParams

type UpdateSessionTokenParams struct {
	ID           uuid.UUID
	AccessToken  string
	RefreshToken string
}

type User

type User struct {
	ID              uuid.UUID
	FirstName       string
	LastName        string
	Phone           string
	Username        string
	Gender          string
	Email           string
	HashedPassword  string
	IsEmailVerified bool
	IsPhoneVerified bool
	CreatedAt       time.Time
}

type UserDevice

type UserDevice struct {
	UserAgent string
	ClientIP  string
}

Jump to

Keyboard shortcuts

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