Documentation ¶
Index ¶
- func RecordsFromQuote(q *Quote) (*Record, []*Record)
- type AFS
- type AFSFile
- type AWSAttrVal
- type AWSAttrValMap
- type AWSConditionBuilder
- type AWSConfig
- type AWSDynamoDB
- type AWSGetItemInput
- type AWSQueryInput
- type AWSSTSCreds
- type AWSSession
- type DBAV
- type DBBatchGetIn
- type DBBatchGetOut
- type DBExpr
- type DBGetIn
- type DBGetOut
- type DBIFace
- type DBQueryIn
- type DBQueryOut
- type DBTxWrIn
- type DBTxWrItem
- type DBTxWrOut
- type GetBatch
- type MultiQuoteRes
- func (m *MultiQuoteRes) Error() string
- func (m *MultiQuoteRes) JSON() []byte
- func (m *MultiQuoteRes) MarshalZerologObject(e *ZLEvent)
- func (m *MultiQuoteRes) WithErr(e error) *MultiQuoteRes
- func (m *MultiQuoteRes) WithNext(r *Record) *MultiQuoteRes
- func (m *MultiQuoteRes) WithQuotes(q []*Quote) *MultiQuoteRes
- type Quote
- type QuoteRes
- type Record
- type ZLEvent
- type ZLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecordsFromQuote ¶
RecordsFromQuote creates a quotes record metadata from the given quote
Types ¶
type AWSConditionBuilder ¶
type AWSConditionBuilder = expression.ConditionBuilder
AWSConditionBuilder ...
type GetBatch ¶
type GetBatch struct { Name string `validate:"regexp=^(author|topic)$"` Value string `validate:"min=3,max=20,regexp=^[a-zA-Z0-9 ]*$"` Start *Record }
GetBatch represents the client request for a batch of quotes with attribute
func NewGetBatch ¶
func NewGetBatch() *GetBatch
type MultiQuoteRes ¶
MultiQuoteRes forms the json response containing multiple quotes
func NewMultiQuoteRes ¶
func NewMultiQuoteRes() *MultiQuoteRes
NewMultiQuoteRes returns a new MultiQuoteRes
func (*MultiQuoteRes) Error ¶
func (m *MultiQuoteRes) Error() string
Error returns the string representation of the QuoteRes error field
func (*MultiQuoteRes) JSON ¶
func (m *MultiQuoteRes) JSON() []byte
JSON return a byte slice containing the JSON representation of the MultiQuoteRes
func (*MultiQuoteRes) MarshalZerologObject ¶
func (m *MultiQuoteRes) MarshalZerologObject(e *ZLEvent)
MarshalZerologObject logs the given object to zerolog
func (*MultiQuoteRes) WithErr ¶
func (m *MultiQuoteRes) WithErr(e error) *MultiQuoteRes
WithErr inserts an error into the MultiQuoteRes
func (*MultiQuoteRes) WithNext ¶
func (m *MultiQuoteRes) WithNext(r *Record) *MultiQuoteRes
WithNext inserts a next token into the MultiQuoteRes
func (*MultiQuoteRes) WithQuotes ¶
func (m *MultiQuoteRes) WithQuotes(q []*Quote) *MultiQuoteRes
WithQuotes inserts quotes into the MultiQuoteRes
type Quote ¶
type Quote struct { ID string `validate:"max=0"` Text string `validate:"min=5,max=100"` Author string `validate:"min=5,max=20,regexp=^[a-zA-Z ]*$"` Topics []string `validate:"max=5,topics" dynamodbav:",stringset"` }
Quote models an individual quote by an author, related to a set of topics
func (*Quote) GenerateID ¶
func (q *Quote) GenerateID()
GenerateID inserts an ID = SHA1(Author+Text) into the Quote
func (*Quote) WithAuthor ¶
WithAuthor inserts the given author into a Quote
func (*Quote) WithTopics ¶
WithTopics inserts the given topics into a Quote
type QuoteRes ¶
QuoteRes forms the json response containing a quote
func (*QuoteRes) MarshalZerologObject ¶
MarshalZerologObject logs the given object to zerolog
type Record ¶
type Record struct { Name string `validate:"min=3,max=20,regexp=^[a-zA-Z0-9 ]*$" json:"Name"` QuoteID string `validate:"min=3,max=20,regexp=^[a-zA-Z0-9 ]*$" json:"QuoteID"` }
Record models a piece of quote metadata and its relation to quotes
func (*Record) WithQuoteID ¶
WithQuoteID inserts a new quote id into the Record