offerdb

package
v0.0.0-...-657eea0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Mongo_Client *mongo.Client

Functions

func FindAllOffersByFlowId

func FindAllOffersByFlowId(ctx context.Context, flow_id string) (*[]Offer, error)

func FindAllPartners

func FindAllPartners(ctx context.Context) (*[]Partner, error)

func GetEnv

func GetEnv(key string) string

func InsertOneOffer

func InsertOneOffer(ctx context.Context, offer *Offer) error

func NewClient

func NewClient(ctx context.Context) (*mongo.Client, error)

func UpdateOnePartner

func UpdateOnePartner(ctx context.Context, partner *Partner) error

Types

type Offer

type Offer struct {
	Id         primitive.ObjectID `bson:"_id,omitempty"`
	Flow_Id    string             `bson:"flow_id,omitempty"`
	Partner_Id string             `bson:"partner_id,omitempty"`
	Amount     int32              `bson:"amount,omitempty"`
}

type Partner

type Partner struct {
	Id     primitive.ObjectID `bson:"_id,omitempty"`
	Name   string             `bson:"name,omitempty"`
	Rating float32            `bson:"rating,omitempty"`
	Orders int32              `bson:"orders,omitempty"`
}

func FindPartnerById

func FindPartnerById(ctx context.Context, id primitive.ObjectID) (*Partner, error)

Jump to

Keyboard shortcuts

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