server

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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.9

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, timeout time.Duration)

SetupRouter setups handlers to chi router.

Types

type DecentrStats added in v0.0.14

type DecentrStats struct {
	ADV float64 `json:"adv"`
	DDV float64 `json:"ddv"`
}

DecentrStats ... swagger:model

type GetPostResponse added in v0.0.3

type GetPostResponse struct {
	Post    Post        `json:"post"`
	Profile *Profile    `json:"profile"`
	Stats   []StatsItem `json:"stats"`
}

GetPostResponse ... 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][]StatsItem `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:"previewImage"`
	Text          string                `json:"text"`
	LikesCount    uint32                `json:"likesCount"`
	DislikesCount uint32                `json:"dislikesCount"`
	PDV           float64               `json:"pdv"`
	LikeWeight    *community.LikeWeight `json:"likeWeight,omitempty"`
	CreatedAt     uint64                `json:"createdAt"`
}

Post ...

type Profile

type Profile struct {
	Address      string `json:"address"`
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	Bio          string `json:"bio"`
	Avatar       string `json:"avatar"`
	Gender       string `json:"gender"`
	Birthday     string `json:"birthday"`
	RegisteredAt uint64 `json:"registeredAt"`

	PostsCount uint16 `json:"postsCount"`
}

Profile ...

type StatsItem added in v0.0.6

type StatsItem struct {
	Date  string  `json:"date"`
	Value float64 `json:"value"`
}

StatsItem ... Key is RFC3999 date, value is PDV.

Jump to

Keyboard shortcuts

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