client

package
v0.0.0-...-3c3b521 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCoursePath

func CreateCoursePath() string

CreateCoursePath computes a request path to the create action of course.

func CreateRegistrationPath

func CreateRegistrationPath() string

CreateRegistrationPath computes a request path to the create action of registration.

func DeleteCoursePath

func DeleteCoursePath(id int) string

DeleteCoursePath computes a request path to the delete action of course.

func ListCoursePath

func ListCoursePath() string

ListCoursePath computes a request path to the list action of course.

func ListRegistrationPath

func ListRegistrationPath() string

ListRegistrationPath computes a request path to the list action of registration.

func LoginSessionPath

func LoginSessionPath() string

LoginSessionPath computes a request path to the login action of session.

func PatchCoursePath

func PatchCoursePath(id int) string

PatchCoursePath computes a request path to the patch action of course.

func PatchRegistrationPath

func PatchRegistrationPath(id int) string

PatchRegistrationPath computes a request path to the patch action of registration.

func ShowCoursePath

func ShowCoursePath(id int) string

ShowCoursePath computes a request path to the show action of course.

func ShowRegistrationPath

func ShowRegistrationPath(id int) string

ShowRegistrationPath computes a request path to the show action of registration.

Types

type Address

type Address struct {
	// City
	City string `json:"city" xml:"city" form:"city"`
	// Street number
	Number int `json:"number" xml:"number" form:"number"`
	// US State Code
	State string `json:"state" xml:"state" form:"state"`
	// Street name
	Street string `json:"street" xml:"street" form:"street"`
	// US Zip code
	Zip int `json:"zip" xml:"zip" form:"zip"`
}

Address is a street address

type Client

type Client struct {
	*goaclient.Client
	JWTAuthSigner   goaclient.Signer
	BasicAuthSigner goaclient.Signer
	Encoder         *goa.HTTPEncoder
	Decoder         *goa.HTTPDecoder
}

Client is the GoWorkshop service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) CreateCourse

func (c *Client) CreateCourse(ctx context.Context, path string, payload *CreateCoursePayload, contentType string) (*http.Response, error)

Create a new course

func (*Client) CreateRegistration

func (c *Client) CreateRegistration(ctx context.Context, path string, payload *CreateRegistrationPayload, contentType string) (*http.Response, error)

Create a new registration

func (*Client) DecodeCourseMedia

func (c *Client) DecodeCourseMedia(resp *http.Response) (*CourseMedia, error)

DecodeCourseMedia decodes the CourseMedia instance encoded in resp body.

func (*Client) DecodeCourseMediaCollection

func (c *Client) DecodeCourseMediaCollection(resp *http.Response) (CourseMediaCollection, error)

DecodeCourseMediaCollection decodes the CourseMediaCollection instance encoded in resp body.

func (*Client) DecodeError

func (c *Client) DecodeError(resp *http.Response) (*goa.Error, error)

DecodeError decodes the Error instance encoded in resp body.

func (*Client) DecodeRegistrationMedia

func (c *Client) DecodeRegistrationMedia(resp *http.Response) (*RegistrationMedia, error)

DecodeRegistrationMedia decodes the RegistrationMedia instance encoded in resp body.

func (*Client) DecodeRegistrationMediaCollection

func (c *Client) DecodeRegistrationMediaCollection(resp *http.Response) (RegistrationMediaCollection, error)

DecodeRegistrationMediaCollection decodes the RegistrationMediaCollection instance encoded in resp body.

func (*Client) DeleteCourse

func (c *Client) DeleteCourse(ctx context.Context, path string) (*http.Response, error)

Delete a course

func (*Client) DownloadSwagger

func (c *Client) DownloadSwagger(ctx context.Context, filename, dest string) (int64, error)

DownloadSwagger downloads /files with the given filename and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) DownloadSwaggerJSON

func (c *Client) DownloadSwaggerJSON(ctx context.Context, dest string) (int64, error)

DownloadSwaggerJSON downloads swagger.json and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) DownloadSwaggerYaml

func (c *Client) DownloadSwaggerYaml(ctx context.Context, dest string) (int64, error)

DownloadSwaggerYaml downloads swagger.yaml and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) ListCourse

func (c *Client) ListCourse(ctx context.Context, path string, name *string) (*http.Response, error)

List all courses

func (*Client) ListRegistration

func (c *Client) ListRegistration(ctx context.Context, path string, courseID *int) (*http.Response, error)

List all registrations

func (*Client) LoginSession

func (c *Client) LoginSession(ctx context.Context, path string) (*http.Response, error)

Login uses basic auth and on successful auth returns a JWT in the response "Authorization" header

func (*Client) NewCreateCourseRequest

func (c *Client) NewCreateCourseRequest(ctx context.Context, path string, payload *CreateCoursePayload, contentType string) (*http.Request, error)

NewCreateCourseRequest create the request corresponding to the create action endpoint of the course resource.

func (*Client) NewCreateRegistrationRequest

func (c *Client) NewCreateRegistrationRequest(ctx context.Context, path string, payload *CreateRegistrationPayload, contentType string) (*http.Request, error)

NewCreateRegistrationRequest create the request corresponding to the create action endpoint of the registration resource.

func (*Client) NewDeleteCourseRequest

func (c *Client) NewDeleteCourseRequest(ctx context.Context, path string) (*http.Request, error)

NewDeleteCourseRequest create the request corresponding to the delete action endpoint of the course resource.

func (*Client) NewListCourseRequest

func (c *Client) NewListCourseRequest(ctx context.Context, path string, name *string) (*http.Request, error)

NewListCourseRequest create the request corresponding to the list action endpoint of the course resource.

func (*Client) NewListRegistrationRequest

func (c *Client) NewListRegistrationRequest(ctx context.Context, path string, courseID *int) (*http.Request, error)

NewListRegistrationRequest create the request corresponding to the list action endpoint of the registration resource.

func (*Client) NewLoginSessionRequest

func (c *Client) NewLoginSessionRequest(ctx context.Context, path string) (*http.Request, error)

NewLoginSessionRequest create the request corresponding to the login action endpoint of the session resource.

func (*Client) NewPatchCourseRequest

func (c *Client) NewPatchCourseRequest(ctx context.Context, path string, payload *PatchCoursePayload, contentType string) (*http.Request, error)

NewPatchCourseRequest create the request corresponding to the patch action endpoint of the course resource.

func (*Client) NewPatchRegistrationRequest

func (c *Client) NewPatchRegistrationRequest(ctx context.Context, path string, payload *PatchRegistrationPayload, contentType string) (*http.Request, error)

NewPatchRegistrationRequest create the request corresponding to the patch action endpoint of the registration resource.

func (*Client) NewShowCourseRequest

func (c *Client) NewShowCourseRequest(ctx context.Context, path string) (*http.Request, error)

NewShowCourseRequest create the request corresponding to the show action endpoint of the course resource.

func (*Client) NewShowRegistrationRequest

func (c *Client) NewShowRegistrationRequest(ctx context.Context, path string, view *string) (*http.Request, error)

NewShowRegistrationRequest create the request corresponding to the show action endpoint of the registration resource.

func (*Client) PatchCourse

func (c *Client) PatchCourse(ctx context.Context, path string, payload *PatchCoursePayload, contentType string) (*http.Response, error)

Update a course using patch semantic

func (*Client) PatchRegistration

func (c *Client) PatchRegistration(ctx context.Context, path string, payload *PatchRegistrationPayload, contentType string) (*http.Response, error)

Update a registration using patch semantic

func (*Client) SetBasicAuthSigner

func (c *Client) SetBasicAuthSigner(signer goaclient.Signer)

SetBasicAuthSigner sets the request signer for the BasicAuth security scheme.

func (*Client) SetJWTAuthSigner

func (c *Client) SetJWTAuthSigner(signer goaclient.Signer)

SetJWTAuthSigner sets the request signer for the JWTAuth security scheme.

func (*Client) ShowCourse

func (c *Client) ShowCourse(ctx context.Context, path string) (*http.Response, error)

Retrieve a course by ID

func (*Client) ShowRegistration

func (c *Client) ShowRegistration(ctx context.Context, path string, view *string) (*http.Response, error)

Retrieve a registration by ID

type CourseMedia

type CourseMedia struct {
	// Course description
	Description *string `json:"description,omitempty" xml:"description,omitempty" form:"description,omitempty"`
	// Course end date/time
	EndTime time.Time `json:"end_time" xml:"end_time" form:"end_time"`
	// Course href
	Href string `json:"href" xml:"href" form:"href"`
	// Course identifier
	ID int `json:"id" xml:"id" form:"id"`
	// Course location
	Location string `json:"location" xml:"location" form:"location"`
	// Course name
	Name string `json:"name" xml:"name" form:"name"`
	// Course start date/time
	StartTime time.Time `json:"start_time" xml:"start_time" form:"start_time"`
}

CourseMedia is the media type used to render courses

type CourseMediaCollection

type CourseMediaCollection []*CourseMedia

CourseMediaCollection media type is a collection of CourseMedia.

type CreateCoursePayload

type CreateCoursePayload struct {
	// Course description
	Description *string `json:"description,omitempty" xml:"description,omitempty" form:"description,omitempty"`
	// Course end date/time
	EndTime time.Time `json:"end_time" xml:"end_time" form:"end_time"`
	// Course location
	Location string `json:"location" xml:"location" form:"location"`
	// Course name
	Name string `json:"name" xml:"name" form:"name"`
	// Course start date/time
	StartTime time.Time `json:"start_time" xml:"start_time" form:"start_time"`
}

CreateCoursePayload is the course create action payload.

type CreateRegistrationPayload

type CreateRegistrationPayload struct {
	// Attendee address
	Address *Address `json:"address" xml:"address" form:"address"`
	// The href to the course resource that describes the course being taught
	CourseHref string `json:"course_href" xml:"course_href" form:"course_href"`
	// Attendee first name
	FirstName string `json:"first_name" xml:"first_name" form:"first_name"`
	// Attendee last name
	LastName string `json:"last_name" xml:"last_name" form:"last_name"`
}

CreateRegistrationPayload is the registration create action payload.

type PatchCoursePayload

type PatchCoursePayload struct {
	// Course description
	Description *string `json:"description,omitempty" xml:"description,omitempty" form:"description,omitempty"`
	// Course end date/time
	EndTime *time.Time `json:"end_time,omitempty" xml:"end_time,omitempty" form:"end_time,omitempty"`
	// Course location
	Location *string `json:"location,omitempty" xml:"location,omitempty" form:"location,omitempty"`
	// Course start date/time
	StartTime *time.Time `json:"start_time,omitempty" xml:"start_time,omitempty" form:"start_time,omitempty"`
}

PatchCoursePayload is the course patch action payload.

type PatchRegistrationPayload

type PatchRegistrationPayload struct {
	// Attendee address
	Address *Address `json:"address,omitempty" xml:"address,omitempty" form:"address,omitempty"`
	// Attendee first name
	FirstName *string `json:"first_name,omitempty" xml:"first_name,omitempty" form:"first_name,omitempty"`
	// Attendee last name
	LastName *string `json:"last_name,omitempty" xml:"last_name,omitempty" form:"last_name,omitempty"`
}

PatchRegistrationPayload is the registration patch action payload.

type RegistrationMedia

type RegistrationMedia struct {
	// Attendee address
	Address *Address `json:"address" xml:"address" form:"address"`
	// Course being taught
	Course *CourseMedia `json:"course" xml:"course" form:"course"`
	// Attendee first name
	FirstName string `json:"first_name" xml:"first_name" form:"first_name"`
	// Registration href
	Href string `json:"href" xml:"href" form:"href"`
	// Registration identifier
	ID int `json:"id" xml:"id" form:"id"`
	// Attendee last name
	LastName string `json:"last_name" xml:"last_name" form:"last_name"`
}

RegistrationMedia is the media type used to render registrations

type RegistrationMediaCollection

type RegistrationMediaCollection []*RegistrationMedia

RegistrationMediaCollection media type is a collection of RegistrationMedia.

Jump to

Keyboard shortcuts

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