This repository has been archived on 2024-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
core-old/internal/domain/version.go
Dawid Wysokiński cde9990810
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
refactor: refresh servers cmd - send url instead of just host in payload
2023-02-26 10:20:32 +01:00

31 lines
507 B
Go

package domain
import "fmt"
type Version struct {
Code string
Name string
Host string
Timezone string
}
func (v Version) URL() string {
return "https://" + v.Host
}
type VersionNotFoundError struct {
VerCode string
}
func (e VersionNotFoundError) Error() string {
return fmt.Sprintf("version (code=%s) not found", e.VerCode)
}
func (e VersionNotFoundError) UserError() string {
return e.Error()
}
func (e VersionNotFoundError) Code() ErrorCode {
return ErrorCodeEntityNotFound
}