app

package
v0.0.0-...-abdcf8d Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountAuthController

func MountAuthController(service *goa.Service, ctrl AuthController)

MountAuthController "mounts" a Auth resource controller on the given service.

func MountSamplesController

func MountSamplesController(service *goa.Service, ctrl SamplesController)

MountSamplesController "mounts" a Samples resource controller on the given service.

func MountSwaggerController

func MountSwaggerController(service *goa.Service, ctrl SwaggerController)

MountSwaggerController "mounts" a Swagger resource controller on the given service.

func NewJWTSecurity

func NewJWTSecurity() *goa.JWTSecurity

NewJWTSecurity creates a jwt security definition.

func SamplesHref

func SamplesHref(id interface{}) string

SamplesHref returns the resource href.

func UseJWTMiddleware

func UseJWTMiddleware(service *goa.Service, middleware goa.Middleware)

UseJWTMiddleware mounts the jwt auth middleware onto the service.

Types

type AddSamplesContext

type AddSamplesContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *AddSamplesPayload
}

AddSamplesContext provides the samples add action context.

func NewAddSamplesContext

func NewAddSamplesContext(ctx context.Context, r *http.Request, service *goa.Service) (*AddSamplesContext, error)

NewAddSamplesContext parses the incoming request URL and body, performs validations and creates the context used by the samples controller add action.

func (*AddSamplesContext) BadRequest

func (ctx *AddSamplesContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*AddSamplesContext) NotFound

func (ctx *AddSamplesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*AddSamplesContext) OK

func (ctx *AddSamplesContext) OK(r *Sample) error

OK sends a HTTP response with status code 200.

func (*AddSamplesContext) Unauthorized

func (ctx *AddSamplesContext) Unauthorized(r error) error

Unauthorized sends a HTTP response with status code 401.

type AddSamplesPayload

type AddSamplesPayload struct {
	// detail of sample
	Detail string `form:"detail" json:"detail" yaml:"detail" xml:"detail"`
	// name of sample
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
}

AddSamplesPayload is the samples add action payload.

func (*AddSamplesPayload) Validate

func (payload *AddSamplesPayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type Auth

type Auth struct {
	RefreshToken *RefreshToken `form:"refresh_token" json:"refresh_token" yaml:"refresh_token" xml:"refresh_token"`
	Token        *Token        `form:"token" json:"token" yaml:"token" xml:"token"`
}

Auth result (default view)

Identifier: application/vnd.auth+json; view=default

func (*Auth) Validate

func (mt *Auth) Validate() (err error)

Validate validates the Auth media type instance.

type AuthController

type AuthController interface {
	goa.Muxer
	Login(*LoginAuthContext) error
	Reauthenticate(*ReauthenticateAuthContext) error
}

AuthController is the controller interface for the Auth actions.

type DeleteSamplesContext

type DeleteSamplesContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID int
}

DeleteSamplesContext provides the samples delete action context.

func NewDeleteSamplesContext

func NewDeleteSamplesContext(ctx context.Context, r *http.Request, service *goa.Service) (*DeleteSamplesContext, error)

NewDeleteSamplesContext parses the incoming request URL and body, performs validations and creates the context used by the samples controller delete action.

func (*DeleteSamplesContext) BadRequest

func (ctx *DeleteSamplesContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*DeleteSamplesContext) NoContent

func (ctx *DeleteSamplesContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*DeleteSamplesContext) NotFound

func (ctx *DeleteSamplesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*DeleteSamplesContext) Unauthorized

func (ctx *DeleteSamplesContext) Unauthorized(r error) error

Unauthorized sends a HTTP response with status code 401.

type ListSamplesContext

type ListSamplesContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
}

ListSamplesContext provides the samples list action context.

func NewListSamplesContext

func NewListSamplesContext(ctx context.Context, r *http.Request, service *goa.Service) (*ListSamplesContext, error)

NewListSamplesContext parses the incoming request URL and body, performs validations and creates the context used by the samples controller list action.

func (*ListSamplesContext) BadRequest

func (ctx *ListSamplesContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*ListSamplesContext) NotFound

func (ctx *ListSamplesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ListSamplesContext) OK

OK sends a HTTP response with status code 200.

func (*ListSamplesContext) Unauthorized

func (ctx *ListSamplesContext) Unauthorized(r error) error

Unauthorized sends a HTTP response with status code 401.

type LoginAuthContext

type LoginAuthContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *LoginAuthPayload
}

LoginAuthContext provides the auth login action context.

func NewLoginAuthContext

func NewLoginAuthContext(ctx context.Context, r *http.Request, service *goa.Service) (*LoginAuthContext, error)

NewLoginAuthContext parses the incoming request URL and body, performs validations and creates the context used by the auth controller login action.

func (*LoginAuthContext) BadRequest

func (ctx *LoginAuthContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*LoginAuthContext) NotFound

func (ctx *LoginAuthContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*LoginAuthContext) OK

func (ctx *LoginAuthContext) OK(r *Auth) error

OK sends a HTTP response with status code 200.

type LoginAuthPayload

type LoginAuthPayload struct {
	// name of sample
	Email string `form:"email" json:"email" yaml:"email" xml:"email"`
	// detail of sample
	Password string `form:"password" json:"password" yaml:"password" xml:"password"`
}

LoginAuthPayload is the auth login action payload.

func (*LoginAuthPayload) Validate

func (payload *LoginAuthPayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type ReauthenticateAuthContext

type ReauthenticateAuthContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *ReauthenticateAuthPayload
}

ReauthenticateAuthContext provides the auth reauthenticate action context.

func NewReauthenticateAuthContext

func NewReauthenticateAuthContext(ctx context.Context, r *http.Request, service *goa.Service) (*ReauthenticateAuthContext, error)

NewReauthenticateAuthContext parses the incoming request URL and body, performs validations and creates the context used by the auth controller reauthenticate action.

func (*ReauthenticateAuthContext) BadRequest

func (ctx *ReauthenticateAuthContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*ReauthenticateAuthContext) NotFound

func (ctx *ReauthenticateAuthContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ReauthenticateAuthContext) OK

func (ctx *ReauthenticateAuthContext) OK(r *Auth) error

OK sends a HTTP response with status code 200.

type ReauthenticateAuthPayload

type ReauthenticateAuthPayload struct {
	// refresh token
	RefreshToken string `form:"refresh_token" json:"refresh_token" yaml:"refresh_token" xml:"refresh_token"`
}

ReauthenticateAuthPayload is the auth reauthenticate action payload.

func (*ReauthenticateAuthPayload) Validate

func (payload *ReauthenticateAuthPayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type RefreshToken

type RefreshToken struct {
	// 期限
	ExpiredAt time.Time `form:"expired_at" json:"expired_at" yaml:"expired_at" xml:"expired_at"`
	// refresh token value
	RefreshToken string `form:"refresh_token" json:"refresh_token" yaml:"refresh_token" xml:"refresh_token"`
}

refresh token (default view)

Identifier: application/vnd.refresh_token+json; view=default

func (*RefreshToken) Validate

func (mt *RefreshToken) Validate() (err error)

Validate validates the RefreshToken media type instance.

type Sample

type Sample struct {
	// 作成日
	CreatedAt time.Time `form:"created_at" json:"created_at" yaml:"created_at" xml:"created_at"`
	// 詳細
	Detail string `form:"detail" json:"detail" yaml:"detail" xml:"detail"`
	// sample id
	ID int `form:"id" json:"id" yaml:"id" xml:"id"`
	// 名前
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// 更新日
	UpdatedAt time.Time `form:"updated_at" json:"updated_at" yaml:"updated_at" xml:"updated_at"`
	// user id
	UserID int `form:"user_id" json:"user_id" yaml:"user_id" xml:"user_id"`
}

sample detail (default view)

Identifier: application/vnd.sample+json; view=default

func (*Sample) Validate

func (mt *Sample) Validate() (err error)

Validate validates the Sample media type instance.

type Samples

type Samples struct {
	// 作成日
	CreatedAt time.Time `form:"created_at" json:"created_at" yaml:"created_at" xml:"created_at"`
	// id
	ID int `form:"id" json:"id" yaml:"id" xml:"id"`
	// 名前
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
	// 更新日
	UpdatedAt time.Time `form:"updated_at" json:"updated_at" yaml:"updated_at" xml:"updated_at"`
}

sample list (default view)

Identifier: application/vnd.samples+json; view=default

func (*Samples) Validate

func (mt *Samples) Validate() (err error)

Validate validates the Samples media type instance.

type SamplesCollection

type SamplesCollection []*Samples

SamplesCollection is the media type for an array of Samples (default view)

Identifier: application/vnd.samples+json; type=collection; view=default

func (SamplesCollection) Validate

func (mt SamplesCollection) Validate() (err error)

Validate validates the SamplesCollection media type instance.

type SamplesController

type SamplesController interface {
	goa.Muxer
	Add(*AddSamplesContext) error
	Delete(*DeleteSamplesContext) error
	List(*ListSamplesContext) error
	Show(*ShowSamplesContext) error
	Update(*UpdateSamplesContext) error
}

SamplesController is the controller interface for the Samples actions.

type ShowSamplesContext

type ShowSamplesContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID int
}

ShowSamplesContext provides the samples show action context.

func NewShowSamplesContext

func NewShowSamplesContext(ctx context.Context, r *http.Request, service *goa.Service) (*ShowSamplesContext, error)

NewShowSamplesContext parses the incoming request URL and body, performs validations and creates the context used by the samples controller show action.

func (*ShowSamplesContext) BadRequest

func (ctx *ShowSamplesContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*ShowSamplesContext) NotFound

func (ctx *ShowSamplesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowSamplesContext) OK

func (ctx *ShowSamplesContext) OK(r *Sample) error

OK sends a HTTP response with status code 200.

func (*ShowSamplesContext) Unauthorized

func (ctx *ShowSamplesContext) Unauthorized(r error) error

Unauthorized sends a HTTP response with status code 401.

type SwaggerController

type SwaggerController interface {
	goa.Muxer
	goa.FileServer
}

SwaggerController is the controller interface for the Swagger actions.

type Token

type Token struct {
	// 期限
	ExpiredAt time.Time `form:"expired_at" json:"expired_at" yaml:"expired_at" xml:"expired_at"`
	// token value
	Token string `form:"token" json:"token" yaml:"token" xml:"token"`
}

token (default view)

Identifier: application/vnd.token+json; view=default

func (*Token) Validate

func (mt *Token) Validate() (err error)

Validate validates the Token media type instance.

type UpdateSamplesContext

type UpdateSamplesContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID      int
	Payload *UpdateSamplesPayload
}

UpdateSamplesContext provides the samples update action context.

func NewUpdateSamplesContext

func NewUpdateSamplesContext(ctx context.Context, r *http.Request, service *goa.Service) (*UpdateSamplesContext, error)

NewUpdateSamplesContext parses the incoming request URL and body, performs validations and creates the context used by the samples controller update action.

func (*UpdateSamplesContext) BadRequest

func (ctx *UpdateSamplesContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*UpdateSamplesContext) NoContent

func (ctx *UpdateSamplesContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*UpdateSamplesContext) NotFound

func (ctx *UpdateSamplesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*UpdateSamplesContext) Unauthorized

func (ctx *UpdateSamplesContext) Unauthorized(r error) error

Unauthorized sends a HTTP response with status code 401.

type UpdateSamplesPayload

type UpdateSamplesPayload struct {
	// detail of sample
	Detail string `form:"detail" json:"detail" yaml:"detail" xml:"detail"`
	// name of sample
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
}

UpdateSamplesPayload is the samples update action payload.

func (*UpdateSamplesPayload) Validate

func (payload *UpdateSamplesPayload) Validate() (err error)

Validate runs the validation rules defined in the design.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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