Documentation ¶
Index ¶
Constants ¶
View Source
const (
QueryMetadata = "x-authgear-metadata"
)
Variables ¶
View Source
var FileMetaSchema = validation.NewSimpleSchema(`
{
"type": "object",
"additionalProperties": false,
"properties": {
"user_id": { "type": "string" },
"uploaded_by": {
"type": "string",
"enum": ["user", "admin_api"]
}
},
"required": ["uploaded_by"],
"allOf": [
{
"if": { "properties": { "uploaded_by": { "const": "user" } } },
"then": {
"required": ["user_id"]
}
}
]
}
`)
Functions ¶
func EncodeFileMetaData ¶
func EncodeFileMetaData(metadata *FileMetadata) (string, error)
Types ¶
type FileMetadata ¶
type FileMetadata struct { UserID string `json:"user_id,omitempty"` UploadedBy UploadedByType `json:"uploaded_by,omitempty"` }
func DecodeFileMetadata ¶
func DecodeFileMetadata(encoded string) (*FileMetadata, error)
type Store ¶
type Store struct { SQLBuilder *appdb.SQLBuilderApp SQLExecutor *appdb.SQLExecutor }
type UploadedByType ¶
type UploadedByType string
const ( UploadedByTypeUser UploadedByType = "user" UploadedByTypeAdminAPI UploadedByType = "admin_api" )
Click to show internal directories.
Click to hide internal directories.