presenter

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobGUIDDelimiter = "~"

	StateComplete   = "COMPLETE"
	StateFailed     = "FAILED"
	StateProcessing = "PROCESSING"
	StatePolling    = "POLLING"

	AppDeleteOperation           = "app.delete"
	OrgDeleteOperation           = "org.delete"
	RouteDeleteOperation         = "route.delete"
	SpaceApplyManifestOperation  = "space.apply_manifest"
	SpaceDeleteOperation         = "space.delete"
	DomainDeleteOperation        = "domain.delete"
	RoleDeleteOperation          = "role.delete"
	ServiceBrokerCreateOperation = "service_broker.create"
	ServiceBrokerDeleteOperation = "service_broker.delete"
	ServiceBrokerUpdateOperation = "service_broker.update"

	ManagedServiceInstanceResourceType    = "managed_service_instance"
	ManagedServiceBindingResourceType     = "managed_service_binding"
	ManagedServiceInstanceCreateOperation = ManagedServiceInstanceResourceType + ".create"
	ManagedServiceInstanceDeleteOperation = ManagedServiceInstanceResourceType + ".delete"
	ManagedServiceBindingCreateOperation  = ManagedServiceBindingResourceType + ".create"
	ManagedServiceBindingDeleteOperation  = ManagedServiceBindingResourceType + ".delete"
)
View Source
const V3APIVersion = "3.117.0+cf-k8s"

Variables

This section is empty.

Functions

func ForRelationships added in v0.13.0

func ForRelationships(relationships map[string]string) map[string]ToOneRelationship

func JobURLForRedirects added in v0.2.0

func JobURLForRedirects(resourceGUID string, operation string, baseURL url.URL) string

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]any    `json:"system_env_json"`
	ApplicationEnvJSON   map[string]any    `json:"application_env_json"`
}

func ForAppEnv

func ForAppEnv(envVarRecord repositories.AppEnvRecord) 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 map[string]ToOneRelationship `json:"relationships"`
	Lifecycle     Lifecycle                    `json:"lifecycle"`
	Metadata      Metadata                     `json:"metadata"`
	Links         AppLinks                     `json:"links"`
}

func ForApp

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

type AppSSHEnabled added in v0.8.0

type AppSSHEnabled struct {
	Enabled bool   `json:"enabled"`
	Reason  string `json:"reason"`
}

type BrokerCatalogFeatures added in v0.15.0

type BrokerCatalogFeatures struct {
	PlanUpdateable       bool `json:"plan_updateable"`
	Bindable             bool `json:"bindable"`
	InstancesRetrievable bool `json:"instances_retrievable"`
	BindingsRetrievable  bool `json:"bindings_retrievable"`
	AllowContextUpdates  bool `json:"allow_context_updates"`
}

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   map[string]ToOneRelationship `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, _ url.URL, includes ...include.Resource) 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 {
	Data  RelationshipData    `json:"data"`
	Links CurrentDropletLinks `json:"links"`
}

func ForCurrentDroplet

func ForCurrentDroplet(record repositories.CurrentDropletRecord, baseURL url.URL) CurrentDropletResponse
type DeploymentLinks struct {
	Self Link `json:"self"`
	App  Link `json:"app"`
}

type DeploymentResponse added in v0.8.0

type DeploymentResponse struct {
	GUID          string                       `json:"guid"`
	Status        DeploymentStatus             `json:"status"`
	Droplet       DropletGUID                  `json:"droplet"`
	Relationships map[string]ToOneRelationship `json:"relationships"`
	Links         DeploymentLinks              `json:"links"`
	CreatedAt     string                       `json:"created_at"`
	UpdatedAt     string                       `json:"updated_at"`
}

func ForDeployment added in v0.8.0

func ForDeployment(responseDeployment repositories.DeploymentRecord, baseURL url.URL, includes ...include.Resource) DeploymentResponse

type DeploymentStatus added in v0.8.0

type DeploymentStatus struct {
	Value  string `json:"value"`
	Reason string `json:"reason"`
}
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, includes ...include.Resource) DomainResponse

type DropletGUID added in v0.8.0

type DropletGUID struct {
	Guid string `json:"guid"`
}

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     map[string]ToOneRelationship `json:"relationships"`
	Metadata          Metadata                     `json:"metadata"`
	Links             map[string]*Link             `json:"links"`
}

func ForDroplet

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

type Envelope added in v0.15.0

type Envelope struct {
	Timestamp int64             `json:"timestamp"`
	Tags      map[string]string `json:"tags,omitempty"`
}

type ErrorsResponse

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

type Gauge added in v0.15.0

type Gauge struct {
	Metrics map[string]GaugeValue `json:"metrics"`
}

type GaugeEnvelope added in v0.15.0

type GaugeEnvelope struct {
	Envelope
	Gauge Gauge `json:"gauge"`
}

type GaugeFloat added in v0.15.0

type GaugeFloat float64

func (GaugeFloat) MarshalJSON added in v0.15.0

func (f GaugeFloat) MarshalJSON() ([]byte, error)

type GaugeInt added in v0.15.0

type GaugeInt int64

func (GaugeInt) MarshalJSON added in v0.15.0

func (i GaugeInt) MarshalJSON() ([]byte, error)

type GaugeNumber added in v0.15.0

type GaugeNumber interface {
	MarshalJSON() ([]byte, error)
}

type GaugeValue added in v0.15.0

type GaugeValue struct {
	Unit  string      `json:"unit"`
	Value GaugeNumber `json:"value"`
}

type IdentityResponse

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

func ForWhoAmI

func ForWhoAmI(identity authorization.Identity) IdentityResponse

type InfoCLIVersion added in v0.12.0

type InfoCLIVersion struct {
	Minimum     string `json:"minimum"`
	Recommended string `json:"recommended"`
}

type InfoV3Response added in v0.12.0

type InfoV3Response struct {
	Build       string                 `json:"build"`
	CLIVersion  InfoCLIVersion         `json:"cli_version"`
	Description string                 `json:"description"`
	Name        string                 `json:"name"`
	Version     string                 `json:"version"`
	Custom      map[string]interface{} `json:"custom"`

	Links map[string]Link `json:"links"`
}

func ForInfoV3 added in v0.12.0

func ForInfoV3(baseURL url.URL, infoConfig config.InfoConfig) InfoV3Response

type InputParameterSchema added in v0.15.0

type InputParameterSchema struct {
	Parameters map[string]any `json:"parameters,omitempty"`
}

type Job added in v0.8.0

type Job struct {
	GUID         string
	Type         string
	ResourceGUID string
	ResourceType string
}

func JobFromGUID added in v0.8.0

func JobFromGUID(guid string) (Job, bool)
type JobLinks struct {
	Self  Link  `json:"self"`
	Space *Link `json:"space,omitempty"`
}

type JobResponse

type JobResponse struct {
	GUID      string             `json:"guid"`
	Errors    []JobResponseError `json:"errors"`
	Operation string             `json:"operation"`
	State     string             `json:"state"`
	Links     JobLinks           `json:"links"`
}

func ForJob added in v0.8.0

func ForJob(job Job, errors []JobResponseError, state repositories.ResourceState, baseURL url.URL) JobResponse

func ForManifestApplyJob

func ForManifestApplyJob(job Job, baseURL url.URL) JobResponse

type JobResponseError added in v0.8.0

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

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,omitempty"`
}
type Link struct {
	HRef   string `json:"href,omitempty"`
	Method string `json:"method,omitempty"`
}

type ListResponse

type ListResponse[T any] struct {
	PaginationData PaginationData   `json:"pagination"`
	Resources      []T              `json:"resources"`
	Included       map[string][]any `json:"included,omitempty"`
}

func ForList

func ForList[T, S any](itemPresenter itemPresenter[T, S], resources []T, baseURL, requestURL url.URL, includes ...include.Resource) ListResponse[S]

func ForProcessList

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

func ForServiceBindingList

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

func ForServiceRouteBindingsList

func ForServiceRouteBindingsList(baseURL, requestURL url.URL) ListResponse[any]

type Log added in v0.15.0

type Log struct {
	Payload []byte  `json:"payload"`
	Type    LogType `json:"type"`
}

type LogCacheReadResponse

type LogCacheReadResponse[E isLogCacheEnvelope] struct {
	Envelopes LogCacheReadResponseEnvelopes[E] `json:"envelopes"`
}

func ForStats added in v0.15.0

type LogCacheReadResponseEnvelopes

type LogCacheReadResponseEnvelopes[E isLogCacheEnvelope] struct {
	Batch []E `json:"batch"`
}

type LogEnvelope added in v0.15.0

type LogEnvelope struct {
	Envelope
	Log Log `json:"log"`
}

type LogType added in v0.15.0

type LogType int
const (
	LOG_OUT LogType = iota
)

type MaintenanceInfo added in v0.15.0

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

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 map[string]ToOneRelationship `json:"relationships,omitempty"`
	Metadata      Metadata                     `json:"metadata"`
	Links         OrgLinks                     `json:"links"`
}

func ForOrg added in v0.3.0

func ForOrg(org repositories.OrgRecord, apiBaseURL url.URL, includes ...include.Resource) OrgResponse

type Organization

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

type PackageData

type PackageData struct {
	Image string `json:"image,omitempty"`
}
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 map[string]ToOneRelationship `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, includes ...include.Resource) 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 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     int32                        `json:"instances"`
	MemoryMB      int64                        `json:"memory_in_mb"`
	DiskQuotaMB   int64                        `json:"disk_in_mb"`
	HealthCheck   ProcessResponseHealthCheck   `json:"health_check"`
	Relationships map[string]ToOneRelationship `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           *int32 `json:"timeout"`
	InvocationTimeout *int32 `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           int32  `json:"timeout"`
	InvocationTimeout int32  `json:"invocation_timeout"`
	HTTPEndpoint      string `json:"endpoint"`
}

func (ProcessResponseHealthCheckData) MarshalJSON

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

type ProcessResponsePortHealthCheckData

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

type ProcessResponseProcessHealthCheckData

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

type ProcessStatsResource

type ProcessStatsResource struct {
	Type      string        `json:"type"`
	Index     int           `json:"index"`
	State     string        `json:"state"`
	Usage     *ProcessUsage `json:"usage,omitempty"`
	MemQuota  *int64        `json:"mem_quota,omitempty"`
	DiskQuota *int64        `json:"disk_quota,omitempty"`
	Uptime    *int64        `json:"uptime,omitempty"`
}

type ProcessStatsResponse

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

func ForProcessStats

func ForProcessStats(gauges []stats.ProcessGauges, instancesState []stats.ProcessInstanceState, now time.Time) 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 {
	GUID string `json:"guid"`
}

type RelationshipData

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

type Resource added in v0.13.0

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

func NewResource added in v0.13.0

func NewResource(serverURL url.URL) *Resource

func (*Resource) PresentResource added in v0.13.0

func (r *Resource) PresentResource(resource relationships.Resource) any
type RoleLinks struct {
	Self         *Link `json:"self"`
	User         *Link `json:"user"`
	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 map[string]ToOneRelationship `json:"relationships"`
	Links         RoleLinks                    `json:"links"`
}

func ForRole added in v0.7.1

func ForRole(role repositories.RoleRecord, apiBaseURL url.URL, includes ...include.Resource) RoleResponse

type RootResponse

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

func ForRoot added in v0.8.0

func ForRoot(baseURL url.URL, uaaConfig config.UAA, logCacheURL url.URL) RootResponse

type RootV3Response added in v0.8.0

type RootV3Response struct {
	Links map[string]Link `json:"links"`
}

func ForRootV3 added in v0.8.0

func ForRootV3(baseURL url.URL) RootV3Response

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 map[string]ToOneRelationship `json:"relationships"`
	Metadata      Metadata                     `json:"metadata"`
	Links         routeLinks                   `json:"links"`
}

func ForRoute

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

type ServiceBindingDetailsResponse added in v0.15.0

type ServiceBindingDetailsResponse struct {
	Credentials map[string]any `json:"credentials"`
}

func ForServiceBindingDetails added in v0.15.0

func ForServiceBindingDetails(serviceBindingDetailsRecord repositories.ServiceBindingDetailsRecord) ServiceBindingDetailsResponse

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 map[string]ToOneRelationship        `json:"relationships"`
	Links         ServiceBindingLinks                 `json:"links"`
	Metadata      Metadata                            `json:"metadata"`
}

func ForServiceBinding

func ForServiceBinding(record repositories.ServiceBindingRecord, baseURL url.URL, includes ...include.Resource) ServiceBindingResponse

type ServiceBindingSchema added in v0.15.0

type ServiceBindingSchema struct {
	Create InputParameterSchema `json:"create"`
}

type ServiceBrokerCatalog added in v0.15.0

type ServiceBrokerCatalog struct {
	ID       string                `json:"id"`
	Metadata map[string]any        `json:"metadata"`
	Features BrokerCatalogFeatures `json:"features"`
}
type ServiceBrokerLinks struct {
	Self             Link `json:"self"`
	ServiceOfferings Link `json:"service_offerings"`
}

type ServiceBrokerResponse added in v0.13.0

type ServiceBrokerResponse struct {
	GUID      string             `json:"guid"`
	Name      string             `json:"name"`
	URL       string             `json:"url"`
	CreatedAt time.Time          `json:"created_at"`
	UpdatedAt *time.Time         `json:"updated_at"`
	Metadata  Metadata           `json:"metadata"`
	Links     ServiceBrokerLinks `json:"links"`
}

func ForServiceBroker added in v0.13.0

func ForServiceBroker(serviceBrokerRecord repositories.ServiceBrokerRecord, baseURL url.URL, includes ...include.Resource) ServiceBrokerResponse
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    map[string]ToOneRelationship `json:"relationships"`
	Metadata         Metadata                     `json:"metadata"`
	Links            ServiceInstanceLinks         `json:"links"`
	Included         map[string][]any             `json:"included,omitempty"`
	MaintenanceInfo  *MaintenanceInfo             `json:"maintenance_info,omitempty"`
	UpgradeAvailable *bool                        `json:"upgrade_available,omitempty"`
}

func ForServiceInstance

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

type ServiceInstanceSchema added in v0.15.0

type ServiceInstanceSchema struct {
	Create InputParameterSchema `json:"create"`
	Update InputParameterSchema `json:"update"`
}
type ServiceOfferingLinks struct {
	Self          Link `json:"self"`
	ServicePlans  Link `json:"service_plans"`
	ServiceBroker Link `json:"service_broker"`
}

type ServiceOfferingRelationships added in v0.13.0

type ServiceOfferingRelationships struct {
	ServiceBroker ToOneRelationship `json:"service_broker"`
}

type ServiceOfferingResponse added in v0.13.0

type ServiceOfferingResponse struct {
	Name             string                       `json:"name"`
	GUID             string                       `json:"guid"`
	CreatedAt        time.Time                    `json:"created_at"`
	UpdatedAt        *time.Time                   `json:"updated_at"`
	Metadata         Metadata                     `json:"metadata"`
	Description      string                       `json:"description"`
	Tags             []string                     `json:"tags,omitempty"`
	Requires         []string                     `json:"requires,omitempty"`
	DocumentationURL *string                      `json:"documentation_url"`
	BrokerCatalog    ServiceBrokerCatalog         `json:"broker_catalog"`
	Relationships    ServiceOfferingRelationships `json:"relationships"`
	Links            ServiceOfferingLinks         `json:"links"`
	Included         map[string][]any             `json:"included,omitempty"`
}

func ForServiceOffering added in v0.13.0

func ForServiceOffering(serviceOffering repositories.ServiceOfferingRecord, baseURL url.URL, includes ...include.Resource) ServiceOfferingResponse

type ServicePlanBrokerCatalog added in v0.15.0

type ServicePlanBrokerCatalog struct {
	ID       string              `json:"id"`
	Metadata map[string]any      `json:"metadata,omitempty"`
	Features ServicePlanFeatures `json:"features"`
}

type ServicePlanFeatures added in v0.15.0

type ServicePlanFeatures struct {
	PlanUpdateable bool `json:"plan_updateable"`
	Bindable       bool `json:"bindable"`
}
type ServicePlanLinks struct {
	Self            Link `json:"self"`
	ServiceOffering Link `json:"service_offering"`
	Visibility      Link `json:"visibility"`
}

type ServicePlanRelationships added in v0.13.0

type ServicePlanRelationships struct {
	ServiceOffering ToOneRelationship `json:"service_offering"`
}

type ServicePlanResponse added in v0.13.0

type ServicePlanResponse struct {
	Name            string                       `json:"name"`
	GUID            string                       `json:"guid"`
	CreatedAt       time.Time                    `json:"created_at"`
	UpdatedAt       *time.Time                   `json:"updated_at"`
	Metadata        Metadata                     `json:"metadata"`
	Free            bool                         `json:"free"`
	Description     string                       `json:"description,omitempty"`
	BrokerCatalog   ServicePlanBrokerCatalog     `json:"broker_catalog"`
	Schemas         ServicePlanSchemas           `json:"schemas"`
	MaintenanceInfo MaintenanceInfo              `json:"maintenance_info"`
	VisibilityType  string                       `json:"visibility_type"`
	Available       bool                         `json:"available"`
	Relationships   map[string]ToOneRelationship `json:"relationships"`
	Links           ServicePlanLinks             `json:"links"`
}

func ForServicePlan added in v0.13.0

func ForServicePlan(servicePlan repositories.ServicePlanRecord, baseURL url.URL, includes ...include.Resource) ServicePlanResponse

type ServicePlanSchemas added in v0.15.0

type ServicePlanSchemas struct {
	ServiceInstance ServiceInstanceSchema `json:"service_instance"`
	ServiceBinding  ServiceBindingSchema  `json:"service_binding"`
}

type ServicePlanVisibilityResponse added in v0.13.0

type ServicePlanVisibilityResponse struct {
	Type          string                   `json:"type"`
	Organizations []VisibilityOrganization `json:"organizations,omitempty"`
}

func ForServicePlanVisibility added in v0.13.0

func ForServicePlanVisibility(plan repositories.ServicePlanRecord, _ url.URL) ServicePlanVisibilityResponse

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 map[string]ToOneRelationship `json:"relationships"`
}

func ForSpace added in v0.3.0

func ForSpace(space repositories.SpaceRecord, apiBaseURL url.URL, includes ...include.Resource) SpaceResponse
type StackLinks struct {
	Self Link `json:"self"`
}

type StackResponse added in v0.14.0

type StackResponse struct {
	GUID        string     `json:"guid"`
	CreatedAt   string     `json:"created_at"`
	UpdatedAt   string     `json:"updated_at"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Metadata    Metadata   `json:"metadata"`
	Links       StackLinks `json:"links"`
}

func ForStack added in v0.14.0

func ForStack(stackRecord repositories.StackRecord, baseURL url.URL, includes ...include.Resource) StackResponse
type TaskLinks struct {
	Self    Link `json:"self"`
	App     Link `json:"app"`
	Droplet Link `json:"droplet"`
	Cancel  Link `json:"cancel"`
}

type TaskResponse added in v0.2.0

type TaskResponse struct {
	Name          string                       `json:"name"`
	GUID          string                       `json:"guid"`
	Command       string                       `json:"command,omitempty"`
	DropletGUID   string                       `json:"droplet_guid"`
	Metadata      Metadata                     `json:"metadata"`
	Relationships map[string]ToOneRelationship `json:"relationships"`
	Links         TaskLinks                    `json:"links"`
	SequenceID    int64                        `json:"sequence_id"`
	CreatedAt     string                       `json:"created_at"`
	UpdatedAt     string                       `json:"updated_at"`
	MemoryMB      int64                        `json:"memory_in_mb"`
	DiskMB        int64                        `json:"disk_in_mb"`
	State         string                       `json:"state"`
	Result        TaskResult                   `json:"result"`
}

func ForTask added in v0.2.0

func ForTask(responseTask repositories.TaskRecord, baseURL url.URL, includes ...include.Resource) TaskResponse

type TaskResult added in v0.2.0

type TaskResult struct {
	FailureReason *string `json:"failure_reason"`
}

type ToOneRelationship added in v0.15.0

type ToOneRelationship struct {
	Data Relationship `json:"data"`
}

type UserResponse added in v0.7.0

type UserResponse struct {
	Name string `json:"username"`
	GUID string `json:"guid"`
}

func ForUser added in v0.7.0

func ForUser(name string, _ url.URL, includes ...include.Resource) UserResponse

type VisibilityOrganization added in v0.15.0

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

Jump to

Keyboard shortcuts

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