Documentation ¶
Index ¶
- func AddResumePath() string
- func DecodeAddRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
- func EncodeAddResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func EncodeListResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
- func ListResumePath() string
- func Mount(mux goahttp.Muxer, h *Server)
- func MountAddHandler(mux goahttp.Muxer, h http.Handler)
- func MountListHandler(mux goahttp.Muxer, h http.Handler)
- func NewAddHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewAddResume(body []*ResumeRequestBody) []*resume.Resume
- func NewListHandler(endpoint goa.Endpoint, mux goahttp.Muxer, ...) http.Handler
- func NewResumeAddDecoder(mux goahttp.Muxer, resumeAddDecoderFn ResumeAddDecoderFunc) func(r *http.Request) goahttp.Decoder
- func ValidateEducationRequestBody(body *EducationRequestBody) (err error)
- func ValidateExperienceRequestBody(body *ExperienceRequestBody) (err error)
- func ValidateResumeRequestBody(body *ResumeRequestBody) (err error)
- type EducationRequestBody
- type EducationResponse
- type ErrorNamer
- type ExperienceRequestBody
- type ExperienceResponse
- type MountPoint
- type ResumeAddDecoderFunc
- type ResumeRequestBody
- type Server
- type StoredResumeResponse
- type StoredResumeResponseCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddResumePath ¶
func AddResumePath() string
AddResumePath returns the URL path to the resume service add HTTP endpoint.
func DecodeAddRequest ¶
func DecodeAddRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)
DecodeAddRequest returns a decoder for requests sent to the resume add endpoint.
func EncodeAddResponse ¶
func EncodeAddResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeAddResponse returns an encoder for responses returned by the resume add endpoint.
func EncodeListResponse ¶
func EncodeListResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error
EncodeListResponse returns an encoder for responses returned by the resume list endpoint.
func ListResumePath ¶
func ListResumePath() string
ListResumePath returns the URL path to the resume service list HTTP endpoint.
func MountAddHandler ¶
MountAddHandler configures the mux to serve the "resume" service "add" endpoint.
func MountListHandler ¶
MountListHandler configures the mux to serve the "resume" service "list" endpoint.
func NewAddHandler ¶
func NewAddHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewAddHandler creates a HTTP handler which loads the HTTP request and calls the "resume" service "add" endpoint.
func NewAddResume ¶
func NewAddResume(body []*ResumeRequestBody) []*resume.Resume
NewAddResume builds a resume service add endpoint payload.
func NewListHandler ¶
func NewListHandler( endpoint goa.Endpoint, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, ) http.Handler
NewListHandler creates a HTTP handler which loads the HTTP request and calls the "resume" service "list" endpoint.
func NewResumeAddDecoder ¶
func NewResumeAddDecoder(mux goahttp.Muxer, resumeAddDecoderFn ResumeAddDecoderFunc) func(r *http.Request) goahttp.Decoder
NewResumeAddDecoder returns a decoder to decode the multipart request for the "resume" service "add" endpoint.
func ValidateEducationRequestBody ¶
func ValidateEducationRequestBody(body *EducationRequestBody) (err error)
ValidateEducationRequestBody runs the validations defined on EducationRequestBody
func ValidateExperienceRequestBody ¶
func ValidateExperienceRequestBody(body *ExperienceRequestBody) (err error)
ValidateExperienceRequestBody runs the validations defined on ExperienceRequestBody
func ValidateResumeRequestBody ¶
func ValidateResumeRequestBody(body *ResumeRequestBody) (err error)
ValidateResumeRequestBody runs the validations defined on ResumeRequestBody
Types ¶
type EducationRequestBody ¶
type EducationRequestBody struct { // Name of the institution Institution *string `form:"institution,omitempty" json:"institution,omitempty" xml:"institution,omitempty"` // Major name Major *string `form:"major,omitempty" json:"major,omitempty" xml:"major,omitempty"` }
EducationRequestBody is used to define fields on request body types.
type EducationResponse ¶
type EducationResponse struct { // Name of the institution Institution string `form:"institution" json:"institution" xml:"institution"` // Major name Major string `form:"major" json:"major" xml:"major"` }
EducationResponse is used to define fields on response body types.
type ErrorNamer ¶
type ErrorNamer interface {
ErrorName() string
}
ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.
type ExperienceRequestBody ¶
type ExperienceRequestBody struct { // Name of the company Company *string `form:"company,omitempty" json:"company,omitempty" xml:"company,omitempty"` // Name of the role in the company Role *string `form:"role,omitempty" json:"role,omitempty" xml:"role,omitempty"` // Duration (in years) in the company Duration *int `form:"duration,omitempty" json:"duration,omitempty" xml:"duration,omitempty"` }
ExperienceRequestBody is used to define fields on request body types.
type ExperienceResponse ¶
type ExperienceResponse struct { // Name of the company Company string `form:"company" json:"company" xml:"company"` // Name of the role in the company Role string `form:"role" json:"role" xml:"role"` // Duration (in years) in the company Duration int `form:"duration" json:"duration" xml:"duration"` }
ExperienceResponse is used to define fields on response body types.
type MountPoint ¶
type MountPoint struct { // Method is the name of the service method served by the mounted HTTP handler. Method string // Verb is the HTTP method used to match requests to the mounted handler. Verb string // Pattern is the HTTP request path pattern used to match requests to the // mounted handler. Pattern string }
MountPoint holds information about the mounted endpoints.
type ResumeAddDecoderFunc ¶
ResumeAddDecoderFunc is the type to decode multipart request for the "resume" service "add" endpoint.
type ResumeRequestBody ¶
type ResumeRequestBody struct { // Name in the resume Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` // Experience section in the resume Experience []*ExperienceRequestBody `form:"experience,omitempty" json:"experience,omitempty" xml:"experience,omitempty"` // Education section in the resume Education []*EducationRequestBody `form:"education,omitempty" json:"education,omitempty" xml:"education,omitempty"` }
ResumeRequestBody is used to define fields on request body types.
type Server ¶
type Server struct { Mounts []*MountPoint List http.Handler Add http.Handler }
Server lists the resume service endpoint HTTP handlers.
func New ¶
func New( e *resume.Endpoints, mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder, encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, errhandler func(context.Context, http.ResponseWriter, error), formatter func(err error) goahttp.Statuser, resumeAddDecoderFn ResumeAddDecoderFunc, ) *Server
New instantiates HTTP handlers for all the resume service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.
type StoredResumeResponse ¶
type StoredResumeResponse struct { // ID of the resume ID int `form:"id" json:"id" xml:"id"` // Name in the resume Name string `form:"name" json:"name" xml:"name"` // Experience section in the resume Experience []*ExperienceResponse `form:"experience" json:"experience" xml:"experience"` // Education section in the resume Education []*EducationResponse `form:"education" json:"education" xml:"education"` // Time when resume was created CreatedAt string `form:"created_at" json:"created_at" xml:"created_at"` }
StoredResumeResponse is used to define fields on response body types.
type StoredResumeResponseCollection ¶
type StoredResumeResponseCollection []*StoredResumeResponse
StoredResumeResponseCollection is the type of the "resume" service "list" endpoint HTTP response body.
func NewStoredResumeResponseCollection ¶
func NewStoredResumeResponseCollection(res resumeviews.StoredResumeCollectionView) StoredResumeResponseCollection
NewStoredResumeResponseCollection builds the HTTP response body from the result of the "list" endpoint of the "resume" service.