Documentation ¶
Index ¶
- type BuildResponse
- type BuildSerializer
- type BuildsResponse
- type BuildsSerializer
- type DeployResponse
- type DeploysResponse
- type DeploysSerializer
- type EnvironmentResponse
- type EnvironmentSerializer
- type EnvironmentsSerializer
- type Response
- type ServiceInstanceResponse
- type ServiceInstanceSerializer
- type ServiceInstancesSerializer
- type ServiceResponse
- type ServiceSerializer
- type ServicesSerializer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildResponse ¶
type BuildResponse struct { ID int `json:"id"` VersionString string `json:"version_string"` CommitSha string `json:"commit_sha"` BuildURL string `json:"build_url,omitempty"` BuiltAt time.Time `json:"built_at,omitempty"` Service ServiceResponse `json:"service"` }
BuildResponse is the type used to ensure that response bodies from the /builds api group have a consistent structure
type BuildSerializer ¶
BuildSerializer takes a Build model entity and translates it into a response
func (*BuildSerializer) Response ¶
func (bs *BuildSerializer) Response() BuildResponse
Response method performs the serialization from a Build entity to BuildsResponse
type BuildsResponse ¶
type BuildsResponse struct { Builds []BuildResponse `json:"builds"` Error string `json:"error,omitempty"` }
BuildsResponse is a type that allows all data returned from the /builds api group to share a consistent structure
type BuildsSerializer ¶
BuildsSerializer is used to transform a slice of builds into the BuildsResponse type
func (*BuildsSerializer) Response ¶
func (bs *BuildsSerializer) Response() []BuildResponse
Response transforms a list of build model entities into BuildResponse's
type DeployResponse ¶
type DeployResponse struct { ID int `json:"id"` ServiceInstance ServiceInstanceResponse `json:"service_instance"` Build BuildResponse `json:"build"` CreatedAt time.Time `json:"deployed_at"` }
DeployResponse is the type used for generating api responses containing information about deploy(s)
type DeploysResponse ¶
type DeploysResponse struct { Deploys []DeployResponse `json:"deploys"` Error string `json:"error,omitempty"` }
DeploysResponse is a type that allows all data returned from the /builds api group to share a consistent structure
type DeploysSerializer ¶
DeploysSerializer is used to transform a slice of Deploy models into into deploy responses and can supply additional data to attach to the response
func (*DeploysSerializer) Response ¶
func (ds *DeploysSerializer) Response() []DeployResponse
DeploysResponse is used to seralize a slice of deploy database models into a slice of deploy api responses
type EnvironmentResponse ¶
EnvironmentResponse is the type that environment entities are serialized to and used in responses to clients
type EnvironmentSerializer ¶
type EnvironmentSerializer struct {
Environment v1models.Environment
}
func (*EnvironmentSerializer) Response ¶
func (es *EnvironmentSerializer) Response() EnvironmentResponse
type EnvironmentsSerializer ¶
type EnvironmentsSerializer struct {
Environments []v1models.Environment
}
EnvironmentsSerializer is used to convert a list of environment model types to a Respopnse type used to send environment info to clients
func (*EnvironmentsSerializer) Response ¶
func (es *EnvironmentsSerializer) Response() []EnvironmentResponse
Response is a function that Serializers a slice of Environment models to responses suitable for sending to clients
type Response ¶
type Response struct { Services []ServiceResponse `json:"services"` Error string `json:"error,omitempty"` }
Response is a type that allows all data returned from the /service api group to share a consistent structure
type ServiceInstanceResponse ¶
type ServiceInstanceResponse struct { ID int `json:"id"` Service ServiceResponse `json:"service"` Environment 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 ¶
func (sis *ServiceInstanceSerializer) Response() ServiceInstanceResponse
DeploysResponse consumes a ServiceInstanceSerializer and generated a response type
type ServiceInstancesSerializer ¶
type ServiceInstancesSerializer struct {
ServiceInstances []v1models.ServiceInstance
}
ServiceInstancesSerializer is a wrapper around ServiceInstanceSerializer that supports serialization of mulitple ServiceInstance entities
func (*ServiceInstancesSerializer) Response ¶
func (sis *ServiceInstancesSerializer) Response() []ServiceInstanceResponse
DeploysResponse Will generate a slice of Service Instance DeploysResponse from ServiceInstancesSerializer
type ServiceResponse ¶
type ServiceResponse struct { ID int `json:"id"` Name string `json:"name"` RepoURL string `json:"repo_url"` }
ServiceResponse is the type used to serialize Service data that is returned to clients of the sherlock api
type ServiceSerializer ¶
ServiceSerializer is used to serializer a single Service model to a used to generate responses from the /services api group
func (*ServiceSerializer) Response ¶
func (ss *ServiceSerializer) Response() ServiceResponse
Response takes a Service Model entity and transforms it into a ServiceResponse
type ServicesSerializer ¶
ServicesSerializer is used to serialize a ServiceModel entity to a a format used in http response bodies
func (*ServicesSerializer) Response ¶
func (ss *ServicesSerializer) Response() []ServiceResponse
Response serializes Service models into Service Responses