Documentation
¶
Index ¶
- type DownloadExtRequest
- type DownloadExtResponse
- type DownloadRequest
- type DownloadResponse
- type FirstNameRequest
- type FirstNameResponse
- type LastNameRequest
- type LastNameResponse
- type NameRequest
- type NameService
- type NameServiceHandler
- func (svc NameServiceHandler) Download(ctx context.Context, req *DownloadRequest) (*DownloadResponse, error)
- func (svc NameServiceHandler) DownloadExt(ctx context.Context, req *DownloadExtRequest) (*DownloadExtResponse, error)
- func (svc NameServiceHandler) FirstName(ctx context.Context, req *FirstNameRequest) (*FirstNameResponse, error)
- func (svc NameServiceHandler) LastName(ctx context.Context, req *LastNameRequest) (*LastNameResponse, error)
- func (svc NameServiceHandler) SortName(ctx context.Context, req *SortNameRequest) (*SortNameResponse, error)
- func (svc NameServiceHandler) Split(ctx context.Context, req *SplitRequest) (*SplitResponse, error)
- type SortNameRequest
- type SortNameResponse
- type SplitRequest
- type SplitResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadExtRequest ¶ added in v1.1.0
type DownloadExtRequest struct {
// Name is the full name we're going to process.
Name string
// Ext is the file extension we'll use for the resulting file (also used in the content type)
Ext string
}
DownloadExtRequest is the input for the DownloadExt function.
type DownloadExtResponse ¶ added in v1.1.0
type DownloadExtResponse struct {
DownloadResponse
// contains filtered or unexported fields
}
DownloadExtResponse is the output for the DownloadExt function.
func (DownloadExtResponse) ContentFileName ¶ added in v1.1.0
func (r DownloadExtResponse) ContentFileName() string
ContentFileName returns the file name that the server wanted to call this file.
func (DownloadExtResponse) ContentType ¶ added in v1.1.0
func (r DownloadExtResponse) ContentType() string
ContentType returns the MIME content type of the resulting file.
func (*DownloadExtResponse) SetContentFileName ¶ added in v1.1.0
func (r *DownloadExtResponse) SetContentFileName(contentFileName string)
SetContentFileName allows the client to accept the file name.
func (*DownloadExtResponse) SetContentType ¶ added in v1.1.0
func (r *DownloadExtResponse) SetContentType(contentType string)
SetContentType allows clients to accept the MIME content type specified by the gateway.
type DownloadRequest ¶ added in v1.1.0
type DownloadRequest struct {
// Name is the full name we're going to process.
Name string
}
DownloadRequest is the input for the Download function.
type DownloadResponse ¶ added in v1.1.0
type DownloadResponse struct {
// contains filtered or unexported fields
}
DownloadResponse is the output for the Download function.
func (DownloadResponse) Content ¶ added in v1.1.0
func (r DownloadResponse) Content() io.ReadCloser
Content returns the raw CSV bytes we generated.
func (*DownloadResponse) SetContent ¶ added in v1.1.0
func (r *DownloadResponse) SetContent(reader io.ReadCloser)
SetContent allows clients to accept the raw bytes generated by the service gateway.
type FirstNameRequest ¶
type FirstNameRequest struct {
// Name is the full name we're going to process.
Name string
}
FirstNameRequest is the input for the FirstName function.
type FirstNameResponse ¶
type FirstNameResponse struct {
// FirstName is the result we extracted.
FirstName string
}
FirstNameResponse is the output for the FirstName function.
type LastNameRequest ¶
type LastNameRequest struct {
// Name is the full name we're going to process.
Name string
}
LastNameRequest is the output for the LastName function.
type LastNameResponse ¶
type LastNameResponse struct {
// LastName is the result we extracted.
LastName string
}
LastNameResponse is the output for the LastName function.
type NameRequest ¶
type NameRequest struct {
// Name is the full name we're going to process.
Name string
}
NameRequest generalizes the data we pass to any of the name service functions.
type NameService ¶
type NameService interface {
// Split separates a first and last name.
Split(ctx context.Context, req *SplitRequest) (*SplitResponse, error)
// FirstName extracts just the first name from a full name string.
FirstName(ctx context.Context, req *FirstNameRequest) (*FirstNameResponse, error)
// LastName extracts just the last name from a full name string.
LastName(ctx context.Context, req *LastNameRequest) (*LastNameResponse, error)
// SortName establishes the "phone book" name for the given full name.
SortName(ctx context.Context, req *SortNameRequest) (*SortNameResponse, error)
// Download returns a raw CSV file containing the parsed name.
Download(ctx context.Context, req *DownloadRequest) (*DownloadResponse, error)
// DownloadExt returns a raw CSV file containing the parsed name. This differs from Download
// by giving you the "Ext" knob which will let you exercise the content type and disposition
// interfaces that Frodo supports for raw responses.
DownloadExt(ctx context.Context, req *DownloadExtRequest) (*DownloadExtResponse, error)
}
NameService performs parsing/processing on a person's name. This is primarily just used as a reference service for integration testing our generated clients.
type NameServiceHandler ¶
type NameServiceHandler struct {
}
NameServiceHandler provides the reference implementation of the NameService.
func (NameServiceHandler) Download ¶ added in v1.1.0
func (svc NameServiceHandler) Download(ctx context.Context, req *DownloadRequest) (*DownloadResponse, error)
Download returns a raw CSV file containing the parsed name.
func (NameServiceHandler) DownloadExt ¶ added in v1.1.0
func (svc NameServiceHandler) DownloadExt(ctx context.Context, req *DownloadExtRequest) (*DownloadExtResponse, error)
DownloadExt returns a raw CSV file containing the parsed name.
func (NameServiceHandler) FirstName ¶
func (svc NameServiceHandler) FirstName(ctx context.Context, req *FirstNameRequest) (*FirstNameResponse, error)
FirstName extracts just the first name from a full name string.
func (NameServiceHandler) LastName ¶
func (svc NameServiceHandler) LastName(ctx context.Context, req *LastNameRequest) (*LastNameResponse, error)
LastName extracts just the last name from a full name string.
func (NameServiceHandler) SortName ¶
func (svc NameServiceHandler) SortName(ctx context.Context, req *SortNameRequest) (*SortNameResponse, error)
SortName establishes the "phone book" name for the given full name.
func (NameServiceHandler) Split ¶
func (svc NameServiceHandler) Split(ctx context.Context, req *SplitRequest) (*SplitResponse, error)
Split separates a first and last name.
type SortNameRequest ¶
type SortNameRequest struct {
// Name is the full name we're going to process.
Name string
}
SortNameRequest is the input for the SortName function.
type SortNameResponse ¶
type SortNameResponse struct {
// SortName is the result we extracted.
SortName string
}
SortNameResponse is the output for the SortName function.
type SplitResponse ¶
type SplitResponse struct {
FirstNameResponse
LastNameResponse
}
SplitResponse is the output for the Split function.