Documentation ¶
Index ¶
- func Deflatten(data map[string]interface{}) map[string]interface{}
- func Flatten(data map[string][]interface{}) map[string]interface{}
- func IsType(typ Type) bool
- type FlatHelper
- func (m *FlatHelper) LocalityCountry() string
- func (m *FlatHelper) LocationHTML() template.HTML
- func (m *FlatHelper) Name() string
- func (m *FlatHelper) Photos() []map[string]interface{}
- func (m *FlatHelper) PostType() Type
- func (m *FlatHelper) String(prop string) string
- func (m *FlatHelper) Strings(prop string) []string
- func (m *FlatHelper) Sub(prop string) *FlatHelper
- func (m *FlatHelper) Type() string
- func (m *FlatHelper) TypeProperty() string
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FlatHelper ¶
type FlatHelper struct { Map typed.Typed Properties typed.Typed // contains filtered or unexported fields }
func NewFlatHelper ¶
func NewFlatHelper(data map[string]interface{}) *FlatHelper
func (*FlatHelper) LocalityCountry ¶
func (m *FlatHelper) LocalityCountry() string
func (*FlatHelper) LocationHTML ¶
func (m *FlatHelper) LocationHTML() template.HTML
func (*FlatHelper) Name ¶
func (m *FlatHelper) Name() string
func (*FlatHelper) Photos ¶
func (m *FlatHelper) Photos() []map[string]interface{}
func (*FlatHelper) PostType ¶
func (m *FlatHelper) PostType() Type
func (*FlatHelper) String ¶
func (m *FlatHelper) String(prop string) string
func (*FlatHelper) Strings ¶
func (m *FlatHelper) Strings(prop string) []string
func (*FlatHelper) Sub ¶
func (m *FlatHelper) Sub(prop string) *FlatHelper
func (*FlatHelper) Type ¶
func (m *FlatHelper) Type() string
func (*FlatHelper) TypeProperty ¶
func (m *FlatHelper) TypeProperty() string
type Type ¶
type Type string
Type represents a post type.
const ( TypeRsvp Type = "rsvp" TypeRepost Type = "repost" TypeLike Type = "like" TypeReply Type = "reply" TypeBookmark Type = "bookmark" TypeFollow Type = "follow" TypeRead Type = "read" TypeWatch Type = "watch" TypeListen Type = "listen" TypeCheckin Type = "checkin" TypeVideo Type = "video" TypeAudio Type = "audio" TypePhoto Type = "photo" TypeEvent Type = "event" TypeRecipe Type = "recipe" TypeReview Type = "review" TypeNote Type = "note" TypeArticle Type = "article" TypeAte Type = "ate" TypeDrank Type = "drank" )
func DiscoverType ¶
DiscoverType discovers a post type from its properties according to the algorithm described in the "Post Type Discovery" specification.
This is a slightly modified version of @aaronpk's code to include reads and watches. Original code: https://github.com/aaronpk/XRay/blob/master/lib/XRay/PostType.php
Click to show internal directories.
Click to hide internal directories.