messagejson

package
v0.0.0-...-bb75541 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2016 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 SocialFeed

type SocialFeed struct {
	ID             int64  `json:"id"`
	UserID         int32  `json:"user_id"`
	ObservableType string `json:"observable_type"`
	ObservableID   string `json:"observable_id"`
	EventType      string `json:"event_type"`
	TargetType     string `json:"target_type"`
	TargetID       string `json:"target_id"`
	Summary        string `json:"summary"`
}

SocialFeed acts as the super class of NewsFeed and Notification

func (*SocialFeed) GenerateID

func (sf *SocialFeed) GenerateID() error

GenerateID generates a new SocialFeed.ID and sync SocialFeed.Summary.

func (*SocialFeed) ValidateID

func (sf *SocialFeed) ValidateID() error

ValidateID validates SocialFeed.ID is present.

func (*SocialFeed) ValidateSummary

func (sf *SocialFeed) ValidateSummary() error

ValidateSummary validates SocialFeed.Summary. 1) SocialFeed.Summary should be a valid JSON string. 2) SocialFeed.Summary must have "id" included after deserializing. 3) The former "id" must be a stringified SocialFeed.ID.

func (*SocialFeed) ValidateUserID

func (sf *SocialFeed) ValidateUserID() error

ValidateUserID validates SocialFeed.UserID is present.

Jump to

Keyboard shortcuts

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