rest

package
v0.0.0-...-39a0b88 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(log *logrus.Logger, service Service, key *rsa.PublicKey, host, version string) chi.Router

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	UUID string `json:"uuid"`
}

type JSONResponse

type JSONResponse struct {
	Data  interface{} `json:"data,omitempty"`
	Meta  *Meta       `json:"meta,omitempty"`
	Error *string     `json:"error,omitempty"`
	Code  *int        `json:"code,omitempty"`
}

type Meta

type Meta struct {
	Count int `json:"count"`
}

type Service

type Service interface {
	SaveConfig(ctx context.Context, config *models.Config) error
	GetConfig(ctx context.Context, uuid string) (*models.Config, error)
	GetRegions(ctx context.Context) ([]*models.Region, error)
	Like(ctx context.Context, uuid, targetUUID string, super bool) error
	Dislike(ctx context.Context, uuid, targetUUID string) error
	ListLikedProfiles(ctx context.Context, uuid string, limit, offset int64) ([]*models.Profile, error)
	ListDislikedProfiles(ctx context.Context, uuid string, limit, offset int64) ([]*models.Profile, error)
	GetMatches(ctx context.Context, uuid string, count int64) ([]*models.Profile, error)
	GetDialog(ctx context.Context, client, target string) *chat.Hub
	GetAllChats(ctx context.Context, uuid string) ([]*models.Profile, error)
}

Jump to

Keyboard shortcuts

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