🏷️ Added App domain for fetched client metadata

This commit is contained in:
Maxim Lebedev 2022-02-16 19:59:09 +05:00
parent 6a1e281ebb
commit 2e791a74f6
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 34 additions and 0 deletions

34
internal/domain/app.go Normal file
View File

@ -0,0 +1,34 @@
package domain
type App struct {
Name []string
Logo []*URL
URL []*URL
}
// GetName safe returns first name, if any.
func (a App) GetName() string {
if len(a.Name) == 0 {
return ""
}
return a.Name[len(a.Name)-1]
}
// GetURL safe returns first uRL, if any.
func (a App) GetURL() *URL {
if len(a.URL) == 0 {
return nil
}
return a.URL[len(a.URL)-1]
}
// GetLogo safe returns first logo, if any.
func (a App) GetLogo() *URL {
if len(a.Logo) == 0 {
return nil
}
return a.Logo[len(a.Logo)-1]
}