oc-lib/models/resources/resource.go

30 lines
1.5 KiB
Go
Raw Normal View History

2024-07-18 11:51:12 +02:00
package resources
2024-07-19 10:54:58 +02:00
import (
"cloud.o-forge.io/core/oc-lib/models/utils"
)
2024-07-18 11:51:12 +02:00
// AbstractResource is the struct containing all of the attributes commons to all ressources
// Resource is the interface to be implemented by all classes inheriting from Resource to have the same behavior
2024-07-23 11:22:50 +02:00
// http://www.inanzzz.com/index.php/post/wqbs/a-basic-usage-of-int-and-string-enum-types-in-golang
2024-07-18 11:51:12 +02:00
type AbstractResource struct {
2024-07-19 10:54:58 +02:00
utils.AbstractObject
2024-07-25 11:46:33 +02:00
ShortDescription string `json:"short_description,omitempty" bson:"short_description,omitempty" validate:"required"`
Description string `json:"description,omitempty" bson:"description,omitempty"`
Logo string `json:"logo,omitempty" bson:"logo,omitempty" validate:"required"`
Owner string `json:"owner,omitempty" bson:"owner,omitempty" validate:"required"`
OwnerLogo string `json:"owner_logo,omitempty" bson:"owner_logo,omitempty"`
SourceUrl string `json:"source_url,omitempty" bson:"source_url,omitempty" validate:"required"`
Proxy *ResourceProxy `json:"proxy,omitempty" bson:"proxy,omitempty"`
}
type ResourceProxy struct {
Host string `json:"host,omitempty" bson:"host,omitempty"`
Port int `json:"port,omitempty" bson:"port,omitempty"`
Command string `json:"command,omitempty" bson:"command,omitempty"`
Args []string `json:"args,omitempty" bson:"args,omitempty"`
EnvArgs map[string]interface{} `json:"env_args,omitempty" bson:"env_args,omitempty"`
2024-07-18 11:51:12 +02:00
}