Documentation
¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type CreateUserJSONBody
- type CreateUserJSONRequestBody
- type EchoRouter
- type ErrorResponse
- type ErrorResponseCode
- type GetTimelineByQueryParams
- type GetTimelineByQueryParamsType
- type GetUsersParams
- type LoginJSONBody
- type LoginJSONRequestBody
- type Plat
- type PlatID
- type PlatId
- type PlatPost
- type PostPlatJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) CreateUser(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) DeleteFavorite(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) DeletePlat(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) DeleteUser(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetImage(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetPlat(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTimeline(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetTimelineByQuery(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetUser(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetUsers(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Login(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostFavorite(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostPlat(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) UploadImage(ctx echo.Context) error
- type TimelineFromDate
- type TimelineId
- type TimelineLimit
- type TimelineToDate
- type TimelineType
- type TimelineUserId
- type UploadImageTextBody
- type UploadImageTextRequestBody
- type User
- type UserID
- type UserId
Constants ¶
const (
BearerScopes = "Bearer.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type CreateUserJSONBody ¶
type CreateUserJSONBody struct { Email *string `json:"email,omitempty"` Name *string `json:"name,omitempty"` }
CreateUserJSONBody defines parameters for CreateUser.
type CreateUserJSONRequestBody ¶
type CreateUserJSONRequestBody CreateUserJSONBody
CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type ErrorResponse ¶
type ErrorResponse struct { Code ErrorResponseCode `json:"code"` Message string `json:"message"` }
ErrorResponse defines model for ErrorResponse.
type ErrorResponseCode ¶
type ErrorResponseCode string
ErrorResponseCode defines model for ErrorResponse.Code.
const ( BADREQUEST ErrorResponseCode = "BAD_REQUEST" CONFLICT ErrorResponseCode = "CONFLICT" INTERNALSERVERERROR ErrorResponseCode = "INTERNAL_SERVER_ERROR" MISSINGPARAMETER ErrorResponseCode = "MISSING_PARAMETER" NOTFOUND ErrorResponseCode = "NOT_FOUND" SERVICEUNAVAILABLE ErrorResponseCode = "SERVICE_UNAVAILABLE" UNAUTHORIZED ErrorResponseCode = "UNAUTHORIZED" UNPROCESSABLEENTITY ErrorResponseCode = "UNPROCESSABLE_ENTITY" )
Defines values for ErrorResponseCode.
type GetTimelineByQueryParams ¶
type GetTimelineByQueryParams struct { UserId TimelineUserId `form:"user_id" json:"user_id"` Type GetTimelineByQueryParamsType `form:"type" json:"type"` Limit *TimelineLimit `form:"limit,omitempty" json:"limit,omitempty"` FromDate *TimelineFromDate `form:"from_date,omitempty" json:"from_date,omitempty"` ToDate *TimelineToDate `form:"to_date,omitempty" json:"to_date,omitempty"` }
GetTimelineByQueryParams defines parameters for GetTimelineByQuery.
type GetTimelineByQueryParamsType ¶
type GetTimelineByQueryParamsType string
GetTimelineByQueryParamsType defines parameters for GetTimelineByQuery.
const ( GetTimelineByQueryParamsTypeFollowing GetTimelineByQueryParamsType = "following" GetTimelineByQueryParamsTypeHome GetTimelineByQueryParamsType = "home" GetTimelineByQueryParamsTypeLocal GetTimelineByQueryParamsType = "local" )
Defines values for GetTimelineByQueryParamsType.
type GetUsersParams ¶
type GetUsersParams struct { // UserName ユーザ名 UserName *string `form:"user_name,omitempty" json:"user_name,omitempty"` }
GetUsersParams defines parameters for GetUsers.
type LoginJSONBody ¶
type LoginJSONBody struct { Password *string `json:"password,omitempty"` PreferredUserId *string `json:"preferred_user_id,omitempty"` }
LoginJSONBody defines parameters for Login.
type LoginJSONRequestBody ¶
type LoginJSONRequestBody LoginJSONBody
LoginJSONRequestBody defines body for Login for application/json ContentType.
type Plat ¶
type Plat struct { // Content platの本文 Content string `json:"content"` // CreatedAt platが作成された日時(ISO8601) CreatedAt time.Time `json:"created_at"` // FavoriteCount platがお気に入りされた数 FavoriteCount *int `json:"favorite_count,omitempty"` // ImageUrls platに添付された画像のURL ImageUrls *[]string `json:"image_urls,omitempty"` // PlatId platを識別するための一意のID PlatId PlatID `json:"plat_id"` // ReplatCount platがリプラットされた数 ReplatCount *int `json:"replat_count,omitempty"` // ReplyCount platに対するリプライの数 ReplyCount *int `json:"reply_count,omitempty"` // UserId userを識別するための一意のID UserId *UserID `json:"user_id,omitempty"` }
Plat plat
type PlatPost ¶
type PlatPost struct { // Content platの本文 Content string `json:"content"` // UserId userを識別するための一意のID UserId UserID `json:"user_id"` }
PlatPost plat
type PostPlatJSONRequestBody ¶
type PostPlatJSONRequestBody = PlatPost
PostPlatJSONRequestBody defines body for PostPlat for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface { // upload image // (POST /internal/v1/images) UploadImage(ctx echo.Context) error // get image // (GET /internal/v1/images/{image_id}) GetImage(ctx echo.Context, imageId string) error // login // (POST /internal/v1/login) Login(ctx echo.Context) error // Post plat. // (POST /internal/v1/plats) PostPlat(ctx echo.Context) error // Delete plat by ID. // (DELETE /internal/v1/plats/{plat_id}) DeletePlat(ctx echo.Context, platId PlatId) error // Get plat by ID. // (GET /internal/v1/plats/{plat_id}) GetPlat(ctx echo.Context, platId PlatId) error // Delete "favorite" to a specific plat by ID. // (DELETE /internal/v1/plats/{plat_id}/favorites) DeleteFavorite(ctx echo.Context, platId PlatId) error // Add "favorite" to a specific plat by ID. // (POST /internal/v1/plats/{plat_id}/favorites) PostFavorite(ctx echo.Context, platId PlatId) error // get timeline by query params // (GET /internal/v1/timelines) GetTimelineByQuery(ctx echo.Context, params GetTimelineByQueryParams) error // get timeline // (GET /internal/v1/timelines/{timeline_id}) GetTimeline(ctx echo.Context, timelineId TimelineId) error // Get users. // (GET /internal/v1/users) GetUsers(ctx echo.Context, params GetUsersParams) error // Create new user. // (POST /internal/v1/users) CreateUser(ctx echo.Context) error // Delete User by ID. // (DELETE /internal/v1/users/{user_id}) DeleteUser(ctx echo.Context, userId UserId) error // get user // (GET /internal/v1/users/{user_id}) GetUser(ctx echo.Context, userId UserId) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CreateUser ¶
func (w *ServerInterfaceWrapper) CreateUser(ctx echo.Context) error
CreateUser converts echo context to params.
func (*ServerInterfaceWrapper) DeleteFavorite ¶
func (w *ServerInterfaceWrapper) DeleteFavorite(ctx echo.Context) error
DeleteFavorite converts echo context to params.
func (*ServerInterfaceWrapper) DeletePlat ¶
func (w *ServerInterfaceWrapper) DeletePlat(ctx echo.Context) error
DeletePlat converts echo context to params.
func (*ServerInterfaceWrapper) DeleteUser ¶
func (w *ServerInterfaceWrapper) DeleteUser(ctx echo.Context) error
DeleteUser converts echo context to params.
func (*ServerInterfaceWrapper) GetImage ¶
func (w *ServerInterfaceWrapper) GetImage(ctx echo.Context) error
GetImage converts echo context to params.
func (*ServerInterfaceWrapper) GetPlat ¶
func (w *ServerInterfaceWrapper) GetPlat(ctx echo.Context) error
GetPlat converts echo context to params.
func (*ServerInterfaceWrapper) GetTimeline ¶
func (w *ServerInterfaceWrapper) GetTimeline(ctx echo.Context) error
GetTimeline converts echo context to params.
func (*ServerInterfaceWrapper) GetTimelineByQuery ¶
func (w *ServerInterfaceWrapper) GetTimelineByQuery(ctx echo.Context) error
GetTimelineByQuery converts echo context to params.
func (*ServerInterfaceWrapper) GetUser ¶
func (w *ServerInterfaceWrapper) GetUser(ctx echo.Context) error
GetUser converts echo context to params.
func (*ServerInterfaceWrapper) GetUsers ¶
func (w *ServerInterfaceWrapper) GetUsers(ctx echo.Context) error
GetUsers converts echo context to params.
func (*ServerInterfaceWrapper) Login ¶
func (w *ServerInterfaceWrapper) Login(ctx echo.Context) error
Login converts echo context to params.
func (*ServerInterfaceWrapper) PostFavorite ¶
func (w *ServerInterfaceWrapper) PostFavorite(ctx echo.Context) error
PostFavorite converts echo context to params.
func (*ServerInterfaceWrapper) PostPlat ¶
func (w *ServerInterfaceWrapper) PostPlat(ctx echo.Context) error
PostPlat converts echo context to params.
func (*ServerInterfaceWrapper) UploadImage ¶
func (w *ServerInterfaceWrapper) UploadImage(ctx echo.Context) error
UploadImage converts echo context to params.
type TimelineFromDate ¶
TimelineFromDate この日時以降のplatを取得する from_dateおよびto_dateは以下の制約を持つ - from_dateもしくはto_dateいずれかの指定は必須 - from_dateとto_dateを同時に指定することはできない - to_dateと同時に指定された場合、status code 422を返す
type TimelineToDate ¶
TimelineToDate この日時以前のplatを取得する from_dateおよびto_dateは以下の制約を持つ - from_dateもしくはto_dateいずれかの指定は必須 - from_dateとto_dateを同時に指定することはできない - from_dateと同時に指定された場合、status code 422を返す
type TimelineType ¶
type TimelineType string
TimelineType timelineの種類 - home: 指定したuser_idのplatの配列 - following: 指定したuser_idのfollowingのplatの配列 - local: インスタンス内の全てのplatの配列
const ( TimelineTypeFollowing TimelineType = "following" TimelineTypeHome TimelineType = "home" TimelineTypeLocal TimelineType = "local" )
Defines values for TimelineType.
type TimelineUserId ¶
type TimelineUserId = string
TimelineUserId defines model for timeline_user_id.
type UploadImageTextBody ¶
type UploadImageTextBody = string
UploadImageTextBody defines parameters for UploadImage.
type UploadImageTextRequestBody ¶
type UploadImageTextRequestBody = UploadImageTextBody
UploadImageTextRequestBody defines body for UploadImage for text/plain ContentType.
type User ¶
type User struct { // FollowersCount follower数 FollowersCount int `json:"followers_count"` // FollowingCount following数 FollowingCount int `json:"following_count"` // Icon ユーザのアイコン画像のURL Icon string `json:"icon"` // IsPublic 公開アカウントであるかどうか \ // external apiのmanuallyApprovesFollowersと同一の値となる IsPublic bool `json:"is_public"` // Summary ユーザのプロフィール Summary string `json:"summary"` // UserId userを識別するための一意のID UserId UserID `json:"user_id"` // Username 画面上に表示されるユーザ名 Username string `json:"username"` }
User user