Documentation
¶
Index ¶
- type Story
- func (s *Story) AddView()
- func (s *Story) DownVote()
- func (s *Story) GetBody() string
- func (s *Story) GetCreatedAt() time.Time
- func (s *Story) GetDownVotes() int64
- func (s *Story) GetID() string
- func (s *Story) GetTitle() string
- func (s *Story) GetUpVotes() int64
- func (s *Story) GetUpdatedAt() time.Time
- func (s *Story) GetViewCount() int64
- func (s *Story) UpVote()
- type StoryBuilder
- func (b *StoryBuilder) Build() (*Story, error)
- func (b *StoryBuilder) SetBody(maxLength int, body string) *StoryBuilder
- func (b *StoryBuilder) SetCreatedAt(createdAt time.Time) *StoryBuilder
- func (b *StoryBuilder) SetDownVotes(downVotes int64) *StoryBuilder
- func (b *StoryBuilder) SetID(id string) *StoryBuilder
- func (b *StoryBuilder) SetTitle(maxLength int, title string) *StoryBuilder
- func (b *StoryBuilder) SetUpVotes(upVotes int64) *StoryBuilder
- func (b *StoryBuilder) SetUpdatedAt(updatedAt time.Time) *StoryBuilder
- func (b *StoryBuilder) SetViewCount(viewCount int64) *StoryBuilder
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) GetCreatedAt ¶
func (*Story) GetDownVotes ¶
func (*Story) GetUpVotes ¶
func (*Story) GetUpdatedAt ¶
func (*Story) GetViewCount ¶
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
Click to show internal directories.
Click to hide internal directories.