Documentation ¶
Index ¶
- Constants
- Variables
- func ConverterParam(context echo.Context, param string) int
- func GetErrorValidator(c echo.Context, err error, tag string) (int, error)
- func ValidateAlpha(fullname string, min, max int) error
- func ValidateAlphanum(username string, min, max int) error
- func ValidateEmail(email string, min, max int) error
- func ValidateError(errorTag, errorString string) string
- func ValidateID(num int) error
- func ValidateString(strings string, min, max int) error
- func ValidateURI[T int64 | int](context echo.Context, URIparam string) (T, error)
- type BasicResponse
- type CommentPostResp
- type CreateAccountsResponse
- type CreatePostResponse
- type CreateUserResponse
- type FollowResponse
- type GetPostResponses
- type H
- type Handler
- type HandlerService
- type Helper
- type LikePostResp
- type OwnerGetAccountResponse
- type PublicAccountResp
- type PublicAccountResponse
- type QouteRetweetPostResp
- type QueueResponse
- type RetweetPostResp
- type RetweetResponse
Constants ¶
View Source
const ( AuthRefresh = "RefreshToken" AuthHeaderkey = "authorization" AuthTypeBearer = "bearer" AuthPayload = "authorization_payload" )
View Source
const ( Like = "like" Unlike = "unlike" Retweet = "retweet" Unretweet = "unretweet" Comment = "comment" Qretweet = "qoute-retweet" Unqretweet = "unqoute-retweet(Delete)" Posttag = "post" Accountag = "account" )
Variables ¶
View Source
var ( AlphaNumCheck = regexp.MustCompile(`^[a-zA-Z0-9_\s]+$`).MatchString AlphaCheck = regexp.MustCompile(`^[a-zA-Z_\s]+$`).MatchString NumCheckByte = regexp.MustCompile(`^[0-9]+$`).Match NumCheck = regexp.MustCompile(`^[0-9]+$`).MatchString StringsCheck = regexp.MustCompile(`^[a-zA-Z0-9_\s'"?!,.&%$@-]+$`).MatchString )
A for Allow
Functions ¶
func ConverterParam ¶
func ValidateAlpha ¶
func ValidateAlphanum ¶
func ValidateEmail ¶
func ValidateError ¶
func ValidateID ¶
func ValidateString ¶
Types ¶
type BasicResponse ¶
type BasicResponse map[string]interface{}
type CommentPostResp ¶
type CreateAccountsResponse ¶
type CreateAccountsResponse struct { ID int64 `json:"id"` Owner string `json:"owner"` AccountType bool `json:"is_private"` Follower int64 `json:"follower"` Following int64 `json:"following"` CreatedAt int64 `json:"created_at"` PhototDir string `json:"photo_dir"` }
func AccountResponse ¶
func AccountResponse(input db2.Account) CreateAccountsResponse
type CreatePostResponse ¶
type CreatePostResponse struct { ID uuid.UUID `json:"post_id"` PictureDescription string `json:"picture_description"` PostFeature postfeatureresponse `json:"post_feature"` IsRetweet bool `json:"is_retweet"` CreatedAt int64 `json:"created_at"` }
func PostResponse ¶
func PostResponse(input db2.Post, input2 db2.PostFeature) CreatePostResponse
func PostResponsePointer ¶
func PostResponsePointer(input *db2.Post, input2 db2.PostFeature) CreatePostResponse
type CreateUserResponse ¶
type CreateUserResponse struct { Username string `json:"username"` FullName string `json:"full_name"` Email string `json:"email"` Account CreateAccountsResponse `json:"account"` CreatedAt int64 `json:"created_at"` }
func CreateUserResponses ¶
func CreateUserResponses(input db2.User, input2 CreateAccountsResponse) CreateUserResponse
func UserResponse ¶
func UserResponse(input db2.User, account db2.Account) CreateUserResponse
type FollowResponse ¶
type FollowResponse struct { Follow accountfollowresp `json:"follow_info"` FromAccount CreateAccountsResponse `json:"from_account"` ToAccount CreateAccountsResponse `json:"to_account"` }
type GetPostResponses ¶
type GetPostResponses struct { ID uuid.UUID `json:"id"` PictureDescription string `json:"picture_description"` PostFeature db2.PostFeature `json:"post_feature"` PostComment []commentresp `json:"post_comment"` CreatedAt int64 `json:"created_at"` }
func GetPostResponse ¶
func GetPostResponse(input db2.Post, input2 db2.PostFeature, comment []db2.ListCommentRow) GetPostResponses
type HandlerService ¶
type HandlerService interface { Helper }
func NewHandler ¶
func NewHandler(store db.PostgresStore, gcpClient gcp.GCPService, redis redis.Store, config util.Config, token token.Maker, apiutil apiutil.UtilTools) HandlerService
type LikePostResp ¶
type OwnerGetAccountResponse ¶
type OwnerGetAccountResponse struct { Account db2.Account `json:"account"` QueueAccount []QueueResponse `json:"queue"` }
func OwnerAccountResponse ¶
func OwnerAccountResponse(Account db2.Account, Queue ...db2.ListQueueRow) OwnerGetAccountResponse
type PublicAccountResp ¶
type PublicAccountResp struct { Accounts []PublicAccountResponse `json:"accounts"` PageInfo map[string]interface{} `json:"page_info"` }
func FuncPublicAccountsResp ¶
func FuncPublicAccountsResp(input []db2.Account, pageInfo map[string]interface{}) PublicAccountResp
type PublicAccountResponse ¶
type PublicAccountResponse struct { ID int64 `json:"id"` Owner string `json:"owner"` AccountType bool `json:"is_private"` Follower int64 `json:"follower"` Following int64 `json:"following"` CreatedAt int64 `json:"created_at"` PhotoDir string `json:"photo_dir"` }
func FuncPublicAccountResponse ¶
func FuncPublicAccountResponse(input []db2.Account) []PublicAccountResponse
type QouteRetweetPostResp ¶
type QouteRetweetPostResp struct { Qoute string `json:"qoute"` PostFeature CreatePostResponse `json:"post_feature"` RetweetAt int64 `json:"retweet_at"` }
type QueueResponse ¶
type RetweetPostResp ¶
type RetweetPostResp struct { PostID uuid.UUID `json:"id"` Postfeature CreatePostResponse `json:"post_feature"` RetweetAt int64 `json:"retweet_at"` }
type RetweetResponse ¶
type RetweetResponse struct { Post db2.Post Feature db2.PostFeature }
Click to show internal directories.
Click to hide internal directories.