presenter

package
v0.0.0-...-1c213c1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APILink struct {
	Link
	Meta APILinkMeta `json:"meta"`
}

type APILinkMeta

type APILinkMeta struct {
	Version string `json:"version"`
}

type AppEnvResponse

type AppEnvResponse struct {
	EnvironmentVariables map[string]string `json:"environment_variables"`
	StagingEnvJSON       map[string]string `json:"staging_env_json"`
	RunningEnvJSON       map[string]string `json:"running_env_json"`
	SystemEnvJSON        map[string]string `json:"system_env_json"`
	ApplicationEnvJSON   map[string]string `json:"application_env_json"`
}

func ForAppEnv

func ForAppEnv(envVars map[string]string) AppEnvResponse
type AppEnvVarsLinks struct {
	Self Link `json:"self"`
	App  Link `json:"app"`
}

type AppEnvVarsResponse

type AppEnvVarsResponse struct {
	Var   map[string]string `json:"var"`
	Links AppEnvVarsLinks   `json:"links"`
}

func ForAppEnvVars

func ForAppEnvVars(record repositories.AppEnvVarsRecord, baseURL url.URL) AppEnvVarsResponse
type AppLinks struct {
	Self                 Link `json:"self"`
	Space                Link `json:"space"`
	Processes            Link `json:"processes"`
	Packages             Link `json:"packages"`
	EnvironmentVariables Link `json:"environment_variables"`
	CurrentDroplet       Link `json:"current_droplet"`
	Droplets             Link `json:"droplets"`
	Tasks                Link `json:"tasks"`
	StartAction          Link `json:"start"`
	StopAction           Link `json:"stop"`
	Revisions            Link `json:"revisions"`
	DeployedRevisions    Link `json:"deployed_revisions"`
	Features             Link `json:"features"`
}

type AppResponse

type AppResponse struct {
	Name  string `json:"name"`
	GUID  string `json:"guid"`
	State string `json:"state"`

	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
	Relationships Relationships `json:"relationships"`
	Lifecycle     Lifecycle     `json:"lifecycle"`
	Metadata      Metadata      `json:"metadata"`
	Links         AppLinks      `json:"links"`
}

func ForApp

func ForApp(responseApp repositories.AppRecord, baseURL url.URL) AppResponse

type BuildResponse

type BuildResponse struct {
	GUID            string                 `json:"guid"`
	CreatedAt       string                 `json:"created_at"`
	UpdatedAt       string                 `json:"updated_at"`
	CreatedBy       map[string]interface{} `json:"created_by"`
	State           string                 `json:"state"`
	StagingMemoryMB int                    `json:"staging_memory_in_mb"`
	StagingDiskMB   int                    `json:"staging_disk_in_mb"`
	Error           *string                `json:"error"`
	Lifecycle       Lifecycle              `json:"lifecycle"`
	Package         RelationshipData       `json:"package"`
	Droplet         *RelationshipData      `json:"droplet"`
	Relationships   Relationships          `json:"relationships"`
	Metadata        Metadata               `json:"metadata"`
	Links           map[string]Link        `json:"links"`
}

func ForBuild

func ForBuild(buildRecord repositories.BuildRecord, baseURL url.URL) BuildResponse

type BuildpackData

type BuildpackData struct {
	Name          string `json:"name"`
	DetectOutput  string `json:"detect_output"`
	BuildpackName string `json:"buildpack_name"`
	Version       string `json:"version"`
}

type BuildpackResponse

type BuildpackResponse struct {
	GUID      string          `json:"guid"`
	CreatedAt string          `json:"created_at"`
	UpdatedAt string          `json:"updated_at"`
	Name      string          `json:"name"`
	Filename  string          `json:"filename"`
	Stack     string          `json:"stack"`
	Position  int             `json:"position"`
	Enabled   bool            `json:"enabled"`
	Locked    bool            `json:"locked"`
	Metadata  Metadata        `json:"metadata"`
	Links     map[string]Link `json:"links"`
}

func ForBuildpack

func ForBuildpack(buildpackRecord repositories.BuildpackRecord, baseURL url.URL) BuildpackResponse

type ChecksumData

type ChecksumData struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}
type CurrentDropletLinks struct {
	Self    Link `json:"self"`
	Related Link `json:"related"`
}

type CurrentDropletResponse

type CurrentDropletResponse struct {
	Relationship `json:",inline"`
	Links        CurrentDropletLinks `json:"links"`
}

func ForCurrentDroplet

func ForCurrentDroplet(record repositories.CurrentDropletRecord, baseURL url.URL) CurrentDropletResponse
type DomainLinks struct {
	Self              Link  `json:"self"`
	RouteReservations Link  `json:"route_reservations"`
	RouterGroup       *Link `json:"router_group"`
}

type DomainRelationships

type DomainRelationships struct {
	Organization        `json:"organization"`
	SharedOrganizations `json:"shared_organizations"`
}

type DomainResponse

type DomainResponse struct {
	Name               string   `json:"name"`
	GUID               string   `json:"guid"`
	Internal           bool     `json:"internal"`
	RouterGroup        *string  `json:"router_group"`
	SupportedProtocols []string `json:"supported_protocols"`

	CreatedAt     string              `json:"created_at"`
	UpdatedAt     string              `json:"updated_at"`
	Metadata      Metadata            `json:"metadata"`
	Relationships DomainRelationships `json:"relationships"`
	Links         DomainLinks         `json:"links"`
}

func ForDomain

func ForDomain(responseDomain repositories.DomainRecord, baseURL url.URL) DomainResponse

type DropletResponse

type DropletResponse struct {
	GUID              string            `json:"guid"`
	CreatedAt         string            `json:"created_at"`
	UpdatedAt         string            `json:"updated_at"`
	State             string            `json:"state"`
	Error             *string           `json:"error"`
	Lifecycle         Lifecycle         `json:"lifecycle"`
	ExecutionMetadata string            `json:"execution_metadata"`
	Checksum          *ChecksumData     `json:"checksum"`
	Buildpacks        []BuildpackData   `json:"buildpacks"`
	ProcessTypes      map[string]string `json:"process_types"`
	Stack             string            `json:"stack"`
	Image             *string           `json:"image"`
	Relationships     Relationships     `json:"relationships"`
	Metadata          Metadata          `json:"metadata"`
	Links             map[string]*Link  `json:"links"`
}

func ForDroplet

func ForDroplet(dropletRecord repositories.DropletRecord, baseURL url.URL) DropletResponse

type ErrorsResponse

type ErrorsResponse struct {
	Errors []PresentedError `json:"errors"`
}

type IdentityResponse

type IdentityResponse struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
}

func ForWhoAmI

func ForWhoAmI(identity authorization.Identity) IdentityResponse

type IncludedData

type IncludedData struct {
	Apps []interface{} `json:"apps"`
}
type JobLinks struct {
	Self  Link  `json:"self"`
	Space *Link `json:"space,omitempty"`
}

TODO: Generalize job links or just omit missing links for jobs that do not require them?

type JobResponse

type JobResponse struct {
	GUID      string   `json:"guid"`
	Errors    *string  `json:"errors"`
	Warnings  *string  `json:"warnings"`
	Operation string   `json:"operation"`
	State     string   `json:"state"`
	CreatedAt string   `json:"created_at"`
	UpdatedAt string   `json:"updated_at"`
	Links     JobLinks `json:"links"`
}

func ForDeleteJob

func ForDeleteJob(jobGUID string, operation string, baseURL url.URL) JobResponse

func ForManifestApplyJob

func ForManifestApplyJob(jobGUID string, spaceGUID string, baseURL url.URL) JobResponse

type Lifecycle

type Lifecycle struct {
	Type string        `json:"type"`
	Data LifecycleData `json:"data"`
}

type LifecycleData

type LifecycleData struct {
	Buildpacks []string `json:"buildpacks"`
	Stack      string   `json:"stack"`
}
type Link struct {
	HREF   string `json:"href,omitempty"`
	Method string `json:"method,omitempty"`
}

type ListResponse

type ListResponse struct {
	PaginationData PaginationData `json:"pagination"`
	Resources      []interface{}  `json:"resources"`
	Included       *IncludedData  `json:"included,omitempty"`
}

func ForAppList

func ForAppList(appRecordList []repositories.AppRecord, baseURL, requestURL url.URL) ListResponse

func ForBuildpackList

func ForBuildpackList(buildpackRecordList []repositories.BuildpackRecord, baseURL, requestURL url.URL) ListResponse

func ForDomainList

func ForDomainList(domainListRecords []repositories.DomainRecord, baseURL, requestURL url.URL) ListResponse

func ForDropletList

func ForDropletList(dropletRecordList []repositories.DropletRecord, baseURL, requestURL url.URL) ListResponse

func ForList

func ForList(resources []interface{}, baseURL, requestURL url.URL) ListResponse

func ForOrgList

func ForOrgList(orgs []repositories.OrgRecord, apiBaseURL, requestURL url.URL) ListResponse

func ForPackageList

func ForPackageList(packageRecordList []repositories.PackageRecord, baseURL, requestURL url.URL) ListResponse

func ForProcessList

func ForProcessList(processRecordList []repositories.ProcessRecord, baseURL, requestURL url.URL) ListResponse

func ForRouteList

func ForRouteList(routeRecordList []repositories.RouteRecord, baseURL, requestURL url.URL) ListResponse

func ForServiceBindingList

func ForServiceBindingList(serviceBindingRecord []repositories.ServiceBindingRecord, appRecords []repositories.AppRecord, baseURL, requestURL url.URL) ListResponse

func ForServiceInstanceList

func ForServiceInstanceList(serviceInstanceRecord []repositories.ServiceInstanceRecord, baseURL, requestURL url.URL) ListResponse

func ForServiceRouteBindingsList

func ForServiceRouteBindingsList(baseURL, requestURL url.URL) ListResponse

func ForSpaceList

func ForSpaceList(spaces []repositories.SpaceRecord, apiBaseURL, requestURL url.URL) ListResponse

type Metadata

type Metadata struct {
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}
type OrgLinks struct {
	Self          *Link `json:"self"`
	Domains       *Link `json:"domains,omitempty"`
	DefaultDomain *Link `json:"default_domain,omitempty"`
	Quota         *Link `json:"quota,omitempty"`
}

type OrgResponse

type OrgResponse struct {
	Name string `json:"name"`
	GUID string `json:"guid"`

	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
	Suspended     bool          `json:"suspended"`
	Relationships Relationships `json:"relationships"`
	Metadata      Metadata      `json:"metadata"`
	Links         OrgLinks      `json:"links"`
}

func ForCreateOrg

func ForCreateOrg(org repositories.OrgRecord, apiBaseURL url.URL) OrgResponse

type Organization

type Organization struct {
	Data *string `json:"data"`
}

type PackageData

type PackageData struct{}
type PackageLinks struct {
	Self     Link `json:"self"`
	Upload   Link `json:"upload"`
	Download Link `json:"download"`
	App      Link `json:"app"`
}

type PackageResponse

type PackageResponse struct {
	GUID          string        `json:"guid"`
	Type          string        `json:"type"`
	Data          PackageData   `json:"data"`
	State         string        `json:"state"`
	Relationships Relationships `json:"relationships"`
	Links         PackageLinks  `json:"links"`
	Metadata      Metadata      `json:"metadata"`
	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
}

func ForPackage

func ForPackage(record repositories.PackageRecord, baseURL url.URL) PackageResponse

type PageRef

type PageRef struct {
	HREF string `json:"href"`
}

type PaginationData

type PaginationData struct {
	TotalResults int     `json:"total_results"`
	TotalPages   int     `json:"total_pages"`
	First        PageRef `json:"first"`
	Last         PageRef `json:"last"`
	Next         *int    `json:"next"`
	Previous     *int    `json:"previous"`
}

type PresentedError

type PresentedError struct {
	Detail string `json:"detail"`
	Title  string `json:"title"`
	Code   int    `json:"code"`
}

type ProcessDetails

type ProcessDetails struct{}

type ProcessInstancePort

type ProcessInstancePort struct {
	External             int `json:"external"`
	Internal             int `json:"internal"`
	ExternalTLSProxyPort int `json:"external_tls_proxy_port"`
	InternalTLSProxyPort int `json:"internal_tls_proxy_port"`
}
type ProcessLinks struct {
	Self  Link `json:"self"`
	Scale Link `json:"scale"`
	App   Link `json:"app"`
	Space Link `json:"space"`
	Stats Link `json:"stats"`
}

type ProcessResponse

type ProcessResponse struct {
	GUID          string                     `json:"guid"`
	Type          string                     `json:"type"`
	Command       string                     `json:"command"`
	Instances     int                        `json:"instances"`
	MemoryMB      int64                      `json:"memory_in_mb"`
	DiskQuotaMB   int64                      `json:"disk_in_mb"`
	HealthCheck   ProcessResponseHealthCheck `json:"health_check"`
	Relationships Relationships              `json:"relationships"`
	Metadata      Metadata                   `json:"metadata"`
	CreatedAt     string                     `json:"created_at"`
	UpdatedAt     string                     `json:"updated_at"`
	Links         ProcessLinks               `json:"links"`
}

func ForProcess

func ForProcess(responseProcess repositories.ProcessRecord, baseURL url.URL) ProcessResponse

type ProcessResponseHTTPHealthCheckData

type ProcessResponseHTTPHealthCheckData struct {
	Timeout           *int64 `json:"timeout"`
	InvocationTimeout *int64 `json:"invocation_timeout"`
	HTTPEndpoint      string `json:"endpoint"`
}

type ProcessResponseHealthCheck

type ProcessResponseHealthCheck struct {
	Type string                         `json:"type"`
	Data ProcessResponseHealthCheckData `json:"data"`
}

type ProcessResponseHealthCheckData

type ProcessResponseHealthCheckData struct {
	Type              string `json:"-"`
	Timeout           int64  `json:"timeout"`
	InvocationTimeout int64  `json:"invocation_timeout"`
	HTTPEndpoint      string `json:"endpoint"`
}

func (ProcessResponseHealthCheckData) MarshalJSON

func (h ProcessResponseHealthCheckData) MarshalJSON() ([]byte, error)

type ProcessResponsePortHealthCheckData

type ProcessResponsePortHealthCheckData struct {
	Timeout           *int64 `json:"timeout"`
	InvocationTimeout *int64 `json:"invocation_timeout"`
}

type ProcessResponseProcessHealthCheckData

type ProcessResponseProcessHealthCheckData struct {
	Timeout *int64 `json:"timeout"`
}

type ProcessStatsResource

type ProcessStatsResource struct {
	Type             string                 `json:"type"`
	Index            int                    `json:"index"`
	State            string                 `json:"state"`
	Usage            ProcessUsage           `json:"usage"`
	Host             *string                `json:"host"`
	InstancePorts    *[]ProcessInstancePort `json:"instance_ports,omitempty"`
	Uptime           *int                   `json:"uptime"`
	MemQuota         *int                   `json:"mem_quota"`
	DiskQuota        *int                   `json:"disk_quota"`
	FDSQuota         *int                   `json:"fds_quota"`
	IsolationSegment *string                `json:"isolation_segment"`
	Details          *ProcessDetails        `json:"details"`
}

type ProcessStatsResponse

type ProcessStatsResponse struct {
	Resources []ProcessStatsResource `json:"resources"`
}

func ForProcessStats

func ForProcessStats(records []repositories.PodStatsRecord) ProcessStatsResponse

type ProcessUsage

type ProcessUsage struct {
	Time *string  `json:"time,omitempty"`
	CPU  *float64 `json:"cpu,omitempty"`
	Mem  *int64   `json:"mem,omitempty"`
	Disk *int64   `json:"disk,omitempty"`
}

type Relationship

type Relationship struct {
	Data *RelationshipData `json:"data"`
}

type RelationshipData

type RelationshipData struct {
	GUID string `json:"guid"`
}

type Relationships

type Relationships map[string]Relationship
type RoleLinks struct {
	Self         *Link `json:"self"`
	Space        *Link `json:"space,omitempty"`
	Organization *Link `json:"organization,omitempty"`
}

type RoleResponse

type RoleResponse struct {
	GUID string `json:"guid"`

	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
	Type          string        `json:"type"`
	Relationships Relationships `json:"relationships"`
	Links         RoleLinks     `json:"links"`
}

func ForCreateRole

func ForCreateRole(role repositories.RoleRecord, apiBaseURL url.URL) RoleResponse

type RootResponse

type RootResponse struct {
	Links   map[string]*APILink `json:"links"`
	CFOnK8s bool                `json:"cf_on_k8s"`
}

func GetRootResponse

func GetRootResponse(serverURL string) RootResponse

type RouteDestinationsResponse

type RouteDestinationsResponse struct {
	Destinations []routeDestination     `json:"destinations"`
	Links        routeDestinationsLinks `json:"links"`
}

func ForRouteDestinations

func ForRouteDestinations(route repositories.RouteRecord, baseURL url.URL) RouteDestinationsResponse

type RouteResponse

type RouteResponse struct {
	GUID         string             `json:"guid"`
	Protocol     string             `json:"protocol"`
	Port         *int               `json:"port"`
	Host         string             `json:"host"`
	Path         string             `json:"path"`
	URL          string             `json:"url"`
	Destinations []routeDestination `json:"destinations"`

	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
	Relationships Relationships `json:"relationships"`
	Metadata      Metadata      `json:"metadata"`
	Links         routeLinks    `json:"links"`
}

func ForRoute

func ForRoute(route repositories.RouteRecord, baseURL url.URL) RouteResponse

type ServiceBindingLastOperationResponse

type ServiceBindingLastOperationResponse struct {
	Type        string  `json:"type"`
	State       string  `json:"state"`
	Description *string `json:"description"`
	CreatedAt   string  `json:"created_at"`
	UpdatedAt   string  `json:"updated_at"`
}
type ServiceBindingLinks struct {
	App             Link `json:"app"`
	ServiceInstance Link `json:"service_instance"`
	Self            Link `json:"self"`
	Details         Link `json:"details"`
}

type ServiceBindingResponse

type ServiceBindingResponse struct {
	GUID          string                              `json:"guid"`
	Type          string                              `json:"type"`
	Name          *string                             `json:"name"`
	CreatedAt     string                              `json:"created_at"`
	UpdatedAt     string                              `json:"updated_at"`
	LastOperation ServiceBindingLastOperationResponse `json:"last_operation"`
	Relationships Relationships                       `json:"relationships"`
	Links         ServiceBindingLinks                 `json:"links"`
	Metadata      Metadata                            `json:"metadata"`
}

func ForServiceBinding

func ForServiceBinding(record repositories.ServiceBindingRecord, baseURL url.URL) ServiceBindingResponse
type ServiceInstanceLinks struct {
	Self                      Link `json:"self"`
	Space                     Link `json:"space"`
	Credentials               Link `json:"credentials"`
	ServiceCredentialBindings Link `json:"service_credential_bindings"`
	ServiceRouteBindings      Link `json:"service_route_bindings"`
}

type ServiceInstanceResponse

type ServiceInstanceResponse struct {
	Name            string        `json:"name"`
	GUID            string        `json:"guid"`
	Type            string        `json:"type"`
	Tags            []string      `json:"tags"`
	LastOperation   lastOperation `json:"last_operation"`
	RouteServiceURL *string       `json:"route_service_url"`
	SyslogDrainURL  *string       `json:"syslog_drain_url"`

	CreatedAt     string               `json:"created_at"`
	UpdatedAt     string               `json:"updated_at"`
	Relationships Relationships        `json:"relationships"`
	Metadata      Metadata             `json:"metadata"`
	Links         ServiceInstanceLinks `json:"links"`
}

func ForServiceInstance

func ForServiceInstance(serviceInstanceRecord repositories.ServiceInstanceRecord, baseURL url.URL) ServiceInstanceResponse

type ServiceRouteBinding

type ServiceRouteBinding struct{}

type SharedOrganizations

type SharedOrganizations struct {
	Data []string `json:"data"`
}
type SpaceLinks struct {
	Self         *Link `json:"self"`
	Organization *Link `json:"organization"`
}

type SpaceResponse

type SpaceResponse struct {
	Name          string        `json:"name"`
	GUID          string        `json:"guid"`
	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
	Links         SpaceLinks    `json:"links"`
	Metadata      Metadata      `json:"metadata"`
	Relationships Relationships `json:"relationships"`
}

func ForCreateSpace

func ForCreateSpace(space repositories.SpaceRecord, apiBaseURL url.URL) SpaceResponse

Jump to

Keyboard shortcuts

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