brunogrp

package
v0.0.0-...-0653a19 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bet

type Bet struct {
	ID             string    `json:"id"`
	Status         string    `json:"status"`
	Players        []Player  `json:"players"`
	Moderator      string    `json:"moderator"`
	Description    string    `json:"description"`
	Terms          string    `json:"terms"`
	ExpirationDate time.Time `json:"expirationDate"`
	Amount         int       `json:"amount"`
}

Bet struct type

type Handlers

type Handlers struct {
	Bet bet.Core
}

Handlers manages the set of user endpoints.

func (*Handlers) Create

func (h *Handlers) Create(ctx context.Context, w http.ResponseWriter, r *http.Request) error

Create creates a bet and returns its ID.

func (*Handlers) ModSignBet

func (h *Handlers) ModSignBet(ctx context.Context, w http.ResponseWriter, r *http.Request) error

ModSignBet handles the mod signing. Returns the httpStatusCode

func (*Handlers) PersonSignBet

func (h *Handlers) PersonSignBet(ctx context.Context, w http.ResponseWriter, r *http.Request) error

PersonSignBet handles the users signing. Returns the httpStatusCode

func (*Handlers) Query

Query returns a list of bets with paging.

func (*Handlers) QueryByID

func (h *Handlers) QueryByID(ctx context.Context, w http.ResponseWriter, r *http.Request) error

QueryByID returns a bet by its ID.

func (*Handlers) SetWinner

func (h *Handlers) SetWinner(ctx context.Context, w http.ResponseWriter, r *http.Request) error

SetWinner handles a moderator request to set a winner. Takes the betId, the winner address, and the signature of the mod. Returns the httpStatusCode

type Player

type Player struct {
	Address string `json:"address"`
	Signed  bool   `json:"signed"`
}

Jump to

Keyboard shortcuts

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