servicetypes

package
v0.1.8-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func ExistsWithName

func ExistsWithName(name string, store stores.Store) error

ExistsWithName checks if a service type with the given name already exists

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

func (*ServiceType) Validate

func (s *ServiceType) Validate(store stores.Store, cfg config.Config) error

Validate validates the contents of the service type's fields

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`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL