Documentation ¶
Index ¶
- func Deserialize[T SerializableItem](dbField string, hint Hint) ([]T, error)
- func Parse[T SerializableItem](item string, hint Hint) (interface{}, bool)
- func Serialize[T SerializableItem](items []T) string
- type Country
- type Gender
- type Hint
- type InsertedPost
- type Platform
- type QueryCache
- type QueryItems
- type SerializableItem
- type Settings
- type SponsoredPost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
func Deserialize[T SerializableItem](dbField string, hint Hint) ([]T, error)
func Parse ¶
func Parse[T SerializableItem](item string, hint Hint) (interface{}, bool)
should I use generic? SerializableItem needs to be a concrete type however I am not too sure how to make it fit the requirement of both String()
func Serialize ¶
func Serialize[T SerializableItem](items []T) string
Types ¶
type InsertedPost ¶
type InsertedPost struct { ID int64 Post *SponsoredPost }
type QueryCache ¶
type QueryCache struct { Parameters string Items []QueryItems }
type QueryItems ¶
type SerializableItem ¶
type SerializableItem interface { // Platform | Gender | Country String() string }
type Settings ¶
type SponsoredPost ¶
type SponsoredPost struct { Title string `json:"title" validate:"required"` StartAt time.Time `json:"startAt" validate:"required,ltecsfield=EndAt"` EndAt time.Time `json:"endAt" validate:"required,gtecsfield=StartAt"` Conditions Settings `json:"conditions,omitempty" validate:"omitempty"` }
func (*SponsoredPost) Validate ¶
func (sp *SponsoredPost) Validate() error
Click to show internal directories.
Click to hide internal directories.