go-swagger: github.com/go-swagger/go-swagger/examples/authentication/restapi/operations/customers Index | Files

package customers

import "github.com/go-swagger/go-swagger/examples/authentication/restapi/operations/customers"

Index

Package Files

create.go create_parameters.go create_responses.go create_urlbuilder.go get_id.go get_id_parameters.go get_id_responses.go get_id_urlbuilder.go

Constants

const CreateCreatedCode int = 201

CreateCreatedCode is the HTTP code returned for type CreateCreated

const GetIDNotFoundCode int = 404

GetIDNotFoundCode is the HTTP code returned for type GetIDNotFound

const GetIDOKCode int = 200

GetIDOKCode is the HTTP code returned for type GetIDOK

const GetIDUnauthorizedCode int = 401

GetIDUnauthorizedCode is the HTTP code returned for type GetIDUnauthorized

type Create Uses

type Create struct {
    Context *middleware.Context
    Handler CreateHandler
}
Create swagger:route POST /customers customers create

Create a new customer to track

func NewCreate Uses

func NewCreate(ctx *middleware.Context, handler CreateHandler) *Create

NewCreate creates a new http.Handler for the create operation

func (*Create) ServeHTTP Uses

func (o *Create) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type CreateCreated Uses

type CreateCreated struct {

    /*
      In: Body
    */
    Payload *models.Customer `json:"body,omitempty"`
}

CreateCreated created

swagger:response createCreated

func NewCreateCreated Uses

func NewCreateCreated() *CreateCreated

NewCreateCreated creates CreateCreated with default headers values

func (*CreateCreated) SetPayload Uses

func (o *CreateCreated) SetPayload(payload *models.Customer)

SetPayload sets the payload to the create created response

func (*CreateCreated) WithPayload Uses

func (o *CreateCreated) WithPayload(payload *models.Customer) *CreateCreated

WithPayload adds the payload to the create created response

func (*CreateCreated) WriteResponse Uses

func (o *CreateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type CreateDefault Uses

type CreateDefault struct {

    /*
      In: Body
    */
    Payload *models.Error `json:"body,omitempty"`
    // contains filtered or unexported fields
}

CreateDefault error

swagger:response createDefault

func NewCreateDefault Uses

func NewCreateDefault(code int) *CreateDefault

NewCreateDefault creates CreateDefault with default headers values

func (*CreateDefault) SetPayload Uses

func (o *CreateDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the create default response

func (*CreateDefault) SetStatusCode Uses

func (o *CreateDefault) SetStatusCode(code int)

SetStatusCode sets the status to the create default response

func (*CreateDefault) WithPayload Uses

func (o *CreateDefault) WithPayload(payload *models.Error) *CreateDefault

WithPayload adds the payload to the create default response

func (*CreateDefault) WithStatusCode Uses

func (o *CreateDefault) WithStatusCode(code int) *CreateDefault

WithStatusCode adds the status to the create default response

func (*CreateDefault) WriteResponse Uses

func (o *CreateDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type CreateHandler Uses

type CreateHandler interface {
    Handle(CreateParams, *models.Principal) middleware.Responder
}

CreateHandler interface for that can handle valid create params

type CreateHandlerFunc Uses

type CreateHandlerFunc func(CreateParams, *models.Principal) middleware.Responder

CreateHandlerFunc turns a function with the right signature into a create handler

func (CreateHandlerFunc) Handle Uses

func (fn CreateHandlerFunc) Handle(params CreateParams, principal *models.Principal) middleware.Responder

Handle executing the request and returning a response

type CreateParams Uses

type CreateParams struct {

    // HTTP Request Object
    HTTPRequest *http.Request `json:"-"`

    /*
      In: body
    */
    Info *models.Customer
}

CreateParams contains all the bound params for the create operation typically these are obtained from a http.Request

swagger:parameters create

func NewCreateParams Uses

func NewCreateParams() CreateParams

NewCreateParams creates a new CreateParams object

There are no default values defined in the spec.

func (*CreateParams) BindRequest Uses

func (o *CreateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewCreateParams() beforehand.

type CreateURL Uses

type CreateURL struct {
    // contains filtered or unexported fields
}

CreateURL generates an URL for the create operation

func (*CreateURL) Build Uses

func (o *CreateURL) Build() (*url.URL, error)

Build a url path and query string

func (*CreateURL) BuildFull Uses

func (o *CreateURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*CreateURL) Must Uses

func (o *CreateURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*CreateURL) SetBasePath Uses

func (o *CreateURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*CreateURL) String Uses

func (o *CreateURL) String() string

String returns the string representation of the path with query string

func (*CreateURL) StringFull Uses

func (o *CreateURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*CreateURL) WithBasePath Uses

func (o *CreateURL) WithBasePath(bp string) *CreateURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type GetID Uses

type GetID struct {
    Context *middleware.Context
    Handler GetIDHandler
}
GetID swagger:route GET /customers customers getId

Get a customerId given an SSN

func NewGetID Uses

func NewGetID(ctx *middleware.Context, handler GetIDHandler) *GetID

NewGetID creates a new http.Handler for the get Id operation

func (*GetID) ServeHTTP Uses

func (o *GetID) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type GetIDDefault Uses

type GetIDDefault struct {

    /*
      In: Body
    */
    Payload *models.Error `json:"body,omitempty"`
    // contains filtered or unexported fields
}

GetIDDefault error

swagger:response getIdDefault

func NewGetIDDefault Uses

func NewGetIDDefault(code int) *GetIDDefault

NewGetIDDefault creates GetIDDefault with default headers values

func (*GetIDDefault) SetPayload Uses

func (o *GetIDDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the get Id default response

func (*GetIDDefault) SetStatusCode Uses

func (o *GetIDDefault) SetStatusCode(code int)

SetStatusCode sets the status to the get Id default response

func (*GetIDDefault) WithPayload Uses

func (o *GetIDDefault) WithPayload(payload *models.Error) *GetIDDefault

WithPayload adds the payload to the get Id default response

func (*GetIDDefault) WithStatusCode Uses

func (o *GetIDDefault) WithStatusCode(code int) *GetIDDefault

WithStatusCode adds the status to the get Id default response

func (*GetIDDefault) WriteResponse Uses

func (o *GetIDDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetIDHandler Uses

type GetIDHandler interface {
    Handle(GetIDParams, *models.Principal) middleware.Responder
}

GetIDHandler interface for that can handle valid get Id params

type GetIDHandlerFunc Uses

type GetIDHandlerFunc func(GetIDParams, *models.Principal) middleware.Responder

GetIDHandlerFunc turns a function with the right signature into a get Id handler

func (GetIDHandlerFunc) Handle Uses

func (fn GetIDHandlerFunc) Handle(params GetIDParams, principal *models.Principal) middleware.Responder

Handle executing the request and returning a response

type GetIDNotFound Uses

type GetIDNotFound struct {

    /*
      In: Body
    */
    Payload *models.Error `json:"body,omitempty"`
}

GetIDNotFound resource not found

swagger:response getIdNotFound

func NewGetIDNotFound Uses

func NewGetIDNotFound() *GetIDNotFound

NewGetIDNotFound creates GetIDNotFound with default headers values

func (*GetIDNotFound) SetPayload Uses

func (o *GetIDNotFound) SetPayload(payload *models.Error)

SetPayload sets the payload to the get Id not found response

func (*GetIDNotFound) WithPayload Uses

func (o *GetIDNotFound) WithPayload(payload *models.Error) *GetIDNotFound

WithPayload adds the payload to the get Id not found response

func (*GetIDNotFound) WriteResponse Uses

func (o *GetIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetIDOK Uses

type GetIDOK struct {

    /*
      In: Body
    */
    Payload *models.Customer `json:"body,omitempty"`
}

GetIDOK OK

swagger:response getIdOK

func NewGetIDOK Uses

func NewGetIDOK() *GetIDOK

NewGetIDOK creates GetIDOK with default headers values

func (*GetIDOK) SetPayload Uses

func (o *GetIDOK) SetPayload(payload *models.Customer)

SetPayload sets the payload to the get Id o k response

func (*GetIDOK) WithPayload Uses

func (o *GetIDOK) WithPayload(payload *models.Customer) *GetIDOK

WithPayload adds the payload to the get Id o k response

func (*GetIDOK) WriteResponse Uses

func (o *GetIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type GetIDParams Uses

type GetIDParams struct {

    // HTTP Request Object
    HTTPRequest *http.Request `json:"-"`

    /*
      In: body
    */
    Info *models.SocialID
}

GetIDParams contains all the bound params for the get Id operation typically these are obtained from a http.Request

swagger:parameters getId

func NewGetIDParams Uses

func NewGetIDParams() GetIDParams

NewGetIDParams creates a new GetIDParams object

There are no default values defined in the spec.

func (*GetIDParams) BindRequest Uses

func (o *GetIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewGetIDParams() beforehand.

type GetIDURL Uses

type GetIDURL struct {
    // contains filtered or unexported fields
}

GetIDURL generates an URL for the get Id operation

func (*GetIDURL) Build Uses

func (o *GetIDURL) Build() (*url.URL, error)

Build a url path and query string

func (*GetIDURL) BuildFull Uses

func (o *GetIDURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*GetIDURL) Must Uses

func (o *GetIDURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*GetIDURL) SetBasePath Uses

func (o *GetIDURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*GetIDURL) String Uses

func (o *GetIDURL) String() string

String returns the string representation of the path with query string

func (*GetIDURL) StringFull Uses

func (o *GetIDURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*GetIDURL) WithBasePath Uses

func (o *GetIDURL) WithBasePath(bp string) *GetIDURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type GetIDUnauthorized Uses

type GetIDUnauthorized struct {

    /*
      In: Body
    */
    Payload *models.Error `json:"body,omitempty"`
}

GetIDUnauthorized unauthorized

swagger:response getIdUnauthorized

func NewGetIDUnauthorized Uses

func NewGetIDUnauthorized() *GetIDUnauthorized

NewGetIDUnauthorized creates GetIDUnauthorized with default headers values

func (*GetIDUnauthorized) SetPayload Uses

func (o *GetIDUnauthorized) SetPayload(payload *models.Error)

SetPayload sets the payload to the get Id unauthorized response

func (*GetIDUnauthorized) WithPayload Uses

func (o *GetIDUnauthorized) WithPayload(payload *models.Error) *GetIDUnauthorized

WithPayload adds the payload to the get Id unauthorized response

func (*GetIDUnauthorized) WriteResponse Uses

func (o *GetIDUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

Package customers imports 10 packages (graph) and is imported by 4 packages. Updated 2021-01-26. Refresh now. Tools for package owners.