Documentation ¶
Index ¶
- Constants
- func Initialize(conf *config.Config) (err error)
- type MetaOutput
- type Metadata
- type Response
- func (r *Response) AttachContents(c seeker.Output) *Response
- func (r Response) Bytes() []byte
- func (r *Response) Code(code int) *Response
- func (r *Response) Err(e string) *Response
- func (r *Response) Message(m string) *Response
- func (r Response) String() string
- func (r *Response) Warn(w string) *Response
- func (r *Response) Write()
- type SeekerHandler
Constants ¶
const ( // ConvertGUIDKey is the HTTP query key for the GUID to search for in the // Convert API call ConvertGUIDKey = "guid" // ConvertOrgNameKey is the HTTP query key for the Org Name to search for in // the Convert API call ConvertOrgNameKey = "org_name" // ConvertSpaceNameKey is the HTTP query key for the Space Name to search for in the Convert API call // call. ConvertSpaceNameKey = "space_name" // ConvertAppNameKey is the HTTP query key for the App Name to search for in // the Convert API call. ConvertAppNameKey = "app_name" )
const ( // FindAppGUIDKey is the HTTP query key for the App GUID to the Find API call. FindAppGUIDKey = "app_guid" // FindOrgNameKey is the HTTP query key for the Org Name to the Find API call. FindOrgNameKey = "org_name" // FindSpaceNameKey is the HTTP query key for the Space Name to the Find API // call. FindSpaceNameKey = "space_name" // FindAppNameKey is the HTTP query key for the App Name to the Find API call. FindAppNameKey = "app_name" )
const ( //FindEndpoint is the URL endpoint corresponding to calling the Find command FindEndpoint = "/v1/apps" // MetaEndpoint is the URL endpoint corresponding to getting meta information // about this cfseeker server MetaEndpoint = "/v1/meta" // InvalidateBOSHEndpoint is the endpoint corresponding to manipulation of the // BOSH VM info cache InvalidateBOSHEndpoint = "/v1/cache/bosh" //WebEndpoint is the path to the web UI WebEndpoint = "/" //ConvertEndpoint is the path corresponding to the Convert API call ConvertEndpoint = "/v1/convert" )
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
Initialize reads in the given configuration struct and performs the steps necessary to prepare the server for launch
Types ¶
type MetaOutput ¶
type MetaOutput struct {
Version string `json:"version" yaml:"version"`
}
MetaOutput gives meta information about this cfseeker server.
func (*MetaOutput) ReceiveJSON ¶ added in v1.1.0
func (m *MetaOutput) ReceiveJSON(j []byte) (err error)
ReceiveJSON makes MetaOutput an implementation of SeekerOutput
type Metadata ¶
type Metadata struct { Error string `json:"error,omitempty"` Warning string `json:"warning,omitempty"` Message string `json:"message,omitempty"` }
Metadata has additional information about an API Response, like error messages
type Response ¶
type Response struct { Meta *Metadata `json:"meta,omitempty"` Contents seeker.Output `json:"contents,omitempty"` // contains filtered or unexported fields }
Response is the structured response of the CFSeeker API
func NewResponse ¶
func NewResponse(w http.ResponseWriter) *Response
NewResponse returns a pointer to an empty Response struct
func (*Response) AttachContents ¶
AttachContents takes the given interface and assigns it as the response contents
func (*Response) Err ¶
Err takes the receiver Response, attaches the given message as an error, and then returns the Response object.
func (*Response) Message ¶
Message takes the receiver Response, attaches the given message as a informational message, and then returns the Response object.
type SeekerHandler ¶
SeekerHandler is a modified version of http.HandlerFunc that receives a Seeker struct that can be used to perform operations