Documentation ¶
Index ¶
- Constants
- Variables
- func APILevel(r Request) int
- func DecodeBytes(ctx context.Context, b []byte) ([]byte, error)
- func DecodeString(ctx context.Context, s string) (string, error)
- func EncodeBytes(ctx context.Context, b []byte) ([]byte, error)
- func EncodeString(ctx context.Context, s string) (string, error)
- func EncodeToken(ctx context.Context, user *User) (string, error)
- func GetUnsubscribeURL(ctx context.Context, r *mux.Router, host string, userId string) (*url.URL, error)
- func PP(i interface{}) string
- func SetOAuth(ctx context.Context, oAuth *OAuth) error
- func SetSuperusers(ctx context.Context, superusers *Superusers) error
- func SetupRouter(r *mux.Router)
- func UserConfigID(ctx context.Context, userID *datastore.Key) *datastore.Key
- func UserID(ctx context.Context, userID string) *datastore.Key
- type FCMNotificationConfig
- type FCMToken
- type FCMValue
- type MailConfig
- type MailNotificationConfig
- type OAuth
- type RedirectURL
- type RedirectURLs
- type Superusers
- type UnsubscribeConfig
- type User
- type UserConfig
Constants ¶
View Source
const ( LoginRoute = "Login" LogoutRoute = "Logout" RedirectRoute = "Redirect" OAuth2CallbackRoute = "OAuth2Callback" UnsubscribeRoute = "Unsubscribe" ApproveRedirectRoute = "ApproveRedirect" ListRedirectURLsRoute = "ListRedirectURLs" ReplaceFCMRoute = "ReplaceFCM" TestUpdateUserRoute = "TestUpdateUser" )
Variables ¶
View Source
var ( TestMode = false HTMLAPILevel = 1 )
View Source
var (
RedirectURLResource *Resource
)
View Source
var UserConfigResource = &Resource{
Load: loadUserConfig,
Update: updateUserConfig,
FullPath: "/User/{user_id}/UserConfig",
}
Functions ¶
func GetUnsubscribeURL ¶
func SetSuperusers ¶
func SetSuperusers(ctx context.Context, superusers *Superusers) error
func SetupRouter ¶
Types ¶
type FCMNotificationConfig ¶
type FCMNotificationConfig struct { ClickActionTemplate string `methods:"PUT" datastore:",noindex"` TitleTemplate string `methods:"PUT" datastore:",noindex"` BodyTemplate string `methods:"PUT" datastore:",noindex"` }
func (*FCMNotificationConfig) Customize ¶
func (f *FCMNotificationConfig) Customize(ctx context.Context, notif *fcm.NotificationPayload, data interface{})
func (*FCMNotificationConfig) Validate ¶
func (f *FCMNotificationConfig) Validate() error
type FCMToken ¶
type FCMToken struct { Value string `methods:"PUT"` Disabled bool `methods:"PUT"` Note string `methods:"PUT" datastore:",noindex"` App string `methods:"PUT"` MessageConfig FCMNotificationConfig `methods:"PUT"` PhaseConfig FCMNotificationConfig `methods:"PUT"` ReplaceToken string `methods:"PUT"` }
type MailConfig ¶
type MailConfig struct { Enabled bool `methods:"PUT"` UnsubscribeConfig UnsubscribeConfig `methods:"PUT"` MessageConfig MailNotificationConfig `methods:"PUT"` PhaseConfig MailNotificationConfig `methods:"PUT"` }
func (*MailConfig) Validate ¶
func (m *MailConfig) Validate() error
type MailNotificationConfig ¶
type MailNotificationConfig struct { SubjectTemplate string `methods:"PUT" datastore:",noindex"` TextBodyTemplate string `methods:"PUT" datastore:",noindex"` HTMLBodyTemplate string `methods:"PUT" datastore:",noindex"` }
func (*MailNotificationConfig) Customize ¶
func (m *MailNotificationConfig) Customize(ctx context.Context, msg *sendgrid.SGMail, data interface{})
func (*MailNotificationConfig) Validate ¶
func (m *MailNotificationConfig) Validate() error
type RedirectURL ¶
func (*RedirectURL) Item ¶
func (u *RedirectURL) Item(r Request) *Item
type RedirectURLs ¶
type RedirectURLs []RedirectURL
func (RedirectURLs) Item ¶
func (u RedirectURLs) Item(r Request, userId string) *Item
type Superusers ¶
type Superusers struct {
UserIds string
}
func GetSuperusers ¶
func GetSuperusers(ctx context.Context) (*Superusers, error)
func (*Superusers) Includes ¶
func (s *Superusers) Includes(userId string) bool
type UnsubscribeConfig ¶
type UnsubscribeConfig struct { RedirectTemplate string `methods:"PUT"` HTMLTemplate string `methods:"PUT"` }
func (*UnsubscribeConfig) Validate ¶
func (u *UnsubscribeConfig) Validate() error
type User ¶
type UserConfig ¶
type UserConfig struct { UserId string FCMTokens []FCMToken `methods:"PUT"` MailConfig MailConfig `methods:"PUT"` Colors []string `methods:"PUT"` }
func (*UserConfig) Item ¶
func (u *UserConfig) Item(r Request) *Item
Click to show internal directories.
Click to hide internal directories.