Documentation
¶
Index ¶
- func DeleteServiceType(serviceType ServiceType, store stores.Store) error
- func ExistsWithName(name string, store stores.Store) error
- type ServiceType
- func CreateServiceType(service ServiceType, store stores.Store, cfg config.Config) (ServiceType, error)
- func FindServiceTypeByName(name string, store stores.Store) (ServiceType, error)
- func FindServiceTypeByUUID(uuid string, store stores.Store) (ServiceType, error)
- func UpdateServiceType(original ServiceType, tempServiceType TempServiceType, store stores.Store, ...) (ServiceType, error)
- type ServiceTypesList
- type TempServiceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteServiceType ¶
func DeleteServiceType(serviceType ServiceType, store stores.Store) error
DeleteServiceType deletes a service from the datastore as well as all of the other entities that are associated with it
Types ¶
type ServiceType ¶
type ServiceType struct { Name string `json:"name" required:"true"` Hosts []string `json:"hosts" required:"true"` AuthTypes []string `json:"auth_types" required:"true"` AuthMethod string `json:"auth_method" required:"true"` UUID string `json:"uuid"` CreatedOn string `json:"created_on"` Type string `json:"type" required:"true"` }
func CreateServiceType ¶
func CreateServiceType(service ServiceType, store stores.Store, cfg config.Config) (ServiceType, error)
CreateServiceType creates a new service type after validating the service
func FindServiceTypeByName ¶
func FindServiceTypeByName(name string, store stores.Store) (ServiceType, error)
FindServiceTypeByName queries the datastore to find a service type associated with the provided argument name
func FindServiceTypeByUUID ¶
func FindServiceTypeByUUID(uuid string, store stores.Store) (ServiceType, error)
FindServiceTypeByUUID queries the datastore to find a service type associated with the provided argument uuid
func UpdateServiceType ¶
func UpdateServiceType(original ServiceType, tempServiceType TempServiceType, store stores.Store, cfg config.Config) (ServiceType, error)
UpdateServiceType updates a binding after validating its fields
func (*ServiceType) HasHost ¶
func (s *ServiceType) HasHost(host string) bool
hsHost returns whether or not a host is associated with a service type
func (*ServiceType) IsOfValidType ¶
func (s *ServiceType) IsOfValidType(cfg config.Config) error
IsOfValidType checks whether or not the type of a service type is supported
func (*ServiceType) SupportsAuthType ¶
func (s *ServiceType) SupportsAuthType(authType string) error
SupportsAuthType checks whether or not the service type wants to support that kind of auth type, e.g. x509
type ServiceTypesList ¶
type ServiceTypesList struct {
ServiceTypes []ServiceType `json:"service_types"`
}
func FindAllServiceTypes ¶
func FindAllServiceTypes(store stores.Store) (ServiceTypesList, error)
FindAllServiceTypes returns all the service types from the datastore
type TempServiceType ¶
type TempServiceType struct { Name string `json:"name"` Hosts []string `json:"hosts"` AuthTypes []string `json:"auth_types"` AuthMethod string `json:"auth_method"` }
TempServiceType is a struct to be used as an intermediate node when updating a service type containing only the `allowed to be updated fields`