katalogfilm

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmbilSatuFilm

func AmbilSatuFilm(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func AmbilSatuKomentar added in v1.0.1

func AmbilSatuKomentar(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func AmbilSatuRating added in v1.0.2

func AmbilSatuRating(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func AmbilSemuaFilm

func AmbilSemuaFilm(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func AmbilSemuaKomentar added in v1.0.1

func AmbilSemuaKomentar(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func AmbilSemuaRating added in v1.0.2

func AmbilSemuaRating(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func AmbilSemuaUser

func AmbilSemuaUser(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func Authorization

func Authorization(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func DecodeGetName

func DecodeGetName(publickey string, tokenstring string) string

func DecodeGetRole

func DecodeGetRole(publickey string, tokenstring string) string

func DecodeGetUsername

func DecodeGetUsername(publickey string, tokenstring string) string

func DeleteFilm

func DeleteFilm(mconn *mongo.Database, collname string, datafilm Film) interface{}

func DeleteKomentar added in v1.0.1

func DeleteKomentar(mconn *mongo.Database, collname string, datakomentar Komentar) interface{}

func DeleteRating added in v1.0.2

func DeleteRating(mconn *mongo.Database, collname string, datarating Rating) interface{}

func DeleteUser

func DeleteUser(mconn *mongo.Database, collname string, userdata User) interface{}

func EditFilm

func EditFilm(mconn *mongo.Database, collname string, datafilm Film) interface{}

func EditKomentar added in v1.0.1

func EditKomentar(mconn *mongo.Database, collname string, datakomentar Komentar) interface{}

func EditRating added in v1.0.2

func EditRating(mconn *mongo.Database, collname string, datarating Rating) interface{}

func EditUser

func EditUser(mconn *mongo.Database, collname string, datauser User) interface{}

func Encode

func Encode(name, username, role, privatekey string) (string, error)

func GenerateKey

func GenerateKey() (privatekey, publickey string)

func HapusFilm

func HapusFilm(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func HapusKomentar added in v1.0.1

func HapusKomentar(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func HapusRating added in v1.0.2

func HapusRating(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func HapusUser

func HapusUser(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func HashPassword

func HashPassword(password string) (string, error)

func IdFilmExists added in v1.0.1

func IdFilmExists(mongoenvkatalogfilm, dbname string, datafilm Film) bool

func IdKomentarExists added in v1.0.1

func IdKomentarExists(mongoenvkatalogfilm, dbname string, datakomentar Komentar) bool

func IdRatingExists added in v1.0.2

func IdRatingExists(mongoenvkatalogfilm, dbname string, datarating Rating) bool

func InsertFilm

func InsertFilm(mconn *mongo.Database, collname string, datafilm Film) interface{}

func InsertKomentar added in v1.0.1

func InsertKomentar(mconn *mongo.Database, collname string, datakomentar Komentar) interface{}

func InsertRating added in v1.0.2

func InsertRating(mconn *mongo.Database, collname string, datarating Rating) interface{}

func InsertUser

func InsertUser(mconn *mongo.Database, collname string, datauser User) interface{}

func IsPasswordValid

func IsPasswordValid(mconn *mongo.Database, collname string, userdata User) bool

func Login

func Login(privatekeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func RatingFilmExists added in v1.0.2

func RatingFilmExists(mongoenvkatalogfilm, dbname string, datarating Rating) bool

func Registrasi

func Registrasi(mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func ReturnStruct

func ReturnStruct(DataStuct any) string

func SetConnection

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

func TambahFilm

func TambahFilm(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func TambahKomentar added in v1.0.1

func TambahKomentar(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func TambahRating added in v1.0.2

func TambahRating(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func UpdateFilm

func UpdateFilm(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func UpdateKomentar added in v1.0.1

func UpdateKomentar(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func UpdateRating added in v1.0.2

func UpdateRating(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func UpdateUser

func UpdateUser(publickeykatalogfilm, mongoenvkatalogfilm, dbname, collname string, r *http.Request) string

func UsernameExists added in v1.0.1

func UsernameExists(mongoenvkatalogfilm, dbname string, userdata User) bool

Types

type CredentialUser

type CredentialUser struct {
	Status bool `json:"status" bson:"status"`
	Data   struct {
		Name     string `json:"name" bson:"name"`
		Username string `json:"username" bson:"username"`
		Role     string `json:"role" bson:"role"`
	} `json:"data" bson:"data"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
}

type Film

type Film struct {
	ID        string `json:"id" bson:"id"`
	Judul     string `json:"judul" bson:"judul"`
	Image     string `json:"image" bson:"image"`
	Tanggal   string `json:"tanggal" bson:"tanggal"`
	Genre     string `json:"genre" bson:"genre"`
	Sinopsis  string `json:"sinopsis" bson:"sinopsis"`
	Penulis   string `json:"penulis" bson:"penulis"`
	Sutradara string `json:"sutradara" bson:"sutradara"`
	Aktor     string `json:"aktor" bson:"aktor"`
}

func FindFilm

func FindFilm(mconn *mongo.Database, collname string, datafilm Film) Film

func GetAllFilm

func GetAllFilm(mconn *mongo.Database, collname string) []Film

type Komentar

type Komentar struct {
	ID       string `json:"id" bson:"id"`
	ID_Film  string `json:"id_film" bson:"id_film"`
	Name     string `json:"name" bson:"name"`
	Tanggal  string `json:"tanggal" bson:"tanggal"`
	Komentar string `json:"komentar" bson:"komentar"`
}

func FindKomentar added in v1.0.1

func FindKomentar(mconn *mongo.Database, collname string, datakomentar Komentar) Komentar

func GetAllKomentar added in v1.0.1

func GetAllKomentar(mconn *mongo.Database, collname string) []Komentar

type Payload

type Payload struct {
	Name     string    `json:"name"`
	Username string    `json:"username"`
	Role     string    `json:"role"`
	Exp      time.Time `json:"exp"`
	Iat      time.Time `json:"iat"`
	Nbf      time.Time `json:"nbf"`
}

func Decode

func Decode(publickey, tokenstr string) (payload Payload, err error)

type Pesan

type Pesan struct {
	Status  bool        `json:"status" bson:"status"`
	Message string      `json:"message" bson:"message"`
	Data    interface{} `json:"data,omitempty" bson:"data,omitempty"`
	Role    string      `json:"role,omitempty" bson:"role,omitempty"`
	Token   string      `json:"token,omitempty" bson:"token,omitempty"`
}

type Rating

type Rating struct {
	ID       string `json:"id" bson:"id"`
	ID_Film  string `json:"id_film" bson:"id_film"`
	Username string `json:"username" bson:"username"`
	Rating   int    `json:"rating" bson:"rating"`
	Kualitas string `json:"kualitas" bson:"kualitas"`
	Note     string `json:"note" bson:"note"`
	Tanggal  string `json:"tanggal" bson:"tanggal"`
}

func FindRating added in v1.0.2

func FindRating(mconn *mongo.Database, collname string, datarating Rating) Rating

func GetAllRating added in v1.0.2

func GetAllRating(mconn *mongo.Database, collname string) []Rating

type User

type User struct {
	Name     string `json:"name" bson:"name"`
	Username string `json:"username" bson:"username"`
	Password string `json:"password" bson:"password"`
	Role     string `json:"role" bson:"role"`
}

func FindUser

func FindUser(mconn *mongo.Database, collname string, userdata User) User

func GetAllUser

func GetAllUser(mconn *mongo.Database, collname string) []User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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