database

package
v0.0.0-...-278fcb3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateApplication

func CreateApplication(meta_id string, description string, post_id primitive.ObjectID)

Types

type Application

type Application struct {
	ID           primitive.ObjectID `bson:"_id" json:"_id"`
	Author       string             `bson:"author" json:"author"`
	AuthorMetaID string             `bson:"meta_id" json:"meta_id"`
	PostID       primitive.ObjectID `bson:"post_id" json:"post_id"`
	Description  string             `bson:"description" json:"description"`
}

func GetApplications

func GetApplications(post_id primitive.ObjectID) []Application

type Post

type Post struct {
	ID           primitive.ObjectID `bson:"_id" json:"_id"`
	Author       string             `bson:"author" json:"author"`
	AuthorMetaID string             `bson:"meta_id" json:"meta_id"`
	Title        string             `bson:"title" json:"title"`
	Description  string             `bson:"description" json:"description"`
	Deadline     time.Time          `bson:"deadline" json:"deadline"`
	Bounty       float64            `bson:"bounty" json:"bounty"`
}

func CreateBounty

func CreateBounty(meta_id string, bounty float64, title string, description string, deadline time.Time) Post

func GetBounties

func GetBounties() []Post

type User

type User struct {
	ID         primitive.ObjectID `bson:"_id" json:"_id"`
	MetaMaskID string             `bson:"meta_id" json:"meta_id"`
	Name       string             `bson:"name" json:"name"`
}

func CreateUser

func CreateUser(meta_id string, name string) User

func GetUser

func GetUser(meta_id string) (User, error)

Jump to

Keyboard shortcuts

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