Documentation ¶
Index ¶
- func EventNotFoundError(eventKey *string) error
- func GenerateAuthCode() (uint32, error)
- func GetAuthTokenFromHeader(ctx context.Context) (string, error)
- func InsufficientPermissionsError() error
- func InvalidArgumentError() error
- func InvalidAuthCodeFormat(authCode uint32) bool
- func InvalidAuthError() error
- func InvalidIDFormat(id *string) bool
- func InvalidPhoneNumberFormat(phoneNumber *string) bool
- func IsEmpty(arg *string) bool
- func PlayerAlreadyExistsError(eventKey *string, phoneNumber *string) error
- func PlayerNotFoundError(playerID *string) error
- func TemporaryServerError(err error) error
- func TestMain(m *testing.M, testDBHolder **sql.DB, seedStatements []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventNotFoundError ¶
EventNotFoundError constructs a gRPC error to indicate that the provided event key was invalid.
func GenerateAuthCode ¶
GenerateAuthCode generates a valid, cryptographically random auth code.
func GetAuthTokenFromHeader ¶
GetAuthTokenFromHeader parses the auth code out of the request metadata ('authorization' header).
func InsufficientPermissionsError ¶
func InsufficientPermissionsError() error
InsufficientPermissionsError constructs a gRPC error to indicate that the request lacked an authorized token for the requested action. Invalid tokens should use `InvalidAuthError()` instead.
func InvalidArgumentError ¶
func InvalidArgumentError() error
InvalidArgumentError constructs a gRPC error to indicate that the client request was malformed.
func InvalidAuthCodeFormat ¶
InvalidAuthCodeFormat returns true if the auth code is not a number in the valid range.
func InvalidAuthError ¶
func InvalidAuthError() error
InvalidAuthError constructs a gRPC error to indicate that the auth token is not valid. Valid tokens that aren't authorized for a particular action should use `InsufficientPermissionsError()` instead.
func InvalidIDFormat ¶
InvalidIDFormat returns true if the provided ID is not a valid UUID v4.
func InvalidPhoneNumberFormat ¶
InvalidPhoneNumberFormat returns true if a phone number string doesn't match the E.164 format: https://www.twilio.com/docs/glossary/what-e164
func PlayerAlreadyExistsError ¶
PlayerAlreadyExistsError constructs a gRPC error to indicate that a conflicting registration already exists. This error response is deprecated.
func PlayerNotFoundError ¶
PlayerNotFoundError constructs a gRPC error to indicate that the provided player ID was invalid.
func TemporaryServerError ¶
TemporaryServerError constructs a gRPC error to indicate that a miscellaneous server error has occurred, and that the request may be retried.
Types ¶
This section is empty.