model

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Story

type Story struct {
	ID        string
	Title     string
	Body      string
	ViewCount int64
	UpVotes   int64
	DownVotes int64
	CreatedAt time.Time
	UpdatedAt time.Time
}

TODO: FIELDS ARE EXPORTED FOR DATABASE OPERATIONS, FIND A WAY TO NOT EXPORT THEM

func (*Story) AddView

func (s *Story) AddView()

func (*Story) DownVote

func (s *Story) DownVote()

func (*Story) GetBody

func (s *Story) GetBody() string

func (*Story) GetCreatedAt

func (s *Story) GetCreatedAt() time.Time

func (*Story) GetDownVotes

func (s *Story) GetDownVotes() int64

func (*Story) GetID

func (s *Story) GetID() string

func (*Story) GetTitle

func (s *Story) GetTitle() string

func (*Story) GetUpVotes

func (s *Story) GetUpVotes() int64

func (*Story) GetUpdatedAt

func (s *Story) GetUpdatedAt() time.Time

func (*Story) GetViewCount

func (s *Story) GetViewCount() int64

func (*Story) UpVote

func (s *Story) UpVote()

type StoryBuilder

type StoryBuilder struct {
	// contains filtered or unexported fields
}

func NewStoryBuilder

func NewStoryBuilder() *StoryBuilder

func (*StoryBuilder) Build

func (b *StoryBuilder) Build() (*Story, error)

func (*StoryBuilder) SetBody

func (b *StoryBuilder) SetBody(maxLength int, body string) *StoryBuilder

func (*StoryBuilder) SetCreatedAt

func (b *StoryBuilder) SetCreatedAt(createdAt time.Time) *StoryBuilder

func (*StoryBuilder) SetDownVotes

func (b *StoryBuilder) SetDownVotes(downVotes int64) *StoryBuilder

func (*StoryBuilder) SetID

func (b *StoryBuilder) SetID(id string) *StoryBuilder

func (*StoryBuilder) SetTitle

func (b *StoryBuilder) SetTitle(maxLength int, title string) *StoryBuilder

func (*StoryBuilder) SetUpVotes

func (b *StoryBuilder) SetUpVotes(upVotes int64) *StoryBuilder

func (*StoryBuilder) SetUpdatedAt

func (b *StoryBuilder) SetUpdatedAt(updatedAt time.Time) *StoryBuilder

func (*StoryBuilder) SetViewCount

func (b *StoryBuilder) SetViewCount(viewCount int64) *StoryBuilder

Jump to

Keyboard shortcuts

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