Documentation
¶
Index ¶
- Constants
- func CustomValidateStruct(s any) (err error)
- func Decrypt(data []byte) ([]byte, error)
- func Encrypt(data []byte) ([]byte, error)
- func Hash(data []byte) (hashed [32]byte)
- func NewCustomValidator() *validator.Validate
- type EncryptedBytes
- type EncryptedString
- type Epoch
- type EpochMillis
- type HashedString
- type Recipient
- type RecipientKeys
- type RecipientSubscription
- type StringerValidator
Constants ¶
View Source
const ( MASTER_KEY_ENV = "MASTER_KEY" HMAC_SECRET_KEY_ENV = "HMAC_SECRET_KEY" POSTGRES_CONNECTION_STRING_ENV = "POSTGRES_CONNECTION_STRING" SKIP_PADDING_ENV = "SKIP_PADDING" VAPID_EXPIRY_DURATION_ENV = "VAPID_EXPIRY_DURATION" VAPID_PRIVATE_KEY_ENV = "VAPID_PRIVATE_KEY" VAPID_SUBJECT_ENV = "VAPID_SUBJECT" )
View Source
const ( APPLICATION_JSON = "application/json" JSON_API = "application/vnd.api+json" TEXT_PLAIN = "text/plain" )
View Source
const ( URGENCY_VERY_LOW = "very-low" URGENCY_LOW = "low" URGENCY_NORMAL = "normal" URGENCY_HIGH = "high" )
View Source
const ( EPOCH_GT_NOW = "epoch-gt-now" MAILTO = "mailto" ORIGIN = "origin" )
Variables ¶
This section is empty.
Functions ¶
func CustomValidateStruct ¶
func NewCustomValidator ¶
Types ¶
type EncryptedBytes ¶
type EncryptedBytes []byte
func (*EncryptedBytes) Scan ¶
func (e *EncryptedBytes) Scan(value interface{}) error
type EncryptedString ¶
type EncryptedString string
func (*EncryptedString) Scan ¶
func (e *EncryptedString) Scan(value interface{}) error
type EpochMillis ¶
func (EpochMillis) MarshalJSON ¶
func (e EpochMillis) MarshalJSON() ([]byte, error)
func (*EpochMillis) Scan ¶
func (e *EpochMillis) Scan(value interface{}) error
func (*EpochMillis) UnmarshalJSON ¶
func (e *EpochMillis) UnmarshalJSON(data []byte) (err error)
type HashedString ¶
type HashedString string
func (*HashedString) Compare ¶
func (h *HashedString) Compare(plain []byte) bool
func (*HashedString) Scan ¶
func (h *HashedString) Scan(value interface{}) error
func (HashedString) String ¶
func (h HashedString) String() string
type Recipient ¶
type Recipient struct {
ClientId string `json:"clientId" validate:"required"`
RecipientId string `json:"id" validate:"required"`
Subscription *RecipientSubscription `json:"subscription" validate:"required"`
}
type RecipientKeys ¶
type RecipientSubscription ¶
type RecipientSubscription struct {
Endpoint string `json:"endpoint" validate:"http_url"`
ExpirationTime *EpochMillis `json:"expirationTime,omitempty"`
Keys *RecipientKeys `json:"keys" validate:"required"`
}
type StringerValidator ¶
Click to show internal directories.
Click to hide internal directories.