mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:47:32 +00:00
chore: move the go code into a subfolder
This commit is contained in:
46
apps/api/internal/domain/asset.go
Normal file
46
apps/api/internal/domain/asset.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
UsersAssetPath = "users"
|
||||
AvatarAssetPath = "/avatar"
|
||||
|
||||
policyPrefix = "policy"
|
||||
LabelPolicyPrefix = policyPrefix + "/label"
|
||||
labelPolicyLogoPrefix = LabelPolicyPrefix + "/logo"
|
||||
labelPolicyIconPrefix = LabelPolicyPrefix + "/icon"
|
||||
labelPolicyFontPrefix = LabelPolicyPrefix + "/font"
|
||||
Dark = "dark"
|
||||
|
||||
CssPath = LabelPolicyPrefix + "/css"
|
||||
CssVariablesFileName = "variables.css"
|
||||
|
||||
LabelPolicyLogoPath = labelPolicyLogoPrefix
|
||||
LabelPolicyIconPath = labelPolicyIconPrefix
|
||||
LabelPolicyFontPath = labelPolicyFontPrefix
|
||||
)
|
||||
|
||||
type AssetInfo struct {
|
||||
Bucket string
|
||||
Key string
|
||||
ETag string
|
||||
Size int64
|
||||
LastModified time.Time
|
||||
Location string
|
||||
VersionID string
|
||||
Expiration time.Time
|
||||
AutheticatedURL string
|
||||
ContentType string
|
||||
}
|
||||
|
||||
func GetHumanAvatarAssetPath(userID string) string {
|
||||
return UsersAssetPath + "/" + userID + AvatarAssetPath
|
||||
}
|
||||
|
||||
func AssetURL(prefix, resourceOwner, key string) string {
|
||||
if prefix == "" || resourceOwner == "" || key == "" {
|
||||
return ""
|
||||
}
|
||||
return prefix + "/" + resourceOwner + "/" + key
|
||||
}
|
Reference in New Issue
Block a user