Added ogent for entity code gen.
This commit is contained in:
parent
9a92c4aad6
commit
196d34cc1f
29 changed files with 13445 additions and 12 deletions
102
ent/ogent/oas_server_gen.go
Normal file
102
ent/ogent/oas_server_gen.go
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
// Code generated by ogen, DO NOT EDIT.
|
||||
|
||||
package ogent
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// Handler handles operations described by OpenAPI v3 specification.
|
||||
type Handler interface {
|
||||
// CreatePasswordToken implements createPasswordToken operation.
|
||||
//
|
||||
// Creates a new PasswordToken and persists it to storage.
|
||||
//
|
||||
// POST /password-tokens
|
||||
CreatePasswordToken(ctx context.Context, req *CreatePasswordTokenReq) (CreatePasswordTokenRes, error)
|
||||
// CreateUser implements createUser operation.
|
||||
//
|
||||
// Creates a new User and persists it to storage.
|
||||
//
|
||||
// POST /users
|
||||
CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)
|
||||
// DeletePasswordToken implements deletePasswordToken operation.
|
||||
//
|
||||
// Deletes the PasswordToken with the requested ID.
|
||||
//
|
||||
// DELETE /password-tokens/{id}
|
||||
DeletePasswordToken(ctx context.Context, params DeletePasswordTokenParams) (DeletePasswordTokenRes, error)
|
||||
// DeleteUser implements deleteUser operation.
|
||||
//
|
||||
// Deletes the User with the requested ID.
|
||||
//
|
||||
// DELETE /users/{id}
|
||||
DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)
|
||||
// ListPasswordToken implements listPasswordToken operation.
|
||||
//
|
||||
// List PasswordTokens.
|
||||
//
|
||||
// GET /password-tokens
|
||||
ListPasswordToken(ctx context.Context, params ListPasswordTokenParams) (ListPasswordTokenRes, error)
|
||||
// ListUser implements listUser operation.
|
||||
//
|
||||
// List Users.
|
||||
//
|
||||
// GET /users
|
||||
ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)
|
||||
// ListUserOwner implements listUserOwner operation.
|
||||
//
|
||||
// List attached Owners.
|
||||
//
|
||||
// GET /users/{id}/owner
|
||||
ListUserOwner(ctx context.Context, params ListUserOwnerParams) (ListUserOwnerRes, error)
|
||||
// ReadPasswordToken implements readPasswordToken operation.
|
||||
//
|
||||
// Finds the PasswordToken with the requested ID and returns it.
|
||||
//
|
||||
// GET /password-tokens/{id}
|
||||
ReadPasswordToken(ctx context.Context, params ReadPasswordTokenParams) (ReadPasswordTokenRes, error)
|
||||
// ReadPasswordTokenUser implements readPasswordTokenUser operation.
|
||||
//
|
||||
// Find the attached User of the PasswordToken with the given ID.
|
||||
//
|
||||
// GET /password-tokens/{id}/user
|
||||
ReadPasswordTokenUser(ctx context.Context, params ReadPasswordTokenUserParams) (ReadPasswordTokenUserRes, error)
|
||||
// ReadUser implements readUser operation.
|
||||
//
|
||||
// Finds the User with the requested ID and returns it.
|
||||
//
|
||||
// GET /users/{id}
|
||||
ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)
|
||||
// UpdatePasswordToken implements updatePasswordToken operation.
|
||||
//
|
||||
// Updates a PasswordToken and persists changes to storage.
|
||||
//
|
||||
// PATCH /password-tokens/{id}
|
||||
UpdatePasswordToken(ctx context.Context, req *UpdatePasswordTokenReq, params UpdatePasswordTokenParams) (UpdatePasswordTokenRes, error)
|
||||
// UpdateUser implements updateUser operation.
|
||||
//
|
||||
// Updates a User and persists changes to storage.
|
||||
//
|
||||
// PATCH /users/{id}
|
||||
UpdateUser(ctx context.Context, req *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)
|
||||
}
|
||||
|
||||
// Server implements http server based on OpenAPI v3 specification and
|
||||
// calls Handler to handle requests.
|
||||
type Server struct {
|
||||
h Handler
|
||||
baseServer
|
||||
}
|
||||
|
||||
// NewServer creates new Server.
|
||||
func NewServer(h Handler, opts ...ServerOption) (*Server, error) {
|
||||
s, err := newServerConfig(opts...).baseServer()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Server{
|
||||
h: h,
|
||||
baseServer: s,
|
||||
}, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue