deploys

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceInstance

type ServiceInstance struct {
	ID            int
	ServiceID     int
	Service       services.Service
	EnvironmentID int
	Environment   environments.Environment
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

ServiceInstance is the model type for interacting with the database representation of service instances

func SeedServiceInstances

func SeedServiceInstances(db *gorm.DB) ([]ServiceInstance, error)

SeedServiceInstances is used to populate the database with Service Instance entities solely intended for use in testing

type ServiceInstanceController

type ServiceInstanceController struct {
	// contains filtered or unexported fields
}

ServiceInstanceController is the type used to manage logic related to working with ServiceInstance entities

func NewMockController

func NewMockController(mockStore *mockServiceInstanceStore) *ServiceInstanceController

NewMockController returns an EnvironmentController instance with the provided mock of the storage layer for use in unit tests

func NewServiceInstanceController

func NewServiceInstanceController(dbConn *gorm.DB) *ServiceInstanceController

NewServiceInstanceController expects a gorm.DB connection and will provision a new controller instance

func (*ServiceInstanceController) ListAll

func (sic *ServiceInstanceController) ListAll() ([]ServiceInstance, error)

ListAll retrieves all service_instance entities from the backing data store

func (*ServiceInstanceController) Serialize

func (sic *ServiceInstanceController) Serialize(serviceInstances ...ServiceInstance) []ServiceInstanceResponse

Serialize takes a variable number of service instance entities and serializes them into types suitable for use in client responses

type ServiceInstanceResponse

type ServiceInstanceResponse struct {
	ID          int                              `json:"id"`
	Service     services.ServiceResponse         `json:"service"`
	Environment environments.EnvironmentResponse `json:"environment"`
}

ServiceInstanceResponse is the type that is used to represent data about a ServiceInstance entity in response to clients. Its purpose is to decouple responses from the database model

type ServiceInstanceSerializer

type ServiceInstanceSerializer struct {
	// contains filtered or unexported fields
}

ServiceInstanceSerializer is an intermediate type used to convert a Service instance into its response type

func (*ServiceInstanceSerializer) Response

Response consumes a ServiceInstanceSerializer and generated a response type

type ServiceInstancesSerializer

type ServiceInstancesSerializer struct {
	ServiceInstances []ServiceInstance
}

ServiceInstancesSerializer is a wrapper around ServiceInstanceSerializer that supports serialization of mulitple ServiceInstance entities

func (*ServiceInstancesSerializer) Response

Response Will generate a slice of Service Instance Response from ServiceInstancesSerializer

Jump to

Keyboard shortcuts

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