Documentation ¶
Index ¶
- func AuthenticateNonReaders(username string, password string, jwt string, role string) model.User
- func AuthenticateReaders(username string, password string) model.User
- func CheckIfBucketExist(s3sc *s3.S3, bucketName string) bool
- func CloseClientDB()
- func ConnectToMongo() *mongo.Client
- func CreateAWSSession() *session.Session
- func CreateArticle(input *model.CreateArticleInfo) (*model.Article, error)
- func CreateDefaultAdmin()
- func CreateDocument(index string, data string, uuid string, userName string, password string)
- func CreateProject(input *model.CreateProjectInput) (*model.Project, error)
- func CreateProjectBucket(s3sc *s3.S3, bucketName string)
- func CreateUser(input *model.UserCreation) (*model.User, error)
- func CreateZincUser(username string, password string, email string)
- func Decode(s string) []byte
- func Decrypt(textToDecrypt string) (string, error)
- func DeleteAllProjectsBuckets(username string)
- func DeleteAllUsers(jwt string) (string, error)
- func DeleteArticle(bucket *model.DeleteBucketInfo) (string, error)
- func DeleteArticleFolder(s3sc *s3.S3, iterator s3manager.BatchDeleteIterator, bucketName string) error
- func DeleteArticles(input *model.DeleteAllArticlesInput) (string, error)
- func DeleteBucket(s3sc *s3.S3, bucketName string)
- func DeleteDocument(index string, data string, uuid string, userName string, password string)
- func DeleteIndex(index string, username string, password string)
- func DeleteProject(input *model.DeleteProjectType) (string, error)
- func DeleteProjects(input *model.DeleteAllProjects) (string, error)
- func DeleteUser(input *model.DeleteUser) (string, error)
- func DeleteZincUser(uuid string, zincUsername string, zincPassword string)
- func EncodeToBase64(b []byte) string
- func Encrypt(textToEncrypt string) (string, error)
- func FetchArticles(input *model.ArticlesPrivate) (*model.Articles, error)
- func FetchArticlesZinc(input *model.GetZincArticleInput) (*model.Articles, error)
- func FetchUsers(jwt string) (*model.Users, error)
- func FindArticle(input *model.FindArticlePrivateType) (*model.Article, error)
- func FindArticlePublic(input *model.FindArticlePublicType) (*model.Article, error)
- func GalleryFindImages(jwt string) (*model.GalleryImages, error)
- func GetProjects(input *model.GetProjectType) (*model.Projects, error)
- func Info(message string)
- func JWTValidityCheck(jwtToken string) (string, error)
- func Login(username string, password string) (*model.LoginData, error)
- func Logout(jwt string) (string, error)
- func MarshalBinary(userData map[string]string) ([]byte, error)
- func ProcessImages(storage map[string]any) bytes.Buffer
- func RedisClientInstation() *redis.Client
- func RedisUserInfo(jwt string, redisClient *redis.Client) map[string]string
- func SearchDocuments(indexName string, searchTerm string, userName string, password string, ...) []byte
- func SearchResults(query string, zincBaseUrl string, userName string, password string, ...) []byte
- func UpdateArticle(input *model.UpdatedArticleInfo) (*model.Article, error)
- func UpdateDocument(index string, data string, userName string, password string, uuid string)
- func UploadArticleImages(input *model.UploadArticleImageInput) (string, error)
- func UploadAvatarImageCreation(input *model.UserCreation) string
- func UploadFileToS3(input *model.CreateArticleInfo, zincpassword string) string
- func UploadImageArticle(information map[string]any, jwt string) string
- func UploadImageDB(image model.Image, url string, jwt string, uuid string) (model.Image, error)
- func UploadUpdatedFileToS3(input *model.UpdatedArticleInfo, zincpassword string) string
- func ZincLogin(uuid string) (string, string)
- type ArticleJson
- type Total
- type UserData
- type Zinc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateNonReaders ¶
@param - username @type - string
@param - password @type - string
@param - role @type - string @description - Role a user has
@rtype - model.User @description - Authenticates the user based off a non Reader role.
func AuthenticateReaders ¶
@param - email @type - string
@param - password @type - string @rtype - model.User @description - Authenticates only Reader users(examples include public facing sites)
func CloseClientDB ¶
func CloseClientDB()
func ConnectToMongo ¶
func CreateAWSSession ¶
Creates a reusable session for AWS S3 usage
func CreateArticle ¶
func CreateArticle(input *model.CreateArticleInfo) (*model.Article, error)
func CreateDefaultAdmin ¶
func CreateDefaultAdmin()
func CreateDocument ¶
func CreateProject ¶
func CreateProject(input *model.CreateProjectInput) (*model.Project, error)
Creates a AWS bucket given project paramaters
func CreateProjectBucket ¶
func CreateUser ¶
func CreateUser(input *model.UserCreation) (*model.User, error)
func CreateZincUser ¶
func DeleteAllProjectsBuckets ¶
func DeleteAllProjectsBuckets(username string)
Deletes all projects buckets tied to a specific user
func DeleteAllUsers ¶
func DeleteArticle ¶
func DeleteArticle(bucket *model.DeleteBucketInfo) (string, error)
func DeleteArticleFolder ¶
func DeleteArticleFolder(s3sc *s3.S3, iterator s3manager.BatchDeleteIterator, bucketName string) error
Deletes individual article folders within a user's project bucket
func DeleteArticles ¶
func DeleteArticles(input *model.DeleteAllArticlesInput) (string, error)
func DeleteBucket ¶
Deletes a bucket specified by bucketname
func DeleteDocument ¶
func DeleteIndex ¶
func DeleteProject ¶
func DeleteProject(input *model.DeleteProjectType) (string, error)
Delete a project and all its articles and assets.
func DeleteProjects ¶
func DeleteProjects(input *model.DeleteAllProjects) (string, error)
func DeleteUser ¶
func DeleteUser(input *model.DeleteUser) (string, error)
func DeleteZincUser ¶
func EncodeToBase64 ¶
func FetchArticles ¶
func FetchArticles(input *model.ArticlesPrivate) (*model.Articles, error)
func FetchArticlesZinc ¶
func FetchArticlesZinc(input *model.GetZincArticleInput) (*model.Articles, error)
func FindArticle ¶
func FindArticle(input *model.FindArticlePrivateType) (*model.Article, error)
func FindArticlePublic ¶
func FindArticlePublic(input *model.FindArticlePublicType) (*model.Article, error)
func GalleryFindImages ¶
func GalleryFindImages(jwt string) (*model.GalleryImages, error)
func GetProjects ¶
func GetProjects(input *model.GetProjectType) (*model.Projects, error)
func JWTValidityCheck ¶
@param - jwtToken @type - string
@rtype - string, err @description - Validates the JWT is properly signed within the CMS
func Login ¶
@param - email @type - string
@param - password @type - string @rtype - string, err @description - Authenticates the user, and returns a JWT.
func ProcessImages ¶
Takes in a map, and processes the image to be able to upload to AWS
func RedisClientInstation ¶
func SearchDocuments ¶
func SearchResults ¶
func UpdateArticle ¶
func UpdateArticle(input *model.UpdatedArticleInfo) (*model.Article, error)
func UpdateDocument ¶
func UploadArticleImages ¶
func UploadArticleImages(input *model.UploadArticleImageInput) (string, error)
func UploadAvatarImageCreation ¶
func UploadAvatarImageCreation(input *model.UserCreation) string
func UploadFileToS3 ¶
func UploadFileToS3(input *model.CreateArticleInfo, zincpassword string) string
func UploadImageDB ¶
func UploadUpdatedFileToS3 ¶
func UploadUpdatedFileToS3(input *model.UpdatedArticleInfo, zincpassword string) string
Types ¶
type ArticleJson ¶
type Zinc ¶
type Zinc struct { Took int `json:"took"` TimedOut bool `json:"timed_out"` Shards struct { Total int `json:"total"` Successful int `json:"successful"` Skipped int `json:"skipped"` Failed int `json:"failed"` } `json:"_shards"` Hits struct { Total struct { Value int `json:"value"` } `json:"total"` MaxScore float64 `json:"max_score"` Hits []struct { Index string `json:"_index"` Type string `json:"_type"` ID string `json:"_id"` Score float64 `json:"_score"` Timestamp time.Time `json:"@timestamp"` Source struct { ContentData string `json:"ContentData"` DateWritten time.Time `json:"DateWritten"` Description string `json:"Description"` Project string `json:"Project"` Tags string `json:"Tags"` Title string `json:"Title"` TitleCard string `json:"TitleCard"` UUID string `json:"UUID"` URL string `json:"Url"` Username string `json:"Username"` Name string `json:"Name"` ProfilePicture string `json:"ProfilePicture"` } `json:"_source"` } `json:"hits"` } `json:"hits"` }