Documentation ¶
Index ¶
- Variables
- type AdminCreateArgs
- type EmailLinkCreateArgs
- type EmailLinkCreateRequest
- type EmailLinkCreateResponse
- type EmailLinkCreateResults
- type Error
- type JWTCreateArgs
- type JWTCreateRequest
- type JWTCreateResponse
- type JWTCreateResults
- type JWTValidateArgs
- type JWTValidateRequest
- type JWTValidateResponse
- type JWTValidateResults
- type LinkCreateArgs
- type LinkCreateRequest
- type LinkCreateResponse
- type LinkCreateResults
- type RequestMetadata
- type ServiceAccount
- type ServiceAccountCreateArgs
- type ServiceAccountCreateRequest
- type ServiceAccountCreateResponse
- type ServiceAccountCreateResults
- type ValidAdminCreateArgs
- type ValidEmailLinkCreateArgs
- type ValidEmailLinkCreateRequest
- type ValidJWTCreateArgs
- type ValidJWTCreateRequest
- type ValidJWTValidateArgs
- type ValidJWTValidateRequest
- type ValidLinkCreateArgs
- type ValidLinkCreateRequest
- type ValidServiceAccountCreateArgs
- type ValidServiceAccountCreateRequest
- type Validation
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidModel = errors.New("invalid model")
ErrInvalidModel is returned when a model is invalid.
Functions ¶
This section is empty.
Types ¶
type AdminCreateArgs ¶
type AdminCreateArgs struct { APIKey uuid.UUID `json:"apiKey"` Aud uuid.UUID `json:"aud"` UUID uuid.UUID `json:"uuid"` ServiceAccountCreateArgs ServiceAccountCreateArgs `json:"serviceAccountCreateArgs"` }
AdminCreateArgs are the unvalidated arguments for creating an admin.
func (AdminCreateArgs) Validate ¶
func (a AdminCreateArgs) Validate(config Validation) (ValidAdminCreateArgs, error)
Validate validates the admin create arguments.
type EmailLinkCreateArgs ¶
type EmailLinkCreateArgs struct { ButtonText string `json:"buttonText"` Greeting string `json:"greeting"` LogoClickURL string `json:"logoClickURL"` LogoImageURL string `json:"logoImageURL"` ServiceName string `json:"serviceName"` Subject string `json:"subject"` SubTitle string `json:"subTitle"` Title string `json:"title"` ToEmail string `json:"toEmail"` ToName string `json:"toName"` }
EmailLinkCreateArgs are the unvalidated arguments for creating an email link.
func (EmailLinkCreateArgs) Validate ¶
func (p EmailLinkCreateArgs) Validate(config Validation) (ValidEmailLinkCreateArgs, error)
Validate implements the Validatable interface.
type EmailLinkCreateRequest ¶
type EmailLinkCreateRequest struct { EmailArgs EmailLinkCreateArgs `json:"emailArgs"` LinkArgs LinkCreateArgs `json:"linkArgs"` }
EmailLinkCreateRequest is the unvalidated request to create an email link.
func (EmailLinkCreateRequest) Validate ¶
func (b EmailLinkCreateRequest) Validate(config Validation) (ValidEmailLinkCreateRequest, error)
Validate implements the Validatable interface.
type EmailLinkCreateResponse ¶
type EmailLinkCreateResponse struct { EmailLinkCreateResults EmailLinkCreateResults `json:"emailLinkCreateResults"` RequestMetadata RequestMetadata `json:"requestMetadata"` }
EmailLinkCreateResponse is the response to creating an email link.
type EmailLinkCreateResults ¶
type EmailLinkCreateResults struct {
LinkCreateResults LinkCreateResults `json:"linkCreateResults"`
}
EmailLinkCreateResults are the results of creating an email link.
type Error ¶
type Error struct { Code int `json:"code"` Message string `json:"message"` RequestMetadata RequestMetadata `json:"requestMetadata"` }
Error is the model for an error.
type JWTCreateArgs ¶
type JWTCreateArgs struct { JWTAlg string `json:"jwtAlg"` JWTClaims any `json:"jwtClaims"` JWTLifespanSeconds int `json:"jwtLifespanSeconds"` }
JWTCreateArgs are the unvalidated arguments for creating a JWT.
func (JWTCreateArgs) Validate ¶
func (j JWTCreateArgs) Validate(config Validation) (ValidJWTCreateArgs, error)
Validate implements the Validatable interface.
type JWTCreateRequest ¶
type JWTCreateRequest struct {
JWTCreateArgs JWTCreateArgs `json:"jwtCreateArgs"`
}
JWTCreateRequest is the unvalidated request to create a JWT.
func (JWTCreateRequest) Validate ¶
func (j JWTCreateRequest) Validate(config Validation) (ValidJWTCreateRequest, error)
Validate implements the Validatable interface.
type JWTCreateResponse ¶
type JWTCreateResponse struct { JWTCreateResults JWTCreateResults `json:"jwtCreateResults"` RequestMetadata RequestMetadata `json:"requestMetadata"` }
JWTCreateResponse is the response to creating a JWT.
type JWTCreateResults ¶
type JWTCreateResults struct {
JWT string `json:"jwt"`
}
JWTCreateResults are the results of creating a JWT.
type JWTValidateArgs ¶
type JWTValidateArgs struct {
JWT string `json:"jwt"`
}
JWTValidateArgs are the unvalidated arguments for validating a JWT.
func (JWTValidateArgs) Validate ¶
func (j JWTValidateArgs) Validate(_ Validation) (ValidJWTValidateArgs, error)
Validate implements the Validatable interface.
type JWTValidateRequest ¶
type JWTValidateRequest struct {
JWTValidateArgs JWTValidateArgs `json:"jwtValidateArgs"`
}
JWTValidateRequest is the unvalidated request to validate a JWT.
func (JWTValidateRequest) Validate ¶
func (j JWTValidateRequest) Validate(config Validation) (ValidJWTValidateRequest, error)
Validate implements the Validatable interface.
type JWTValidateResponse ¶
type JWTValidateResponse struct { JWTValidateResults JWTValidateResults `json:"jwtValidateResults"` RequestMetadata RequestMetadata `json:"requestMetadata"` }
JWTValidateResponse is the response to validating a JWT.
type JWTValidateResults ¶
type JWTValidateResults struct {
JWTClaims json.RawMessage `json:"claims"`
}
JWTValidateResults are the results of validating a JWT.
type LinkCreateArgs ¶
type LinkCreateArgs struct { JWTCreateArgs JWTCreateArgs `json:"jwtCreateArgs"` LinkLifespan int `json:"linkLifespan"` RedirectQueryKey string `json:"redirectQueryKey"` RedirectURL string `json:"redirectUrl"` }
LinkCreateArgs are the unvalidated arguments for creating a link.
func (LinkCreateArgs) Validate ¶
func (p LinkCreateArgs) Validate(config Validation) (ValidLinkCreateArgs, error)
Validate validates the link create arguments.
type LinkCreateRequest ¶
type LinkCreateRequest struct {
LinkArgs LinkCreateArgs `json:"linkArgs"`
}
LinkCreateRequest is the request to create a link.
func (LinkCreateRequest) Validate ¶
func (b LinkCreateRequest) Validate(config Validation) (ValidLinkCreateRequest, error)
Validate validates the link create request.
type LinkCreateResponse ¶
type LinkCreateResponse struct { LinkCreateResults LinkCreateResults `json:"linkCreateResults"` RequestMetadata RequestMetadata `json:"requestMetadata"` }
LinkCreateResponse is the response to creating a link.
type LinkCreateResults ¶
LinkCreateResults are the results of creating a link.
type RequestMetadata ¶
RequestMetadata is the model for request metadata.
type ServiceAccount ¶
type ServiceAccount struct { UUID uuid.UUID `json:"uuid"` APIKey uuid.UUID `json:"apiKey"` Aud uuid.UUID `json:"aud"` Admin bool `json:"admin"` }
ServiceAccount is the model for a service account and its metadata.
type ServiceAccountCreateArgs ¶
type ServiceAccountCreateArgs struct{}
ServiceAccountCreateArgs are the unvalidated arguments to create a service account.
func (ServiceAccountCreateArgs) Validate ¶
func (n ServiceAccountCreateArgs) Validate(_ Validation) (ValidServiceAccountCreateArgs, error)
Validate implements the Validatable interface.
type ServiceAccountCreateRequest ¶
type ServiceAccountCreateRequest struct {
CreateServiceAccountArgs ServiceAccountCreateArgs `json:"createServiceAccountArgs"`
}
ServiceAccountCreateRequest is the unvalidated request to create a service account.
func (ServiceAccountCreateRequest) Validate ¶
func (b ServiceAccountCreateRequest) Validate(config Validation) (ValidServiceAccountCreateRequest, error)
Validate implements the Validatable interface.
type ServiceAccountCreateResponse ¶
type ServiceAccountCreateResponse struct { CreateServiceAccountResults ServiceAccountCreateResults `json:"createServiceAccountResults"` RequestMetadata RequestMetadata `json:"requestMetadata"` }
ServiceAccountCreateResponse is the response to creating a service account.
type ServiceAccountCreateResults ¶
type ServiceAccountCreateResults struct {
ServiceAccount ServiceAccount `json:"serviceAccount"`
}
ServiceAccountCreateResults are the results of creating a service account.
type ValidAdminCreateArgs ¶
type ValidAdminCreateArgs struct { APIKey uuid.UUID Aud uuid.UUID UUID uuid.UUID ValidServiceAccountCreateArgs ValidServiceAccountCreateArgs }
ValidAdminCreateArgs are the validated arguments for creating an admin.
type ValidEmailLinkCreateArgs ¶
type ValidEmailLinkCreateArgs struct { ButtonText string Greeting string LogoClickURL string LogoImageURL string ServiceName string Subject string SubTitle string Title string ToEmail *mail.Address }
ValidEmailLinkCreateArgs are the validated arguments for creating an email link.
type ValidEmailLinkCreateRequest ¶
type ValidEmailLinkCreateRequest struct { EmailArgs ValidEmailLinkCreateArgs LinkArgs ValidLinkCreateArgs }
ValidEmailLinkCreateRequest is the validated request to create an email link.
type ValidJWTCreateArgs ¶
type ValidJWTCreateArgs struct { JWTAlg string JWTClaims json.RawMessage JWTLifespan time.Duration }
ValidJWTCreateArgs are the validated arguments for creating a JWT.
type ValidJWTCreateRequest ¶
type ValidJWTCreateRequest struct {
JWTCreateArgs ValidJWTCreateArgs
}
ValidJWTCreateRequest is the validated request to create a JWT.
type ValidJWTValidateArgs ¶
type ValidJWTValidateArgs struct {
JWT string
}
ValidJWTValidateArgs are the validated arguments for validating a JWT.
type ValidJWTValidateRequest ¶
type ValidJWTValidateRequest struct {
JWTValidateArgs ValidJWTValidateArgs
}
ValidJWTValidateRequest is the validated request to validate a JWT.
type ValidLinkCreateArgs ¶
type ValidLinkCreateArgs struct { LinkLifespan time.Duration JWTCreateArgs ValidJWTCreateArgs RedirectQueryKey string RedirectURL *url.URL }
ValidLinkCreateArgs are the validated arguments for creating a link.
type ValidLinkCreateRequest ¶
type ValidLinkCreateRequest struct {
LinkArgs ValidLinkCreateArgs
}
ValidLinkCreateRequest is the validated request to create a link.
type ValidServiceAccountCreateArgs ¶
type ValidServiceAccountCreateArgs struct{}
ValidServiceAccountCreateArgs are the validated arguments to create a service account.
type ValidServiceAccountCreateRequest ¶
type ValidServiceAccountCreateRequest struct {
CreateServiceAccountArgs ValidServiceAccountCreateArgs
}
ValidServiceAccountCreateRequest is the validated request to create a service account.
type Validation ¶
type Validation struct { LinkLifespanDefault *jt.JSONType[time.Duration] `json:"linkLifespanDefault"` LinkLifespanMax *jt.JSONType[time.Duration] `json:"maxLinkLifespan"` JWTClaimsMaxBytes uint `json:"maxJWTClaimsBytes"` JWTLifespanDefault *jt.JSONType[time.Duration] `json:"jwtLifespanDefault"` JWTLifespanMax *jt.JSONType[time.Duration] `json:"maxJWTLifespan"` ServiceNameMinUTF8 uint `json:"serviceNameMinUTF8"` ServiceNameMaxUTF8 uint `json:"serviceNameMaxUTF8"` URLMaxLength uint `json:"urlMaxLength"` }
Validation contains information on how to validate models.
func (Validation) DefaultsAndValidate ¶
func (v Validation) DefaultsAndValidate() (Validation, error)
DefaultsAndValidate implements the jsontype.Config interface.