peda

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 19 Imported by: 0

README

Pedabaru

Repo Backend Punya Adam.

go get -u all
go mod tidy
git tag                                 #check current version
git tag v1.0.0                          #set tag version
git push origin v1.0.0                  #push tag version to repo
GOPROXY=proxy.golang.org go list -m example.com/mymodule@v0.1.0
go get example.com/mymodule@v0.1.0
go list -m example.com/mymodule@v0.1.0   #publish to pkg dev, replace ORG/URL with your repo URL

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateUserAndGenerateToken

func AuthenticateUserAndGenerateToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) (string, error)

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CreateComment

func CreateComment(mongoconn *mongo.Database, collection string, commentdata Comment) interface{}

func CreateLogin

func CreateLogin(mongoconn *mongo.Database, collection string, userdata User) interface{}

create login using Private

func CreateNewBlog

func CreateNewBlog(mongoconn *mongo.Database, collection string, blogdata Blog) interface{}

func CreateNewContent

func CreateNewContent(mongoconn *mongo.Database, collection string, contentdata Content) interface{}

content

func CreateNewProduct

func CreateNewProduct(mongoconn *mongo.Database, collection string, productdata Product) interface{}

func CreateNewUserRole

func CreateNewUserRole(mongoconn *mongo.Database, collection string, userdata User) interface{}
func GetAllUser(mongoconn *mongo.Database, collection string) []User {
	user := atdb.GetAllDoc[[]User](mongoconn, collection)
	return user
}

func CreateUser

func CreateUser(mongoconn *mongo.Database, collection string, userdata User) interface{}

func CreateUserAndAddToken

func CreateUserAndAddToken(privateKeyEnv string, mongoconn *mongo.Database, collection string, userdata User) error

func CreateUserAndAddedToeken

func CreateUserAndAddedToeken(PASETOPRIVATEKEYENV string, mongoconn *mongo.Database, collection string, userdata User) interface{}

func DeleteComment

func DeleteComment(mongoconn *mongo.Database, collection string, commentdata Comment) interface{}

func DeleteContent

func DeleteContent(mongoconn *mongo.Database, collection string, contentdata Content) interface{}

func DeleteLinestring

func DeleteLinestring(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}

func DeleteUser

func DeleteUser(mongoconn *mongo.Database, collection string, userdata User) interface{}

func GCFCreateAccountAndToken

func GCFCreateAccountAndToken(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreateContent

func GCFCreateContent(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreateHandler

func GCFCreateHandler(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreateHandlerTokenPaseto

func GCFCreateHandlerTokenPaseto(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreateLineStringgg

func GCFCreateLineStringgg(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreateNewBlog

func GCFCreateNewBlog(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreatePolygone

func GCFCreatePolygone(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreatePolygonee

func GCFCreatePolygonee(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreatePostLineString

func GCFCreatePostLineString(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GCFCreatePostLineStringg

func GCFCreatePostLineStringg(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GCFCreateTokenAndSaveToDB

func GCFCreateTokenAndSaveToDB(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) (string, error)

func GCFCreteCommnet

func GCFCreteCommnet(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFCreteRegister

func GCFCreteRegister(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFDeleteHandler

func GCFDeleteHandler(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFDeleteHandlerContent

func GCFDeleteHandlerContent(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFDeleteLineString

func GCFDeleteLineString(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFDeletedCommnet

func GCFDeletedCommnet(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFFindBlogAllID

func GCFFindBlogAllID(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFFindContentAllID

func GCFFindContentAllID(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFFindUserByID

func GCFFindUserByID(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFFindUserByName

func GCFFindUserByName(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFGetAllBlog

func GCFGetAllBlog(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFGetAllComment

func GCFGetAllComment(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFGetAllContentBy

func GCFGetAllContentBy(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFGetAllProduct

func GCFGetAllProduct(MONGOCONNSTRINGENV, dbname, collectionname string) string

product

func GCFHandler

func GCFHandler(MONGOCONNSTRINGENV, dbname, collectionname string) string

func GCFLoginAfterCreate

func GCFLoginAfterCreate(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFLoginAfterCreatee

func GCFLoginAfterCreatee(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFLoginAfterCreateee

func GCFLoginAfterCreateee(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFLoginAfterCreateeee

func GCFLoginAfterCreateeee(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFLoginAfterCreater

func GCFLoginAfterCreater(MONGOCONNSTRINGENV, dbname, collectionname, privateKeyEnv string, r *http.Request) (string, error)

func GCFLoginTest

func GCFLoginTest(username, password, MONGOCONNSTRINGENV, dbname, collectionname string) bool

func GCFPoint

func GCFPoint(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFPostHandler

func GCFPostHandler(PASETOPRIVATEKEYENV, MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFReturnStruct

func GCFReturnStruct(DataStuct any) string

func GCFUpdateHandler

func GCFUpdateHandler(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFUpdateLinestring

func GCFUpdateLinestring(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFUpdatedContent

func GCFUpdatedContent(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GCFlineStingCreate

func GCFlineStingCreate(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GCFlineStingCreatea

func GCFlineStingCreatea(MONGOCONNSTRINGENV, dbname, collection string, r *http.Request) string

func GFCPostHandlerUser

func GFCPostHandlerUser(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GFCUpadatedCommnet

func GFCUpadatedCommnet(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) string

func GeoIntersects added in v1.0.1

func GeoIntersects(mongoconn *mongo.Database, long float64, lat float64) (namalokasi string)

func HashPassword

func HashPassword(password string) (string, error)

func InsertDataUserGCF

func InsertDataUserGCF(Mongoenv, dbname string, r *http.Request) string

func InsertOneDoc

func InsertOneDoc(db *mongo.Database, collection string, doc interface{}) (insertedID interface{})

func InsertUserdata

func InsertUserdata(MongoConn *mongo.Database, username, role, password string) (InsertedID interface{})

func IsPasswordValid

func IsPasswordValid(mongoconn *mongo.Database, collection string, userdata User) bool

func PostGeoIntersects added in v1.0.1

func PostGeoIntersects(w http.ResponseWriter, r *http.Request)

func PostLineString

func PostLineString(mongoconn *mongo.Database, collection string, commentdata GeoJsonLineString) interface{}

func PostLinestring

func PostLinestring(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) interface{}

func PostPoint

func PostPoint(mongoconn *mongo.Database, collection string, pointdata GeometryPoint) interface{}

func PostPolygone

func PostPolygone(mongoconn *mongo.Database, collection string, polygonedata GeoJsonPolygon) interface{}

func ReplaceContent

func ReplaceContent(mongoconn *mongo.Database, collection string, filter bson.M, contentdata Content) interface{}

func ReplaceOneDoc

func ReplaceOneDoc(mongoconn *mongo.Database, collection string, filter bson.M, userdata User) interface{}

func SetConnection

func SetConnection(MONGOCONNSTRINGENV, dbname string) *mongo.Database

func UpdatedComment

func UpdatedComment(mongoconn *mongo.Database, collection string, filter bson.M, commentdata Comment) interface{}

func UpdatedLinestring

func UpdatedLinestring(mongoconn *mongo.Database, collection string, filter bson.M, linestringdata GeoJsonLineString) interface{}

Types

type About

type About struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type Blog

type Blog struct {
	ID          int       `json:"id" bson:"id"`
	Title       string    `json:"title" bson:"title"`
	Tanggal     string    `json:"tanggal" bson:"tanggal"`
	Description string    `json:"judul" bson:"judul"`
	Content     []Content `json:"content" bson:"content"`
}

func GetAllBlogAll

func GetAllBlogAll(mongoconn *mongo.Database, collection string) []Blog

func GetIDBlog

func GetIDBlog(mongoconn *mongo.Database, collection string, blogdata Blog) Blog

type Category

type Category struct {
	Category []string `json:"category" bson:"category"`
}

type Comment

type Comment struct {
	ID        int    `json:"id" bson:"id"`
	Username  string `json:"username" bson:"username"`
	Answer    string `json:"comment" bson:"comment"`
	Questions string `json:"questions" bson:"questions"`
	Tanggal   string `json:"tanggal" bson:"tanggal"`
}

func GetAllComment

func GetAllComment(mongoconn *mongo.Database, collection string) []Comment

type Contack

type Contack struct {
	ID      int    `json:"id" bson:"id"`
	Name    string `json:"title" bson:"title"`
	Subject string `json:"description" bson:"description"`
	Message string `json:"image" bson:"image"`
	Email   string `json:"email" bson:"email"`
	Phone   string `json:"phone" bson:"phone"`
}

type Content

type Content struct {
	ID          int    `json:"id" bson:"id" `
	Content     string `json:"content" bson:"content"`
	Image       string `json:"image" bson:"image"`
	Description string `json:"description" bson:"description"`
}

func FindContentAllId

func FindContentAllId(mongoconn *mongo.Database, collection string, contentdata Content) Content

func GetAllContent

func GetAllContent(mongoconn *mongo.Database, collection string) []Content

type Credential

type Credential struct {
	Status  bool   `json:"status" bson:"status"`
	Token   string `json:"token,omitempty" bson:"token,omitempty"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
}

func GCFCreateProduct

func GCFCreateProduct(MONGOCONNSTRINGENV, dbname, collectionname string, r *http.Request) Credential

type Event

type Event struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Tanggal     string `json:"tanggal" bson:"tanggal"`
	Image       string `json:"image" bson:"image"`
	Harga       int    `json:"harga" bson:"harga"`
	LinkYoutube string `json:"linkyoutube" bson:"linkyoutube"`
}

type EventGlobal

type EventGlobal struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Tanggal     string `json:"tanggal" bson:"tanggal"`
	Image       string `json:"image" bson:"image"`
	Harga       int    `json:"harga" bson:"harga"`
}
type Gallery struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type GeoJson

type GeoJson struct {
	Type       string     `json:"type" bson:"type"`
	Properties Properties `json:"properties" bson:"properties"`
	Geometry   Geometry   `json:"geometry" bson:"geometry"`
}

func GetAllBangunanLineString

func GetAllBangunanLineString(mongoconn *mongo.Database, collection string) []GeoJson

type GeoJsonLineString

type GeoJsonLineString struct {
	Type       string             `json:"type" bson:"type"`
	Properties Properties         `json:"properties" bson:"properties"`
	Geometry   GeometryLineString `json:"geometry" bson:"geometry"`
}

func GetByCoordinate

func GetByCoordinate(mongoconn *mongo.Database, collection string, linestringdata GeoJsonLineString) GeoJsonLineString

type GeoJsonPolygon

type GeoJsonPolygon struct {
	Type       string          `json:"type" bson:"type"`
	Properties Properties      `json:"properties" bson:"properties"`
	Geometry   GeometryPolygon `json:"geometry" bson:"geometry"`
}

type Geometry

type Geometry struct {
	Coordinates interface{} `json:"coordinates" bson:"coordinates"`
	Type        string      `json:"type" bson:"type"`
}

type GeometryLineString

type GeometryLineString struct {
	Coordinates [][]float64 `json:"coordinates" bson:"coordinates"`
	Type        string      `json:"type" bson:"type"`
}

type GeometryPoint

type GeometryPoint struct {
	Coordinates []float64 `json:"coordinates" bson:"coordinates"`
	Type        string    `json:"type" bson:"type"`
}

type GeometryPolygon

type GeometryPolygon struct {
	Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
	Type        string        `json:"type" bson:"type"`
}

type Iklan

type Iklan struct {
	ID          int    `json:"id" bson:"id"`
	Title       string `json:"title" bson:"title"`
	Description string `json:"description" bson:"description"`
	Image       string `json:"image" bson:"image"`
}

type Lokasi added in v1.0.1

type Lokasi struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"`
	Properties Name               `bson:"properties,omitempty"`
	Geometry   Geometry           `bson:"geometry,omitempty"`
	Kategori   string             `bson:"kategori,omitempty"`
}

type LongLat added in v1.0.1

type LongLat struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type Name added in v1.0.1

type Name struct {
	Name string `bson:"name,omitempty"`
}

type Pesan added in v1.0.1

type Pesan struct {
	Status  bool   `json:"status" bson:"status"`
	Message string `json:"message" bson:"message"`
}

type Product

type Product struct {
	ID          primitive.ObjectID `bson:"_id,omitempty" `
	Nomorid     int                `json:"nomorid" bson:"nomorid"`
	Name        string             `json:"name" bson:"name"`
	Description string             `json:"description" bson:"description"`
	Price       int                `json:"price" bson:"price"`
	Stock       int                `json:"stock" bson:"stock"`
	Size        string             `json:"size" bson:"size"`
	Image       string             `json:"image" bson:"image"`
}

func GetAllProduct

func GetAllProduct(mongoconn *mongo.Database, collection string) []Product

type Properties

type Properties struct {
	Name string `json:"name" bson:"name"`
}

type Response

type Response struct {
	Status  bool        `json:"status" bson:"status"`
	Message string      `json:"message" bson:"message"`
	Data    interface{} `json:"data" bson:"data"`
}

func CreateResponse

func CreateResponse(status bool, message string, data interface{}) Response

type Share

type Share struct {
	Share []string `json:"share" bson:"share"`
}

type Tags

type Tags struct {
	Tags []string `json:"tags" bson:"tags"`
}

type User

type User struct {
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	Role     string `json:"role,omitempty" bson:"role,omitempty"`
	Token    string `json:"token,omitempty" bson:"token,omitempty"`
	Private  string `json:"private,omitempty" bson:"private,omitempty"`
	Publick  string `json:"publick,omitempty" bson:"publick,omitempty"`
}

func FindUser

func FindUser(mongoconn *mongo.Database, collection string, userdata User) User

func FindUserByUsername

func FindUserByUsername(mongoconn *mongo.Database, collection string, username string) (User, error)

func FindUserUser

func FindUserUser(mongoconn *mongo.Database, collection string, userdata User) User

func GetAllUser

func GetAllUser(mongoconn *mongo.Database, collection string) []User

func GetNameAndPassowrd

func GetNameAndPassowrd(mongoconn *mongo.Database, collection string) []User

Jump to

Keyboard shortcuts

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