server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 13 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: 1.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, 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"`
	ProfileStats ProfileStats `json:"profileStats"`
	Stats        []StatsItem  `json:"stats"`
}

GetPostResponse ... swagger:model

type ListPostsResponse

type ListPostsResponse struct {
	Posts []*Post `json:"posts"`
	// ProfileStats contains profiles stats.
	ProfileStats map[string]ProfileStats `json:"profileStats"`
	// 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"`
	Slug          string                `json:"slug"`
	LikeWeight    *community.LikeWeight `json:"likeWeight,omitempty"`
	CreatedAt     uint64                `json:"createdAt"`
}

Post ...

type ProfileStats added in v1.0.0

type ProfileStats struct {
	PostsCount uint16      `json:"postsCount"`
	Stats      []StatsItem `json:"stats"`
}

ProfileStats ...

type SharePost added in v1.1.0

type SharePost struct {
	UUID  string `json:"uuid"`
	Owner string `json:"owner"`
	Title string `json:"title"`
}

SharePost ... swagger:model

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