Documentation ¶
Overview ¶
Package ffuser defines the go-feature-flag model for user properties.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
A User contains specific attributes of a user browsing your site. The only mandatory property is the Key, which must uniquely identify each user. For authenticated users, this may be a username or e-mail address. For anonymous users, this could be an IP address or session ID.
User fields are immutable and can be accessed only via getter methods. To construct a User, use either a simple constructor (NewUser, NewAnonymousUser) or the builder pattern with NewUserBuilder.
func NewAnonymousUser ¶
NewAnonymousUser creates a new anonymous user identified by the given key.
func (*User) IsAnonymous ¶
IsAnonymous return if the user is anonymous or not.
type UserBuilder ¶
type UserBuilder interface { Anonymous(bool) UserBuilder AddCustom(string, interface{}) UserBuilder Build() User }
UserBuilder is a builder to create a User.
func NewUserBuilder ¶
func NewUserBuilder(key string) UserBuilder
NewUserBuilder constructs a new UserBuilder, specifying the user key.
For authenticated users, the key may be a username or e-mail address. For anonymous users, this could be an IP address or session ID.