server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package server Theseus

The Theseus is an off-chain service which provides access to community entities (posts, likes, follows)

Schemes: https
BasePath: /v1
Version: 0.0.1

Produces:
- application/json
Consumes:
- application/json

swagger:meta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRouter

func SetupRouter(s storage.Storage, r chi.Router)

SetupRouter setups handlers to chi router.

Types

type Error

type Error struct {
	Error string `json:"error"`
}

Error ... swagger:model

type ListPostsResponse

type ListPostsResponse struct {
	Posts []Post `json:"posts"`
	// Profiles dictionary where key is an address and value is a profile.
	Profiles map[string]Profile `json:"profiles"`
	// Posts' statistics dictionary where key is a full form ID (owner/uuid) and value is statistics
	Stats map[string]Stats `json:"stats"`
}

ListPostsResponse ... swagger:model

type Post

type Post struct {
	UUID         string             `json:"uuid"`
	Owner        string             `json:"owner"`
	Title        string             `json:"title"`
	Category     community.Category `json:"category"`
	PreviewImage string             `json:"preview_image"`
	Text         string             `json:"text"`
	Likes        uint32             `json:"likes"`
	Dislikes     uint32             `json:"dislikes"`
	PDV          int64              `json:"pdv"`
	CreatedAt    uint64             `json:"created_at"`
}

Post ...

type Profile

type Profile struct {
	Address   string `json:"address"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Avatar    string `json:"avatar"`
	Gender    string `json:"gender"`
	Birthday  string `json:"birthday"`
	CreatedAt uint64 `json:"created_at"`
}

Profile ...

type Stats

type Stats map[string]int64

Stats ... Key is RFC3999 date, value is uPDV.

Jump to

Keyboard shortcuts

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