Documentation
¶
Overview ¶
Package models describes models for database communication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyUsersBatch = UsersBatch{ Users: nil, Type: UsersBatchTypeUnknown, CreatedAt: time.Time{}, }
EmptyUsersBatch represents nil batch.
View Source
var ErrInvalidUsersBatchType = errors.New("invalid users batch type")
ErrInvalidUsersBatchType means that batch type not supported.
Functions ¶
func MakeInvalidBatchTypeError ¶
func MakeInvalidBatchTypeError(t UsersBatchType) error
MakeInvalidBatchTypeError returns ErrInvalidUsersBatchType with added bathtype info.
Types ¶
type User ¶
type User struct {
ID int64 `bson:"id"`
UserName string `bson:"user_name"`
FullName string `bson:"full_name"`
}
User stores information about user.
type UsersBatch ¶
type UsersBatch struct {
Users []User `bson:"users"`
Type UsersBatchType `bson:"batch_type"`
CreatedAt time.Time `bson:"created_at"`
}
UsersBatch represents info about specific type of users (followers, followings).
type UsersBatchType ¶
type UsersBatchType int
UsersBatchType marks what is the type of users stored in the batch.
const ( // UsersBatchTypeUnknown is unknown type, to cover default value case. UsersBatchTypeUnknown UsersBatchType = iota // UsersBatchTypeFollowers represents user's followers. UsersBatchTypeFollowers // UsersBatchTypeFollowings represents user's followings. UsersBatchTypeFollowings // UsersBatchTypeNotMutual represents users that not following back. UsersBatchTypeNotMutual // UsersBatchTypeBusinessAccounts represents business accounts. UsersBatchTypeBusinessAccounts // UsersBatchTypeLostFollowers represents lost followers. UsersBatchTypeLostFollowers // UsersBatchTypeNewFollowers represents new followers. UsersBatchTypeNewFollowers )
func (UsersBatchType) String ¶
func (i UsersBatchType) String() string
func (UsersBatchType) Valid ¶
func (i UsersBatchType) Valid() bool
Valid checks if value is valid type.
Click to show internal directories.
Click to hide internal directories.