dto

package
v0.0.0-...-4468c4e Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OAuthInvalidRequest              = "invalid_request"
	OAuthInvalidClient               = "invalid_client"
	OAuthInvalidGrant                = "invalid_grant"
	OAuthInvalidScope                = "invalid_scope"
	OAuthUnauthorizedClient          = "unauthorized_client"
	OAuthInvalidUnsupportedGrantType = "unsupported_grant_type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	// HTTP status code
	//
	// required: true
	Code int `json:"code"`

	// HTTP error body
	//
	// required: true
	Error interface{} `json:"error"`
}

HTTPError represents HTTP error data. swagger:model HTTPError

type HTTPResponse

type HTTPResponse struct {
	// HTTP status code
	//
	// required: true
	Code int `json:"code"`

	// HTTP response body
	//
	// required: true
	Data interface{} `json:"data"`

	// Pagination data
	Pagination interface{} `json:"pagination,omitempty"`
}

HTTPResponse represents HTTP response data. swagger:model HTTPResponse

type JWTClaims

type JWTClaims struct {
	ID        uuid.UUID `json:"sub,omitempty"`
	ExpiresAt int64     `json:"exp,omitempty"`
	IssuedAt  int64     `json:"iat,omitempty"`
}

JWTClaims represents JWT token claim.

func (JWTClaims) Valid

func (c JWTClaims) Valid() (err error)

Valid validates JWTClaims.

type OAuthError

type OAuthError struct {
	// OAuth error code
	//
	// required: true
	// example: invalid_request
	Error string `json:"error"`

	// OAuth error description
	ErrorDescription string `json:"error_description,omitempty"`

	// OAuth error URI
	ErrorURI string `json:"error_uri,omitempty"`
}

OAuthError represents oauth error. swagger:model OAuthError

type OAuthResponse

type OAuthResponse struct {
	// JWT Access Token
	//
	// required: true
	// example: eyJhbGciOiJSUz...dAlCslnO3YqiCA
	AccessToken string `json:"access_token"`

	// JWT Token Type
	//
	// required: true
	// example: Bearer
	TokenType string `json:"token_type"`

	// JWT Token Expires In
	//
	// required: true
	// example: 3600
	ExpiresIn int64 `json:"expires_in"`
}

OAuthResponse represents JWT token data. swagger:model OAuthResponse

type UserAccount

type UserAccount struct {
	// User ID
	//
	// required: true
	// swagger:strfmt uuid
	ID uuid.UUID `json:"id" binding:"required"`

	// User creation date and time
	//
	// required: true
	CreatedAt time.Time `json:"createdAt" binding:"required"`

	// User update date and time
	//
	// required: true
	UpdatedAt time.Time `json:"updatedAt" binding:"required"`

	// Username
	//
	// required: true
	// example: j_doe
	Username string `json:"username" binding:"required"`

	// User First Name
	//
	// required: true
	// example: John
	FirstName string `json:"firstName" binding:"required"`

	// User Last Name
	//
	// required: true
	// example: Doe
	LastName string `json:"lastName" binding:"required"`

	// User Email
	//
	// required: true
	// example: j_doe@dup.man
	Email string `json:"email" binding:"required"`
}

UserAccount represents user accounts data. swagger:model UserAccount

type UserLogin

type UserLogin struct {
	GrantType    string `form:"grant_type"`
	Username     string `form:"username" binding:"required"`
	Password     string `form:"password" binding:"required"`
	Scope        string `form:"scope"`
	ClientID     string `form:"client_id"`
	ClientSecret string `form:"client_secret"`
}

UserLogin represents user login payload.

type UserRegister

type UserRegister struct {
	// Username
	//
	// required: true
	// example: j_doe@dup.man
	Username string `json:"username" binding:"required,unique_username"`

	// User First Name
	//
	// required: true
	// example: John
	FirstName string `json:"firstName" binding:"required"`

	// User Last Name
	//
	// required: true
	// example: Doe
	LastName string `json:"lastName" binding:"required"`

	// User Email
	//
	// required: true
	// example: j_doe@dup.man
	Email string `json:"email" binding:"required,email,unique_email"`

	// User password
	//
	// required: true
	// example: pa$$w0rd
	// minimum: 8
	Password string `json:"password" binding:"required,min=8"`
}

UserRegister represents registration login payload. swagger:model UserRegister

type WebsiteOnCreate

type WebsiteOnCreate struct {
	// Website URL
	//
	// required: true
	// example: https://example.com
	URL string `json:"url" binding:"required,url"`

	// Website security Token
	//
	// required: true
	// example: h^djncU878*jKCN&87I#DK
	Token string `json:"token" binding:"required"`
}

WebsiteOnCreate represents website creation payload. swagger:model WebsiteOnCreate

type WebsiteOnResponse

type WebsiteOnResponse struct {
	// Website ID
	//
	// required: true
	// swagger:strfmt uuid
	ID uuid.UUID `json:"id" binding:"required"`

	// Website creation date and time
	//
	// required: true
	CreatedAt time.Time `json:"createdAt" binding:"required"`

	// Website update date and time
	//
	// required: true
	UpdatedAt time.Time `json:"updatedAt" binding:"required"`

	// Website URL
	//
	// required: true
	// example: https://example.com
	URL string `json:"url" binding:"required"`
}

WebsiteOnResponse represents website response payload. swagger:model WebsiteOnResponse

type WebsiteOnSystemResponse

type WebsiteOnSystemResponse struct {
	// Website ID
	//
	// required: true
	// swagger:strfmt uuid
	ID uuid.UUID `json:"id" binding:"required"`

	// Website URL
	//
	// required: true
	// example: https://example.com
	URL string `json:"url" binding:"required"`

	// Website Token
	//
	// required: true
	// example: gwadadad1p...1Pjshdjw==
	Token string `json:"token" binding:"required"`
}

WebsiteOnSystemResponse represents website response payload for the system route. swagger:model WebsiteOnSystemResponse

type WebsitesOnResponse

type WebsitesOnResponse []WebsiteOnResponse

WebsitesOnResponse represents multiple WebsiteOnResponse-s. swagger:model WebsitesOnResponse

type WebsitesOnSystemResponse

type WebsitesOnSystemResponse []WebsiteOnSystemResponse

WebsitesOnSystemResponse represents multiple WebsiteOnSystemResponse-s. swagger:model WebsitesOnSystemResponse

Jump to

Keyboard shortcuts

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