contract

package
v0.0.0-...-221af98 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Data    interface{} `json:"data,omitempty"`
	Error   *Error      `json:"error,omitempty"`
	Success bool        `json:"success"`
}

func NewFailureResponse

func NewFailureResponse(description string) APIResponse

func NewSuccessResponse

func NewSuccessResponse(data interface{}) APIResponse

type AddStoryRequest

type AddStoryRequest struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

type AddStoryResponse

type AddStoryResponse struct {
	Success bool `json:"success"`
}

type DeleteStoryRequest

type DeleteStoryRequest struct {
	StoryID string `json:"story_id"`
}

type DeleteStoryResponse

type DeleteStoryResponse struct {
	Success bool `json:"success"`
}

type Error

type Error struct {
	Message string `json:"message,omitempty"`
}

type GetStoryRequest

type GetStoryRequest struct {
	StoryID string `json:"story_id"`
}

type GetStoryResponse

type GetStoryResponse struct {
	Story Story `json:"story"`
}

type MostViewedStoriesRequest

type MostViewedStoriesRequest struct {
	OffSet int `json:"off_set"`
	Limit  int `json:"limit"`
}

type MostViewedStoriesResponse

type MostViewedStoriesResponse struct {
	Stories []Story `json:"stories"`
}

type Story

type Story struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	Body      string `json:"body"`
	ViewCount int64  `json:"view_count"`
	UpVotes   int64  `json:"up_votes"`
	DownVotes int64  `json:"down_votes"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

type TopRatedStoriesRequest

type TopRatedStoriesRequest struct {
	OffSet int `json:"off_set"`
	Limit  int `json:"limit"`
}

type TopRatedStoriesResponse

type TopRatedStoriesResponse struct {
	Stories []Story `json:"stories"`
}

type UpdateStoryRequest

type UpdateStoryRequest struct {
	Story Story `json:"story"`
}

type UpdateStoryResponse

type UpdateStoryResponse struct {
	Success bool `json:"success"`
}

Jump to

Keyboard shortcuts

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