client

package
v2.2.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 BuildAddPayload

func BuildAddPayload(resumeAddBody string) ([]*resume.Resume, error)

BuildAddPayload builds the payload for the resume add endpoint from CLI flags.

func DecodeAddResponse

func DecodeAddResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeAddResponse returns a decoder for responses returned by the resume add endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeListResponse

func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeListResponse returns a decoder for responses returned by the resume list endpoint. restoreBody controls whether the response body should be restored after having been read.

func EncodeAddRequest

func EncodeAddRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeAddRequest returns an encoder for requests sent to the resume add server.

func ListResumePath

func ListResumePath() string

ListResumePath returns the URL path to the resume service list HTTP endpoint.

func NewListStoredResumeCollectionOK

func NewListStoredResumeCollectionOK(body ListResponseBody) resumeviews.StoredResumeCollectionView

NewListStoredResumeCollectionOK builds a "resume" service "list" endpoint result from a HTTP "OK" response.

func NewResumeAddEncoder

func NewResumeAddEncoder(encoderFn ResumeAddEncoderFunc) func(r *http.Request) goahttp.Encoder

NewResumeAddEncoder returns an encoder to encode the multipart request for the "resume" service "add" endpoint.

func ValidateEducationResponse

func ValidateEducationResponse(body *EducationResponse) (err error)

ValidateEducationResponse runs the validations defined on EducationResponse

func ValidateExperienceResponse

func ValidateExperienceResponse(body *ExperienceResponse) (err error)

ValidateExperienceResponse runs the validations defined on ExperienceResponse

func ValidateStoredResumeResponse

func ValidateStoredResumeResponse(body *StoredResumeResponse) (err error)

ValidateStoredResumeResponse runs the validations defined on StoredResumeResponse

Types

type Client

type Client struct {
	// List Doer is the HTTP client used to make requests to the list endpoint.
	ListDoer goahttp.Doer

	// Add Doer is the HTTP client used to make requests to the add endpoint.
	AddDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the resume service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the resume service servers.

func (*Client) Add

func (c *Client) Add(resumeAddEncoderFn ResumeAddEncoderFunc) goa.Endpoint

Add returns an endpoint that makes HTTP requests to the resume service add server.

func (*Client) BuildAddRequest

func (c *Client) BuildAddRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildAddRequest instantiates a HTTP request object with method and path set to call the "resume" service "add" endpoint

func (*Client) BuildListRequest

func (c *Client) BuildListRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildListRequest instantiates a HTTP request object with method and path set to call the "resume" service "list" endpoint

func (*Client) List

func (c *Client) List() goa.Endpoint

List returns an endpoint that makes HTTP requests to the resume service list server.

type EducationRequestBody

type EducationRequestBody struct {
	// Name of the institution
	Institution string `form:"institution" json:"institution" xml:"institution"`
	// Major name
	Major string `form:"major" json:"major" xml:"major"`
}

EducationRequestBody is used to define fields on request body types.

type EducationResponse

type EducationResponse 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"`
}

EducationResponse is used to define fields on response body types.

type ExperienceRequestBody

type ExperienceRequestBody 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"`
}

ExperienceRequestBody is used to define fields on request body types.

type ExperienceResponse

type ExperienceResponse 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"`
}

ExperienceResponse is used to define fields on response body types.

type ListResponseBody

type ListResponseBody []*StoredResumeResponse

ListResponseBody is the type of the "resume" service "list" endpoint HTTP response body.

type ResumeAddEncoderFunc

type ResumeAddEncoderFunc func(*multipart.Writer, []*resume.Resume) error

ResumeAddEncoderFunc is the type to encode multipart request for the "resume" service "add" endpoint.

type ResumeRequestBody

type ResumeRequestBody struct {
	// Name in the resume
	Name string `form:"name" json:"name" xml:"name"`
	// 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.

func NewResumeRequestBody

func NewResumeRequestBody(p []*resume.Resume) []*ResumeRequestBody

NewResumeRequestBody builds the HTTP request body from the payload of the "add" endpoint of the "resume" service.

type StoredResumeResponse

type StoredResumeResponse struct {
	// ID of the resume
	ID *int `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Time when resume was created
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Name in the resume
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Experience section in the resume
	Experience []*ExperienceResponse `form:"experience,omitempty" json:"experience,omitempty" xml:"experience,omitempty"`
	// Education section in the resume
	Education []*EducationResponse `form:"education,omitempty" json:"education,omitempty" xml:"education,omitempty"`
}

StoredResumeResponse is used to define fields on response body types.

Jump to

Keyboard shortcuts

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