names

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

Download returns a raw CSV file containing the parsed name.

func (NameServiceHandler) DownloadExt added in v1.1.0

DownloadExt returns a raw CSV file containing the parsed name.

func (NameServiceHandler) FirstName

FirstName extracts just the first name from a full name string.

func (NameServiceHandler) LastName

LastName extracts just the last name from a full name string.

func (NameServiceHandler) SortName

SortName establishes the "phone book" name for the given full name.

func (NameServiceHandler) Split

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 SplitRequest

type SplitRequest NameRequest

SplitRequest is the input for the Split function.

type SplitResponse

type SplitResponse struct {
	FirstNameResponse
	LastNameResponse
}

SplitResponse is the output for the Split function.

Directories

Path Synopsis
Code generated by Frodo - DO NOT EDIT.
Code generated by Frodo - DO NOT EDIT.

Jump to

Keyboard shortcuts

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