Documentation ¶
Index ¶
- func HashPassword(password string) ([]byte, error)
- func ValidateEmail(email string) string
- func ValidateUser(user *UserDTO) string
- func VerifyPassword(hashedPassword string, userPassword string) error
- type AccessDetail
- type Frequency
- type Login
- type Notify
- type Package
- type PackageVersion
- type Repo
- type RepoDTO
- type RepoIDRequest
- type RepoUrlRequest
- type Response
- type SignUp
- type SubToken
- type Subscriber
- type SubscriberDTO
- type SubscriberIDRequest
- type SubscriberRequest
- type Token
- type TokenDetails
- type TokenResponse
- type User
- type UserDTO
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
func ValidateUser ¶
Validates user's [name, password, email]
func VerifyPassword ¶
Types ¶
type AccessDetail ¶
User by session db that is authorize user's session
type Package ¶
type Package struct { Name string `json:"name" bson:"name"` Version PackageVersion `json:"version" bson:"version"` File string `json:"file" bson:"file"` IsOutdated bool `json:"isOutdated" bson:"isOutdated"` }
type PackageVersion ¶
type Repo ¶
type Repo struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` UserID primitive.ObjectID `json:"userID" bson:"userID"` Name string `json:"name" bson:"name"` Owner string `json:"owner" bson:"owner"` Path string `json:"path" bson:"path"` Provider string `json:"provider" bson:"provider"` PackageList []*Package `json:"packageList, omitempty" bson:"packageList,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` }
type RepoDTO ¶
type RepoDTO struct { ID *string `json:"id,omitempty"` UserID string `json:"userID"` Name string `json:"name"` Owner string `json:"owner"` Path string `json:"path"` Provider string `json:"provider"` PackageList []*Package `json:"packageList, omitempty"` }
func ToRepoDTOs ¶
type RepoIDRequest ¶
type RepoIDRequest struct {
ID string `json:"id"`
}
type RepoUrlRequest ¶
type RepoUrlRequest struct {
Url string `json:"url"`
}
type Response ¶
type Response struct { Message string `json:"message"` Status int `json:"status"` Data interface{} `json:"data"` }
func ToResponse ¶
type SubToken ¶
type SubToken struct { Token string Uuid string Expires int64 SubID string RepoID string Email string }
Public Token that is consumed by confirmation mail and update notify preferences
type Subscriber ¶
type Subscriber struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id,omitempty"` RepoID primitive.ObjectID `json:"repoID" bson:"repoID"` Email string `json:"email" bson:"email"` IsConfirmed bool `json:"isConfirmed" bson:"isConfirmed"` Notify *Notify `json:"notify,omitempty" bson:"notify,omitempty"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` }
func ToSubscriber ¶
func ToSubscriber(subscribeDTO *SubscriberDTO) *Subscriber
type SubscriberDTO ¶
type SubscriberDTO struct { ID *string `json:"id,omitempty"` RepoID string `json:"repoID"` Email string `json:"email"` IsConfirmed bool `json:"isConfirmed"` Notify *Notify `json:"notify,omitempty"` }
func ToSubscriberDTO ¶
func ToSubscriberDTO(subscriber *Subscriber) *SubscriberDTO
func ToSubscriberDTOs ¶
func ToSubscriberDTOs(subscribers []*Subscriber) []*SubscriberDTO
type SubscriberIDRequest ¶
type SubscriberIDRequest struct {
ID string `json:"id"`
}
type SubscriberRequest ¶
type TokenDetails ¶
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` }
func TokenDetailsToResponse ¶
func TokenDetailsToResponse(details *TokenDetails) *TokenResponse
type User ¶
type User struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` Name string `json:"name" bson:"name"` Email string `json:"email" bson:"email"` IsConfirmed bool `json:"isConfirmed" bson:"isConfirmed"` Password string `json:"password" bson:"password"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` }
type UserDTO ¶
type UserDTO struct { ID string `json:"id"` Name string `json:"name"` IsConfirmed bool `json:"isConfirmed"` Email string `json:"email"` Password string `json:"password"` }
func AuthToUserDTO ¶
type UserResponse ¶
type UserResponse struct { Name string `json:"name" bson:"name"` Email string `json:"email" bson:"email"` }
func ToUserResponse ¶
func ToUserResponse(user *UserDTO) *UserResponse
Click to show internal directories.
Click to hide internal directories.