ogent

package
v0.0.0-...-183bbd4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 32 Imported by: 0

Documentation ¶

Overview ¶

Code generated by ogen, DO NOT EDIT.

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func WithServerURL ¶

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types ¶

type AnswerAuthorRead ¶

type AnswerAuthorRead struct {
	ID        int       `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
}

Ref: #/components/schemas/Answer_AuthorRead

func NewAnswerAuthorRead ¶

func NewAnswerAuthorRead(e *ent.User) *AnswerAuthorRead

func NewAnswerAuthorReads ¶

func NewAnswerAuthorReads(es []*ent.User) []AnswerAuthorRead

func (*AnswerAuthorRead) Decode ¶

func (s *AnswerAuthorRead) Decode(d *jx.Decoder) error

Decode decodes AnswerAuthorRead from json.

func (*AnswerAuthorRead) Elem ¶

func (*AnswerAuthorRead) Encode ¶

func (s *AnswerAuthorRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AnswerAuthorRead) GetCreatedAt ¶

func (s *AnswerAuthorRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AnswerAuthorRead) GetEmail ¶

func (s *AnswerAuthorRead) GetEmail() string

GetEmail returns the value of Email.

func (*AnswerAuthorRead) GetID ¶

func (s *AnswerAuthorRead) GetID() int

GetID returns the value of ID.

func (*AnswerAuthorRead) GetLastLogin ¶

func (s *AnswerAuthorRead) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*AnswerAuthorRead) GetUsername ¶

func (s *AnswerAuthorRead) GetUsername() string

GetUsername returns the value of Username.

func (*AnswerAuthorRead) MarshalJSON ¶

func (s *AnswerAuthorRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AnswerAuthorRead) SetCreatedAt ¶

func (s *AnswerAuthorRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AnswerAuthorRead) SetEmail ¶

func (s *AnswerAuthorRead) SetEmail(val string)

SetEmail sets the value of Email.

func (*AnswerAuthorRead) SetID ¶

func (s *AnswerAuthorRead) SetID(val int)

SetID sets the value of ID.

func (*AnswerAuthorRead) SetLastLogin ¶

func (s *AnswerAuthorRead) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*AnswerAuthorRead) SetUsername ¶

func (s *AnswerAuthorRead) SetUsername(val string)

SetUsername sets the value of Username.

func (*AnswerAuthorRead) UnmarshalJSON ¶

func (s *AnswerAuthorRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AnswerCreate ¶

type AnswerCreate struct {
	ID               int       `json:"id"`
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
}

Ref: #/components/schemas/AnswerCreate

func NewAnswerCreate ¶

func NewAnswerCreate(e *ent.Answer) *AnswerCreate

func NewAnswerCreates ¶

func NewAnswerCreates(es []*ent.Answer) []AnswerCreate

func (*AnswerCreate) Decode ¶

func (s *AnswerCreate) Decode(d *jx.Decoder) error

Decode decodes AnswerCreate from json.

func (*AnswerCreate) Elem ¶

func (a *AnswerCreate) Elem() AnswerCreate

func (*AnswerCreate) Encode ¶

func (s *AnswerCreate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AnswerCreate) GetContent ¶

func (s *AnswerCreate) GetContent() string

GetContent returns the value of Content.

func (*AnswerCreate) GetCreatedAt ¶

func (s *AnswerCreate) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AnswerCreate) GetID ¶

func (s *AnswerCreate) GetID() int

GetID returns the value of ID.

func (*AnswerCreate) GetIsAcceptedAnswer ¶

func (s *AnswerCreate) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*AnswerCreate) GetLikes ¶

func (s *AnswerCreate) GetLikes() int

GetLikes returns the value of Likes.

func (*AnswerCreate) GetUpdatedAt ¶

func (s *AnswerCreate) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*AnswerCreate) MarshalJSON ¶

func (s *AnswerCreate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AnswerCreate) SetContent ¶

func (s *AnswerCreate) SetContent(val string)

SetContent sets the value of Content.

func (*AnswerCreate) SetCreatedAt ¶

func (s *AnswerCreate) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AnswerCreate) SetID ¶

func (s *AnswerCreate) SetID(val int)

SetID sets the value of ID.

func (*AnswerCreate) SetIsAcceptedAnswer ¶

func (s *AnswerCreate) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*AnswerCreate) SetLikes ¶

func (s *AnswerCreate) SetLikes(val int)

SetLikes sets the value of Likes.

func (*AnswerCreate) SetUpdatedAt ¶

func (s *AnswerCreate) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*AnswerCreate) UnmarshalJSON ¶

func (s *AnswerCreate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AnswerList ¶

type AnswerList struct {
	ID               int       `json:"id"`
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
}

Ref: #/components/schemas/AnswerList

func NewAnswerList ¶

func NewAnswerList(e *ent.Answer) *AnswerList

func NewAnswerLists ¶

func NewAnswerLists(es []*ent.Answer) []AnswerList

func (*AnswerList) Decode ¶

func (s *AnswerList) Decode(d *jx.Decoder) error

Decode decodes AnswerList from json.

func (*AnswerList) Elem ¶

func (a *AnswerList) Elem() AnswerList

func (*AnswerList) Encode ¶

func (s *AnswerList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AnswerList) GetContent ¶

func (s *AnswerList) GetContent() string

GetContent returns the value of Content.

func (*AnswerList) GetCreatedAt ¶

func (s *AnswerList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AnswerList) GetID ¶

func (s *AnswerList) GetID() int

GetID returns the value of ID.

func (*AnswerList) GetIsAcceptedAnswer ¶

func (s *AnswerList) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*AnswerList) GetLikes ¶

func (s *AnswerList) GetLikes() int

GetLikes returns the value of Likes.

func (*AnswerList) GetUpdatedAt ¶

func (s *AnswerList) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*AnswerList) MarshalJSON ¶

func (s *AnswerList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AnswerList) SetContent ¶

func (s *AnswerList) SetContent(val string)

SetContent sets the value of Content.

func (*AnswerList) SetCreatedAt ¶

func (s *AnswerList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AnswerList) SetID ¶

func (s *AnswerList) SetID(val int)

SetID sets the value of ID.

func (*AnswerList) SetIsAcceptedAnswer ¶

func (s *AnswerList) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*AnswerList) SetLikes ¶

func (s *AnswerList) SetLikes(val int)

SetLikes sets the value of Likes.

func (*AnswerList) SetUpdatedAt ¶

func (s *AnswerList) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*AnswerList) UnmarshalJSON ¶

func (s *AnswerList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AnswerQuestionRead ¶

type AnswerQuestionRead struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/Answer_QuestionRead

func NewAnswerQuestionRead ¶

func NewAnswerQuestionRead(e *ent.Question) *AnswerQuestionRead

func NewAnswerQuestionReads ¶

func NewAnswerQuestionReads(es []*ent.Question) []AnswerQuestionRead

func (*AnswerQuestionRead) Decode ¶

func (s *AnswerQuestionRead) Decode(d *jx.Decoder) error

Decode decodes AnswerQuestionRead from json.

func (*AnswerQuestionRead) Elem ¶

func (*AnswerQuestionRead) Encode ¶

func (s *AnswerQuestionRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AnswerQuestionRead) GetContent ¶

func (s *AnswerQuestionRead) GetContent() string

GetContent returns the value of Content.

func (*AnswerQuestionRead) GetCreatedAt ¶

func (s *AnswerQuestionRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AnswerQuestionRead) GetID ¶

func (s *AnswerQuestionRead) GetID() int

GetID returns the value of ID.

func (*AnswerQuestionRead) GetLikes ¶

func (s *AnswerQuestionRead) GetLikes() int

GetLikes returns the value of Likes.

func (*AnswerQuestionRead) GetSlug ¶

func (s *AnswerQuestionRead) GetSlug() string

GetSlug returns the value of Slug.

func (*AnswerQuestionRead) GetTitle ¶

func (s *AnswerQuestionRead) GetTitle() string

GetTitle returns the value of Title.

func (*AnswerQuestionRead) GetUpdatedAt ¶

func (s *AnswerQuestionRead) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*AnswerQuestionRead) GetViews ¶

func (s *AnswerQuestionRead) GetViews() int

GetViews returns the value of Views.

func (*AnswerQuestionRead) MarshalJSON ¶

func (s *AnswerQuestionRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AnswerQuestionRead) SetContent ¶

func (s *AnswerQuestionRead) SetContent(val string)

SetContent sets the value of Content.

func (*AnswerQuestionRead) SetCreatedAt ¶

func (s *AnswerQuestionRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AnswerQuestionRead) SetID ¶

func (s *AnswerQuestionRead) SetID(val int)

SetID sets the value of ID.

func (*AnswerQuestionRead) SetLikes ¶

func (s *AnswerQuestionRead) SetLikes(val int)

SetLikes sets the value of Likes.

func (*AnswerQuestionRead) SetSlug ¶

func (s *AnswerQuestionRead) SetSlug(val string)

SetSlug sets the value of Slug.

func (*AnswerQuestionRead) SetTitle ¶

func (s *AnswerQuestionRead) SetTitle(val string)

SetTitle sets the value of Title.

func (*AnswerQuestionRead) SetUpdatedAt ¶

func (s *AnswerQuestionRead) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*AnswerQuestionRead) SetViews ¶

func (s *AnswerQuestionRead) SetViews(val int)

SetViews sets the value of Views.

func (*AnswerQuestionRead) UnmarshalJSON ¶

func (s *AnswerQuestionRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AnswerRead ¶

type AnswerRead struct {
	ID               int       `json:"id"`
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
}

Ref: #/components/schemas/AnswerRead

func NewAnswerRead ¶

func NewAnswerRead(e *ent.Answer) *AnswerRead

func NewAnswerReads ¶

func NewAnswerReads(es []*ent.Answer) []AnswerRead

func (*AnswerRead) Decode ¶

func (s *AnswerRead) Decode(d *jx.Decoder) error

Decode decodes AnswerRead from json.

func (*AnswerRead) Elem ¶

func (a *AnswerRead) Elem() AnswerRead

func (*AnswerRead) Encode ¶

func (s *AnswerRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AnswerRead) GetContent ¶

func (s *AnswerRead) GetContent() string

GetContent returns the value of Content.

func (*AnswerRead) GetCreatedAt ¶

func (s *AnswerRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AnswerRead) GetID ¶

func (s *AnswerRead) GetID() int

GetID returns the value of ID.

func (*AnswerRead) GetIsAcceptedAnswer ¶

func (s *AnswerRead) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*AnswerRead) GetLikes ¶

func (s *AnswerRead) GetLikes() int

GetLikes returns the value of Likes.

func (*AnswerRead) GetUpdatedAt ¶

func (s *AnswerRead) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*AnswerRead) MarshalJSON ¶

func (s *AnswerRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AnswerRead) SetContent ¶

func (s *AnswerRead) SetContent(val string)

SetContent sets the value of Content.

func (*AnswerRead) SetCreatedAt ¶

func (s *AnswerRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AnswerRead) SetID ¶

func (s *AnswerRead) SetID(val int)

SetID sets the value of ID.

func (*AnswerRead) SetIsAcceptedAnswer ¶

func (s *AnswerRead) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*AnswerRead) SetLikes ¶

func (s *AnswerRead) SetLikes(val int)

SetLikes sets the value of Likes.

func (*AnswerRead) SetUpdatedAt ¶

func (s *AnswerRead) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*AnswerRead) UnmarshalJSON ¶

func (s *AnswerRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type AnswerUpdate ¶

type AnswerUpdate struct {
	ID               int       `json:"id"`
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
}

Ref: #/components/schemas/AnswerUpdate

func NewAnswerUpdate ¶

func NewAnswerUpdate(e *ent.Answer) *AnswerUpdate

func NewAnswerUpdates ¶

func NewAnswerUpdates(es []*ent.Answer) []AnswerUpdate

func (*AnswerUpdate) Decode ¶

func (s *AnswerUpdate) Decode(d *jx.Decoder) error

Decode decodes AnswerUpdate from json.

func (*AnswerUpdate) Elem ¶

func (a *AnswerUpdate) Elem() AnswerUpdate

func (*AnswerUpdate) Encode ¶

func (s *AnswerUpdate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*AnswerUpdate) GetContent ¶

func (s *AnswerUpdate) GetContent() string

GetContent returns the value of Content.

func (*AnswerUpdate) GetCreatedAt ¶

func (s *AnswerUpdate) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*AnswerUpdate) GetID ¶

func (s *AnswerUpdate) GetID() int

GetID returns the value of ID.

func (*AnswerUpdate) GetIsAcceptedAnswer ¶

func (s *AnswerUpdate) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*AnswerUpdate) GetLikes ¶

func (s *AnswerUpdate) GetLikes() int

GetLikes returns the value of Likes.

func (*AnswerUpdate) GetUpdatedAt ¶

func (s *AnswerUpdate) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*AnswerUpdate) MarshalJSON ¶

func (s *AnswerUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*AnswerUpdate) SetContent ¶

func (s *AnswerUpdate) SetContent(val string)

SetContent sets the value of Content.

func (*AnswerUpdate) SetCreatedAt ¶

func (s *AnswerUpdate) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*AnswerUpdate) SetID ¶

func (s *AnswerUpdate) SetID(val int)

SetID sets the value of ID.

func (*AnswerUpdate) SetIsAcceptedAnswer ¶

func (s *AnswerUpdate) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*AnswerUpdate) SetLikes ¶

func (s *AnswerUpdate) SetLikes(val int)

SetLikes sets the value of Likes.

func (*AnswerUpdate) SetUpdatedAt ¶

func (s *AnswerUpdate) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*AnswerUpdate) UnmarshalJSON ¶

func (s *AnswerUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Client ¶

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

Client implements OAS client.

func NewClient ¶

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) CreateAnswer ¶

func (c *Client) CreateAnswer(ctx context.Context, request *CreateAnswerReq) (CreateAnswerRes, error)

CreateAnswer invokes createAnswer operation.

Creates a new Answer and persists it to storage.

POST /answers

func (*Client) CreateQuestion ¶

func (c *Client) CreateQuestion(ctx context.Context, request *CreateQuestionReq) (CreateQuestionRes, error)

CreateQuestion invokes createQuestion operation.

Creates a new Question and persists it to storage.

POST /questions

func (*Client) CreateTag ¶

func (c *Client) CreateTag(ctx context.Context, request *CreateTagReq) (CreateTagRes, error)

CreateTag invokes createTag operation.

Creates a new Tag and persists it to storage.

POST /tags

func (*Client) CreateUser ¶

func (c *Client) CreateUser(ctx context.Context, request *CreateUserReq) (CreateUserRes, error)

CreateUser invokes createUser operation.

Creates a new User and persists it to storage.

POST /users

func (*Client) DeleteAnswer ¶

func (c *Client) DeleteAnswer(ctx context.Context, params DeleteAnswerParams) (DeleteAnswerRes, error)

DeleteAnswer invokes deleteAnswer operation.

Deletes the Answer with the requested ID.

DELETE /answers/{id}

func (*Client) DeleteQuestion ¶

func (c *Client) DeleteQuestion(ctx context.Context, params DeleteQuestionParams) (DeleteQuestionRes, error)

DeleteQuestion invokes deleteQuestion operation.

Deletes the Question with the requested ID.

DELETE /questions/{id}

func (*Client) DeleteTag ¶

func (c *Client) DeleteTag(ctx context.Context, params DeleteTagParams) (DeleteTagRes, error)

DeleteTag invokes deleteTag operation.

Deletes the Tag with the requested ID.

DELETE /tags/{id}

func (*Client) DeleteUser ¶

func (c *Client) DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)

DeleteUser invokes deleteUser operation.

Deletes the User with the requested ID.

DELETE /users/{id}

func (*Client) ListAnswer ¶

func (c *Client) ListAnswer(ctx context.Context, params ListAnswerParams) (ListAnswerRes, error)

ListAnswer invokes listAnswer operation.

List Answers.

GET /answers

func (*Client) ListQuestion ¶

func (c *Client) ListQuestion(ctx context.Context, params ListQuestionParams) (ListQuestionRes, error)

ListQuestion invokes listQuestion operation.

List Questions.

GET /questions

func (*Client) ListQuestionAnswers ¶

func (c *Client) ListQuestionAnswers(ctx context.Context, params ListQuestionAnswersParams) (ListQuestionAnswersRes, error)

ListQuestionAnswers invokes listQuestionAnswers operation.

List attached Answers.

GET /questions/{id}/answers

func (*Client) ListQuestionTags ¶

func (c *Client) ListQuestionTags(ctx context.Context, params ListQuestionTagsParams) (ListQuestionTagsRes, error)

ListQuestionTags invokes listQuestionTags operation.

List attached Tags.

GET /questions/{id}/tags

func (*Client) ListTag ¶

func (c *Client) ListTag(ctx context.Context, params ListTagParams) (ListTagRes, error)

ListTag invokes listTag operation.

List Tags.

GET /tags

func (*Client) ListTagQuestions ¶

func (c *Client) ListTagQuestions(ctx context.Context, params ListTagQuestionsParams) (ListTagQuestionsRes, error)

ListTagQuestions invokes listTagQuestions operation.

List attached Questions.

GET /tags/{id}/questions

func (*Client) ListUser ¶

func (c *Client) ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)

ListUser invokes listUser operation.

List Users.

GET /users

func (*Client) ListUserAnswers ¶

func (c *Client) ListUserAnswers(ctx context.Context, params ListUserAnswersParams) (ListUserAnswersRes, error)

ListUserAnswers invokes listUserAnswers operation.

List attached Answers.

GET /users/{id}/answers

func (*Client) ListUserQuestions ¶

func (c *Client) ListUserQuestions(ctx context.Context, params ListUserQuestionsParams) (ListUserQuestionsRes, error)

ListUserQuestions invokes listUserQuestions operation.

List attached Questions.

GET /users/{id}/questions

func (*Client) ListUserTags ¶

func (c *Client) ListUserTags(ctx context.Context, params ListUserTagsParams) (ListUserTagsRes, error)

ListUserTags invokes listUserTags operation.

List attached Tags.

GET /users/{id}/tags

func (*Client) ReadAnswer ¶

func (c *Client) ReadAnswer(ctx context.Context, params ReadAnswerParams) (ReadAnswerRes, error)

ReadAnswer invokes readAnswer operation.

Finds the Answer with the requested ID and returns it.

GET /answers/{id}

func (*Client) ReadAnswerAuthor ¶

func (c *Client) ReadAnswerAuthor(ctx context.Context, params ReadAnswerAuthorParams) (ReadAnswerAuthorRes, error)

ReadAnswerAuthor invokes readAnswerAuthor operation.

Find the attached User of the Answer with the given ID.

GET /answers/{id}/author

func (*Client) ReadAnswerQuestion ¶

func (c *Client) ReadAnswerQuestion(ctx context.Context, params ReadAnswerQuestionParams) (ReadAnswerQuestionRes, error)

ReadAnswerQuestion invokes readAnswerQuestion operation.

Find the attached Question of the Answer with the given ID.

GET /answers/{id}/question

func (*Client) ReadQuestion ¶

func (c *Client) ReadQuestion(ctx context.Context, params ReadQuestionParams) (ReadQuestionRes, error)

ReadQuestion invokes readQuestion operation.

Finds the Question with the requested ID and returns it.

GET /questions/{id}

func (*Client) ReadQuestionAuthor ¶

func (c *Client) ReadQuestionAuthor(ctx context.Context, params ReadQuestionAuthorParams) (ReadQuestionAuthorRes, error)

ReadQuestionAuthor invokes readQuestionAuthor operation.

Find the attached User of the Question with the given ID.

GET /questions/{id}/author

func (*Client) ReadTag ¶

func (c *Client) ReadTag(ctx context.Context, params ReadTagParams) (ReadTagRes, error)

ReadTag invokes readTag operation.

Finds the Tag with the requested ID and returns it.

GET /tags/{id}

func (*Client) ReadUser ¶

func (c *Client) ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)

ReadUser invokes readUser operation.

Finds the User with the requested ID and returns it.

GET /users/{id}

func (*Client) UpdateAnswer ¶

func (c *Client) UpdateAnswer(ctx context.Context, request *UpdateAnswerReq, params UpdateAnswerParams) (UpdateAnswerRes, error)

UpdateAnswer invokes updateAnswer operation.

Updates a Answer and persists changes to storage.

PATCH /answers/{id}

func (*Client) UpdateQuestion ¶

func (c *Client) UpdateQuestion(ctx context.Context, request *UpdateQuestionReq, params UpdateQuestionParams) (UpdateQuestionRes, error)

UpdateQuestion invokes updateQuestion operation.

Updates a Question and persists changes to storage.

PATCH /questions/{id}

func (*Client) UpdateTag ¶

func (c *Client) UpdateTag(ctx context.Context, request *UpdateTagReq, params UpdateTagParams) (UpdateTagRes, error)

UpdateTag invokes updateTag operation.

Updates a Tag and persists changes to storage.

PATCH /tags/{id}

func (*Client) UpdateUser ¶

func (c *Client) UpdateUser(ctx context.Context, request *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)

UpdateUser invokes updateUser operation.

Updates a User and persists changes to storage.

PATCH /users/{id}

type ClientOption ¶

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient ¶

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type CreateAnswerReq ¶

type CreateAnswerReq struct {
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
	Question         OptInt    `json:"question"`
	Author           OptInt    `json:"author"`
}

func (*CreateAnswerReq) Decode ¶

func (s *CreateAnswerReq) Decode(d *jx.Decoder) error

Decode decodes CreateAnswerReq from json.

func (*CreateAnswerReq) Encode ¶

func (s *CreateAnswerReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateAnswerReq) GetAuthor ¶

func (s *CreateAnswerReq) GetAuthor() OptInt

GetAuthor returns the value of Author.

func (*CreateAnswerReq) GetContent ¶

func (s *CreateAnswerReq) GetContent() string

GetContent returns the value of Content.

func (*CreateAnswerReq) GetCreatedAt ¶

func (s *CreateAnswerReq) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*CreateAnswerReq) GetIsAcceptedAnswer ¶

func (s *CreateAnswerReq) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*CreateAnswerReq) GetLikes ¶

func (s *CreateAnswerReq) GetLikes() int

GetLikes returns the value of Likes.

func (*CreateAnswerReq) GetQuestion ¶

func (s *CreateAnswerReq) GetQuestion() OptInt

GetQuestion returns the value of Question.

func (*CreateAnswerReq) GetUpdatedAt ¶

func (s *CreateAnswerReq) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*CreateAnswerReq) MarshalJSON ¶

func (s *CreateAnswerReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateAnswerReq) SetAuthor ¶

func (s *CreateAnswerReq) SetAuthor(val OptInt)

SetAuthor sets the value of Author.

func (*CreateAnswerReq) SetContent ¶

func (s *CreateAnswerReq) SetContent(val string)

SetContent sets the value of Content.

func (*CreateAnswerReq) SetCreatedAt ¶

func (s *CreateAnswerReq) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*CreateAnswerReq) SetIsAcceptedAnswer ¶

func (s *CreateAnswerReq) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*CreateAnswerReq) SetLikes ¶

func (s *CreateAnswerReq) SetLikes(val int)

SetLikes sets the value of Likes.

func (*CreateAnswerReq) SetQuestion ¶

func (s *CreateAnswerReq) SetQuestion(val OptInt)

SetQuestion sets the value of Question.

func (*CreateAnswerReq) SetUpdatedAt ¶

func (s *CreateAnswerReq) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*CreateAnswerReq) UnmarshalJSON ¶

func (s *CreateAnswerReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateAnswerRes ¶

type CreateAnswerRes interface {
	// contains filtered or unexported methods
}

type CreateQuestionReq ¶

type CreateQuestionReq struct {
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
	Answers   []int     `json:"answers"`
	Author    OptInt    `json:"author"`
	Tags      []int     `json:"tags"`
}

func (*CreateQuestionReq) Decode ¶

func (s *CreateQuestionReq) Decode(d *jx.Decoder) error

Decode decodes CreateQuestionReq from json.

func (*CreateQuestionReq) Encode ¶

func (s *CreateQuestionReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateQuestionReq) GetAnswers ¶

func (s *CreateQuestionReq) GetAnswers() []int

GetAnswers returns the value of Answers.

func (*CreateQuestionReq) GetAuthor ¶

func (s *CreateQuestionReq) GetAuthor() OptInt

GetAuthor returns the value of Author.

func (*CreateQuestionReq) GetContent ¶

func (s *CreateQuestionReq) GetContent() string

GetContent returns the value of Content.

func (*CreateQuestionReq) GetCreatedAt ¶

func (s *CreateQuestionReq) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*CreateQuestionReq) GetLikes ¶

func (s *CreateQuestionReq) GetLikes() int

GetLikes returns the value of Likes.

func (*CreateQuestionReq) GetSlug ¶

func (s *CreateQuestionReq) GetSlug() string

GetSlug returns the value of Slug.

func (*CreateQuestionReq) GetTags ¶

func (s *CreateQuestionReq) GetTags() []int

GetTags returns the value of Tags.

func (*CreateQuestionReq) GetTitle ¶

func (s *CreateQuestionReq) GetTitle() string

GetTitle returns the value of Title.

func (*CreateQuestionReq) GetUpdatedAt ¶

func (s *CreateQuestionReq) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*CreateQuestionReq) GetViews ¶

func (s *CreateQuestionReq) GetViews() int

GetViews returns the value of Views.

func (*CreateQuestionReq) MarshalJSON ¶

func (s *CreateQuestionReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateQuestionReq) SetAnswers ¶

func (s *CreateQuestionReq) SetAnswers(val []int)

SetAnswers sets the value of Answers.

func (*CreateQuestionReq) SetAuthor ¶

func (s *CreateQuestionReq) SetAuthor(val OptInt)

SetAuthor sets the value of Author.

func (*CreateQuestionReq) SetContent ¶

func (s *CreateQuestionReq) SetContent(val string)

SetContent sets the value of Content.

func (*CreateQuestionReq) SetCreatedAt ¶

func (s *CreateQuestionReq) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*CreateQuestionReq) SetLikes ¶

func (s *CreateQuestionReq) SetLikes(val int)

SetLikes sets the value of Likes.

func (*CreateQuestionReq) SetSlug ¶

func (s *CreateQuestionReq) SetSlug(val string)

SetSlug sets the value of Slug.

func (*CreateQuestionReq) SetTags ¶

func (s *CreateQuestionReq) SetTags(val []int)

SetTags sets the value of Tags.

func (*CreateQuestionReq) SetTitle ¶

func (s *CreateQuestionReq) SetTitle(val string)

SetTitle sets the value of Title.

func (*CreateQuestionReq) SetUpdatedAt ¶

func (s *CreateQuestionReq) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*CreateQuestionReq) SetViews ¶

func (s *CreateQuestionReq) SetViews(val int)

SetViews sets the value of Views.

func (*CreateQuestionReq) UnmarshalJSON ¶

func (s *CreateQuestionReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateQuestionRes ¶

type CreateQuestionRes interface {
	// contains filtered or unexported methods
}

type CreateTagReq ¶

type CreateTagReq struct {
	Name      string `json:"name"`
	Questions []int  `json:"questions"`
}

func (*CreateTagReq) Decode ¶

func (s *CreateTagReq) Decode(d *jx.Decoder) error

Decode decodes CreateTagReq from json.

func (*CreateTagReq) Encode ¶

func (s *CreateTagReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateTagReq) GetName ¶

func (s *CreateTagReq) GetName() string

GetName returns the value of Name.

func (*CreateTagReq) GetQuestions ¶

func (s *CreateTagReq) GetQuestions() []int

GetQuestions returns the value of Questions.

func (*CreateTagReq) MarshalJSON ¶

func (s *CreateTagReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateTagReq) SetName ¶

func (s *CreateTagReq) SetName(val string)

SetName sets the value of Name.

func (*CreateTagReq) SetQuestions ¶

func (s *CreateTagReq) SetQuestions(val []int)

SetQuestions sets the value of Questions.

func (*CreateTagReq) UnmarshalJSON ¶

func (s *CreateTagReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateTagRes ¶

type CreateTagRes interface {
	// contains filtered or unexported methods
}

type CreateUserReq ¶

type CreateUserReq struct {
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
	Questions []int     `json:"questions"`
	Answers   []int     `json:"answers"`
	Tags      []int     `json:"tags"`
}

func (*CreateUserReq) Decode ¶

func (s *CreateUserReq) Decode(d *jx.Decoder) error

Decode decodes CreateUserReq from json.

func (*CreateUserReq) Encode ¶

func (s *CreateUserReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*CreateUserReq) GetAnswers ¶

func (s *CreateUserReq) GetAnswers() []int

GetAnswers returns the value of Answers.

func (*CreateUserReq) GetCreatedAt ¶

func (s *CreateUserReq) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*CreateUserReq) GetEmail ¶

func (s *CreateUserReq) GetEmail() string

GetEmail returns the value of Email.

func (*CreateUserReq) GetLastLogin ¶

func (s *CreateUserReq) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*CreateUserReq) GetPassword ¶

func (s *CreateUserReq) GetPassword() string

GetPassword returns the value of Password.

func (*CreateUserReq) GetQuestions ¶

func (s *CreateUserReq) GetQuestions() []int

GetQuestions returns the value of Questions.

func (*CreateUserReq) GetTags ¶

func (s *CreateUserReq) GetTags() []int

GetTags returns the value of Tags.

func (*CreateUserReq) GetUsername ¶

func (s *CreateUserReq) GetUsername() string

GetUsername returns the value of Username.

func (*CreateUserReq) MarshalJSON ¶

func (s *CreateUserReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*CreateUserReq) SetAnswers ¶

func (s *CreateUserReq) SetAnswers(val []int)

SetAnswers sets the value of Answers.

func (*CreateUserReq) SetCreatedAt ¶

func (s *CreateUserReq) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*CreateUserReq) SetEmail ¶

func (s *CreateUserReq) SetEmail(val string)

SetEmail sets the value of Email.

func (*CreateUserReq) SetLastLogin ¶

func (s *CreateUserReq) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*CreateUserReq) SetPassword ¶

func (s *CreateUserReq) SetPassword(val string)

SetPassword sets the value of Password.

func (*CreateUserReq) SetQuestions ¶

func (s *CreateUserReq) SetQuestions(val []int)

SetQuestions sets the value of Questions.

func (*CreateUserReq) SetTags ¶

func (s *CreateUserReq) SetTags(val []int)

SetTags sets the value of Tags.

func (*CreateUserReq) SetUsername ¶

func (s *CreateUserReq) SetUsername(val string)

SetUsername sets the value of Username.

func (*CreateUserReq) UnmarshalJSON ¶

func (s *CreateUserReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type CreateUserRes ¶

type CreateUserRes interface {
	// contains filtered or unexported methods
}

type DeleteAnswerNoContent ¶

type DeleteAnswerNoContent struct{}

DeleteAnswerNoContent is response for DeleteAnswer operation.

type DeleteAnswerParams ¶

type DeleteAnswerParams struct {
	// ID of the Answer.
	ID int
}

DeleteAnswerParams is parameters of deleteAnswer operation.

type DeleteAnswerRes ¶

type DeleteAnswerRes interface {
	// contains filtered or unexported methods
}

type DeleteQuestionNoContent ¶

type DeleteQuestionNoContent struct{}

DeleteQuestionNoContent is response for DeleteQuestion operation.

type DeleteQuestionParams ¶

type DeleteQuestionParams struct {
	// ID of the Question.
	ID int
}

DeleteQuestionParams is parameters of deleteQuestion operation.

type DeleteQuestionRes ¶

type DeleteQuestionRes interface {
	// contains filtered or unexported methods
}

type DeleteTagNoContent ¶

type DeleteTagNoContent struct{}

DeleteTagNoContent is response for DeleteTag operation.

type DeleteTagParams ¶

type DeleteTagParams struct {
	// ID of the Tag.
	ID int
}

DeleteTagParams is parameters of deleteTag operation.

type DeleteTagRes ¶

type DeleteTagRes interface {
	// contains filtered or unexported methods
}

type DeleteUserNoContent ¶

type DeleteUserNoContent struct{}

DeleteUserNoContent is response for DeleteUser operation.

type DeleteUserParams ¶

type DeleteUserParams struct {
	// ID of the User.
	ID int
}

DeleteUserParams is parameters of deleteUser operation.

type DeleteUserRes ¶

type DeleteUserRes interface {
	// contains filtered or unexported methods
}

type ErrorHandler ¶

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type Handler ¶

type Handler interface {
	// CreateAnswer implements createAnswer operation.
	//
	// Creates a new Answer and persists it to storage.
	//
	// POST /answers
	CreateAnswer(ctx context.Context, req *CreateAnswerReq) (CreateAnswerRes, error)
	// CreateQuestion implements createQuestion operation.
	//
	// Creates a new Question and persists it to storage.
	//
	// POST /questions
	CreateQuestion(ctx context.Context, req *CreateQuestionReq) (CreateQuestionRes, error)
	// CreateTag implements createTag operation.
	//
	// Creates a new Tag and persists it to storage.
	//
	// POST /tags
	CreateTag(ctx context.Context, req *CreateTagReq) (CreateTagRes, error)
	// CreateUser implements createUser operation.
	//
	// Creates a new User and persists it to storage.
	//
	// POST /users
	CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)
	// DeleteAnswer implements deleteAnswer operation.
	//
	// Deletes the Answer with the requested ID.
	//
	// DELETE /answers/{id}
	DeleteAnswer(ctx context.Context, params DeleteAnswerParams) (DeleteAnswerRes, error)
	// DeleteQuestion implements deleteQuestion operation.
	//
	// Deletes the Question with the requested ID.
	//
	// DELETE /questions/{id}
	DeleteQuestion(ctx context.Context, params DeleteQuestionParams) (DeleteQuestionRes, error)
	// DeleteTag implements deleteTag operation.
	//
	// Deletes the Tag with the requested ID.
	//
	// DELETE /tags/{id}
	DeleteTag(ctx context.Context, params DeleteTagParams) (DeleteTagRes, error)
	// DeleteUser implements deleteUser operation.
	//
	// Deletes the User with the requested ID.
	//
	// DELETE /users/{id}
	DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)
	// ListAnswer implements listAnswer operation.
	//
	// List Answers.
	//
	// GET /answers
	ListAnswer(ctx context.Context, params ListAnswerParams) (ListAnswerRes, error)
	// ListQuestion implements listQuestion operation.
	//
	// List Questions.
	//
	// GET /questions
	ListQuestion(ctx context.Context, params ListQuestionParams) (ListQuestionRes, error)
	// ListQuestionAnswers implements listQuestionAnswers operation.
	//
	// List attached Answers.
	//
	// GET /questions/{id}/answers
	ListQuestionAnswers(ctx context.Context, params ListQuestionAnswersParams) (ListQuestionAnswersRes, error)
	// ListQuestionTags implements listQuestionTags operation.
	//
	// List attached Tags.
	//
	// GET /questions/{id}/tags
	ListQuestionTags(ctx context.Context, params ListQuestionTagsParams) (ListQuestionTagsRes, error)
	// ListTag implements listTag operation.
	//
	// List Tags.
	//
	// GET /tags
	ListTag(ctx context.Context, params ListTagParams) (ListTagRes, error)
	// ListTagQuestions implements listTagQuestions operation.
	//
	// List attached Questions.
	//
	// GET /tags/{id}/questions
	ListTagQuestions(ctx context.Context, params ListTagQuestionsParams) (ListTagQuestionsRes, error)
	// ListUser implements listUser operation.
	//
	// List Users.
	//
	// GET /users
	ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)
	// ListUserAnswers implements listUserAnswers operation.
	//
	// List attached Answers.
	//
	// GET /users/{id}/answers
	ListUserAnswers(ctx context.Context, params ListUserAnswersParams) (ListUserAnswersRes, error)
	// ListUserQuestions implements listUserQuestions operation.
	//
	// List attached Questions.
	//
	// GET /users/{id}/questions
	ListUserQuestions(ctx context.Context, params ListUserQuestionsParams) (ListUserQuestionsRes, error)
	// ListUserTags implements listUserTags operation.
	//
	// List attached Tags.
	//
	// GET /users/{id}/tags
	ListUserTags(ctx context.Context, params ListUserTagsParams) (ListUserTagsRes, error)
	// ReadAnswer implements readAnswer operation.
	//
	// Finds the Answer with the requested ID and returns it.
	//
	// GET /answers/{id}
	ReadAnswer(ctx context.Context, params ReadAnswerParams) (ReadAnswerRes, error)
	// ReadAnswerAuthor implements readAnswerAuthor operation.
	//
	// Find the attached User of the Answer with the given ID.
	//
	// GET /answers/{id}/author
	ReadAnswerAuthor(ctx context.Context, params ReadAnswerAuthorParams) (ReadAnswerAuthorRes, error)
	// ReadAnswerQuestion implements readAnswerQuestion operation.
	//
	// Find the attached Question of the Answer with the given ID.
	//
	// GET /answers/{id}/question
	ReadAnswerQuestion(ctx context.Context, params ReadAnswerQuestionParams) (ReadAnswerQuestionRes, error)
	// ReadQuestion implements readQuestion operation.
	//
	// Finds the Question with the requested ID and returns it.
	//
	// GET /questions/{id}
	ReadQuestion(ctx context.Context, params ReadQuestionParams) (ReadQuestionRes, error)
	// ReadQuestionAuthor implements readQuestionAuthor operation.
	//
	// Find the attached User of the Question with the given ID.
	//
	// GET /questions/{id}/author
	ReadQuestionAuthor(ctx context.Context, params ReadQuestionAuthorParams) (ReadQuestionAuthorRes, error)
	// ReadTag implements readTag operation.
	//
	// Finds the Tag with the requested ID and returns it.
	//
	// GET /tags/{id}
	ReadTag(ctx context.Context, params ReadTagParams) (ReadTagRes, 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)
	// UpdateAnswer implements updateAnswer operation.
	//
	// Updates a Answer and persists changes to storage.
	//
	// PATCH /answers/{id}
	UpdateAnswer(ctx context.Context, req *UpdateAnswerReq, params UpdateAnswerParams) (UpdateAnswerRes, error)
	// UpdateQuestion implements updateQuestion operation.
	//
	// Updates a Question and persists changes to storage.
	//
	// PATCH /questions/{id}
	UpdateQuestion(ctx context.Context, req *UpdateQuestionReq, params UpdateQuestionParams) (UpdateQuestionRes, error)
	// UpdateTag implements updateTag operation.
	//
	// Updates a Tag and persists changes to storage.
	//
	// PATCH /tags/{id}
	UpdateTag(ctx context.Context, req *UpdateTagReq, params UpdateTagParams) (UpdateTagRes, 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)
}

Handler handles operations described by OpenAPI v3 specification.

type Invoker ¶

type Invoker interface {
	// CreateAnswer invokes createAnswer operation.
	//
	// Creates a new Answer and persists it to storage.
	//
	// POST /answers
	CreateAnswer(ctx context.Context, request *CreateAnswerReq) (CreateAnswerRes, error)
	// CreateQuestion invokes createQuestion operation.
	//
	// Creates a new Question and persists it to storage.
	//
	// POST /questions
	CreateQuestion(ctx context.Context, request *CreateQuestionReq) (CreateQuestionRes, error)
	// CreateTag invokes createTag operation.
	//
	// Creates a new Tag and persists it to storage.
	//
	// POST /tags
	CreateTag(ctx context.Context, request *CreateTagReq) (CreateTagRes, error)
	// CreateUser invokes createUser operation.
	//
	// Creates a new User and persists it to storage.
	//
	// POST /users
	CreateUser(ctx context.Context, request *CreateUserReq) (CreateUserRes, error)
	// DeleteAnswer invokes deleteAnswer operation.
	//
	// Deletes the Answer with the requested ID.
	//
	// DELETE /answers/{id}
	DeleteAnswer(ctx context.Context, params DeleteAnswerParams) (DeleteAnswerRes, error)
	// DeleteQuestion invokes deleteQuestion operation.
	//
	// Deletes the Question with the requested ID.
	//
	// DELETE /questions/{id}
	DeleteQuestion(ctx context.Context, params DeleteQuestionParams) (DeleteQuestionRes, error)
	// DeleteTag invokes deleteTag operation.
	//
	// Deletes the Tag with the requested ID.
	//
	// DELETE /tags/{id}
	DeleteTag(ctx context.Context, params DeleteTagParams) (DeleteTagRes, error)
	// DeleteUser invokes deleteUser operation.
	//
	// Deletes the User with the requested ID.
	//
	// DELETE /users/{id}
	DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)
	// ListAnswer invokes listAnswer operation.
	//
	// List Answers.
	//
	// GET /answers
	ListAnswer(ctx context.Context, params ListAnswerParams) (ListAnswerRes, error)
	// ListQuestion invokes listQuestion operation.
	//
	// List Questions.
	//
	// GET /questions
	ListQuestion(ctx context.Context, params ListQuestionParams) (ListQuestionRes, error)
	// ListQuestionAnswers invokes listQuestionAnswers operation.
	//
	// List attached Answers.
	//
	// GET /questions/{id}/answers
	ListQuestionAnswers(ctx context.Context, params ListQuestionAnswersParams) (ListQuestionAnswersRes, error)
	// ListQuestionTags invokes listQuestionTags operation.
	//
	// List attached Tags.
	//
	// GET /questions/{id}/tags
	ListQuestionTags(ctx context.Context, params ListQuestionTagsParams) (ListQuestionTagsRes, error)
	// ListTag invokes listTag operation.
	//
	// List Tags.
	//
	// GET /tags
	ListTag(ctx context.Context, params ListTagParams) (ListTagRes, error)
	// ListTagQuestions invokes listTagQuestions operation.
	//
	// List attached Questions.
	//
	// GET /tags/{id}/questions
	ListTagQuestions(ctx context.Context, params ListTagQuestionsParams) (ListTagQuestionsRes, error)
	// ListUser invokes listUser operation.
	//
	// List Users.
	//
	// GET /users
	ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)
	// ListUserAnswers invokes listUserAnswers operation.
	//
	// List attached Answers.
	//
	// GET /users/{id}/answers
	ListUserAnswers(ctx context.Context, params ListUserAnswersParams) (ListUserAnswersRes, error)
	// ListUserQuestions invokes listUserQuestions operation.
	//
	// List attached Questions.
	//
	// GET /users/{id}/questions
	ListUserQuestions(ctx context.Context, params ListUserQuestionsParams) (ListUserQuestionsRes, error)
	// ListUserTags invokes listUserTags operation.
	//
	// List attached Tags.
	//
	// GET /users/{id}/tags
	ListUserTags(ctx context.Context, params ListUserTagsParams) (ListUserTagsRes, error)
	// ReadAnswer invokes readAnswer operation.
	//
	// Finds the Answer with the requested ID and returns it.
	//
	// GET /answers/{id}
	ReadAnswer(ctx context.Context, params ReadAnswerParams) (ReadAnswerRes, error)
	// ReadAnswerAuthor invokes readAnswerAuthor operation.
	//
	// Find the attached User of the Answer with the given ID.
	//
	// GET /answers/{id}/author
	ReadAnswerAuthor(ctx context.Context, params ReadAnswerAuthorParams) (ReadAnswerAuthorRes, error)
	// ReadAnswerQuestion invokes readAnswerQuestion operation.
	//
	// Find the attached Question of the Answer with the given ID.
	//
	// GET /answers/{id}/question
	ReadAnswerQuestion(ctx context.Context, params ReadAnswerQuestionParams) (ReadAnswerQuestionRes, error)
	// ReadQuestion invokes readQuestion operation.
	//
	// Finds the Question with the requested ID and returns it.
	//
	// GET /questions/{id}
	ReadQuestion(ctx context.Context, params ReadQuestionParams) (ReadQuestionRes, error)
	// ReadQuestionAuthor invokes readQuestionAuthor operation.
	//
	// Find the attached User of the Question with the given ID.
	//
	// GET /questions/{id}/author
	ReadQuestionAuthor(ctx context.Context, params ReadQuestionAuthorParams) (ReadQuestionAuthorRes, error)
	// ReadTag invokes readTag operation.
	//
	// Finds the Tag with the requested ID and returns it.
	//
	// GET /tags/{id}
	ReadTag(ctx context.Context, params ReadTagParams) (ReadTagRes, error)
	// ReadUser invokes readUser operation.
	//
	// Finds the User with the requested ID and returns it.
	//
	// GET /users/{id}
	ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)
	// UpdateAnswer invokes updateAnswer operation.
	//
	// Updates a Answer and persists changes to storage.
	//
	// PATCH /answers/{id}
	UpdateAnswer(ctx context.Context, request *UpdateAnswerReq, params UpdateAnswerParams) (UpdateAnswerRes, error)
	// UpdateQuestion invokes updateQuestion operation.
	//
	// Updates a Question and persists changes to storage.
	//
	// PATCH /questions/{id}
	UpdateQuestion(ctx context.Context, request *UpdateQuestionReq, params UpdateQuestionParams) (UpdateQuestionRes, error)
	// UpdateTag invokes updateTag operation.
	//
	// Updates a Tag and persists changes to storage.
	//
	// PATCH /tags/{id}
	UpdateTag(ctx context.Context, request *UpdateTagReq, params UpdateTagParams) (UpdateTagRes, error)
	// UpdateUser invokes updateUser operation.
	//
	// Updates a User and persists changes to storage.
	//
	// PATCH /users/{id}
	UpdateUser(ctx context.Context, request *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type ListAnswerOKApplicationJSON ¶

type ListAnswerOKApplicationJSON []AnswerList

func (*ListAnswerOKApplicationJSON) Decode ¶

Decode decodes ListAnswerOKApplicationJSON from json.

func (ListAnswerOKApplicationJSON) Encode ¶

func (s ListAnswerOKApplicationJSON) Encode(e *jx.Encoder)

Encode encodes ListAnswerOKApplicationJSON as json.

func (ListAnswerOKApplicationJSON) MarshalJSON ¶

func (s ListAnswerOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListAnswerOKApplicationJSON) UnmarshalJSON ¶

func (s *ListAnswerOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListAnswerOKApplicationJSON) Validate ¶

func (s ListAnswerOKApplicationJSON) Validate() error

type ListAnswerParams ¶

type ListAnswerParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListAnswerParams is parameters of listAnswer operation.

type ListAnswerRes ¶

type ListAnswerRes interface {
	// contains filtered or unexported methods
}

type ListQuestionAnswersOKApplicationJSON ¶

type ListQuestionAnswersOKApplicationJSON []QuestionAnswersList

func (*ListQuestionAnswersOKApplicationJSON) Decode ¶

Decode decodes ListQuestionAnswersOKApplicationJSON from json.

func (ListQuestionAnswersOKApplicationJSON) Encode ¶

Encode encodes ListQuestionAnswersOKApplicationJSON as json.

func (ListQuestionAnswersOKApplicationJSON) MarshalJSON ¶

func (s ListQuestionAnswersOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListQuestionAnswersOKApplicationJSON) UnmarshalJSON ¶

func (s *ListQuestionAnswersOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListQuestionAnswersOKApplicationJSON) Validate ¶

type ListQuestionAnswersParams ¶

type ListQuestionAnswersParams struct {
	// ID of the Question.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListQuestionAnswersParams is parameters of listQuestionAnswers operation.

type ListQuestionAnswersRes ¶

type ListQuestionAnswersRes interface {
	// contains filtered or unexported methods
}

type ListQuestionOKApplicationJSON ¶

type ListQuestionOKApplicationJSON []QuestionList

func (*ListQuestionOKApplicationJSON) Decode ¶

Decode decodes ListQuestionOKApplicationJSON from json.

func (ListQuestionOKApplicationJSON) Encode ¶

Encode encodes ListQuestionOKApplicationJSON as json.

func (ListQuestionOKApplicationJSON) MarshalJSON ¶

func (s ListQuestionOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListQuestionOKApplicationJSON) UnmarshalJSON ¶

func (s *ListQuestionOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListQuestionOKApplicationJSON) Validate ¶

func (s ListQuestionOKApplicationJSON) Validate() error

type ListQuestionParams ¶

type ListQuestionParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListQuestionParams is parameters of listQuestion operation.

type ListQuestionRes ¶

type ListQuestionRes interface {
	// contains filtered or unexported methods
}

type ListQuestionTagsOKApplicationJSON ¶

type ListQuestionTagsOKApplicationJSON []QuestionTagsList

func (*ListQuestionTagsOKApplicationJSON) Decode ¶

Decode decodes ListQuestionTagsOKApplicationJSON from json.

func (ListQuestionTagsOKApplicationJSON) Encode ¶

Encode encodes ListQuestionTagsOKApplicationJSON as json.

func (ListQuestionTagsOKApplicationJSON) MarshalJSON ¶

func (s ListQuestionTagsOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListQuestionTagsOKApplicationJSON) UnmarshalJSON ¶

func (s *ListQuestionTagsOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListQuestionTagsOKApplicationJSON) Validate ¶

type ListQuestionTagsParams ¶

type ListQuestionTagsParams struct {
	// ID of the Question.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListQuestionTagsParams is parameters of listQuestionTags operation.

type ListQuestionTagsRes ¶

type ListQuestionTagsRes interface {
	// contains filtered or unexported methods
}

type ListTagOKApplicationJSON ¶

type ListTagOKApplicationJSON []TagList

func (*ListTagOKApplicationJSON) Decode ¶

func (s *ListTagOKApplicationJSON) Decode(d *jx.Decoder) error

Decode decodes ListTagOKApplicationJSON from json.

func (ListTagOKApplicationJSON) Encode ¶

func (s ListTagOKApplicationJSON) Encode(e *jx.Encoder)

Encode encodes ListTagOKApplicationJSON as json.

func (ListTagOKApplicationJSON) MarshalJSON ¶

func (s ListTagOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListTagOKApplicationJSON) UnmarshalJSON ¶

func (s *ListTagOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListTagOKApplicationJSON) Validate ¶

func (s ListTagOKApplicationJSON) Validate() error

type ListTagParams ¶

type ListTagParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListTagParams is parameters of listTag operation.

type ListTagQuestionsOKApplicationJSON ¶

type ListTagQuestionsOKApplicationJSON []TagQuestionsList

func (*ListTagQuestionsOKApplicationJSON) Decode ¶

Decode decodes ListTagQuestionsOKApplicationJSON from json.

func (ListTagQuestionsOKApplicationJSON) Encode ¶

Encode encodes ListTagQuestionsOKApplicationJSON as json.

func (ListTagQuestionsOKApplicationJSON) MarshalJSON ¶

func (s ListTagQuestionsOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListTagQuestionsOKApplicationJSON) UnmarshalJSON ¶

func (s *ListTagQuestionsOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListTagQuestionsOKApplicationJSON) Validate ¶

type ListTagQuestionsParams ¶

type ListTagQuestionsParams struct {
	// ID of the Tag.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListTagQuestionsParams is parameters of listTagQuestions operation.

type ListTagQuestionsRes ¶

type ListTagQuestionsRes interface {
	// contains filtered or unexported methods
}

type ListTagRes ¶

type ListTagRes interface {
	// contains filtered or unexported methods
}

type ListUserAnswersOKApplicationJSON ¶

type ListUserAnswersOKApplicationJSON []UserAnswersList

func (*ListUserAnswersOKApplicationJSON) Decode ¶

Decode decodes ListUserAnswersOKApplicationJSON from json.

func (ListUserAnswersOKApplicationJSON) Encode ¶

Encode encodes ListUserAnswersOKApplicationJSON as json.

func (ListUserAnswersOKApplicationJSON) MarshalJSON ¶

func (s ListUserAnswersOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListUserAnswersOKApplicationJSON) UnmarshalJSON ¶

func (s *ListUserAnswersOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListUserAnswersOKApplicationJSON) Validate ¶

type ListUserAnswersParams ¶

type ListUserAnswersParams struct {
	// ID of the User.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListUserAnswersParams is parameters of listUserAnswers operation.

type ListUserAnswersRes ¶

type ListUserAnswersRes interface {
	// contains filtered or unexported methods
}

type ListUserOKApplicationJSON ¶

type ListUserOKApplicationJSON []UserList

func (*ListUserOKApplicationJSON) Decode ¶

func (s *ListUserOKApplicationJSON) Decode(d *jx.Decoder) error

Decode decodes ListUserOKApplicationJSON from json.

func (ListUserOKApplicationJSON) Encode ¶

func (s ListUserOKApplicationJSON) Encode(e *jx.Encoder)

Encode encodes ListUserOKApplicationJSON as json.

func (ListUserOKApplicationJSON) MarshalJSON ¶

func (s ListUserOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListUserOKApplicationJSON) UnmarshalJSON ¶

func (s *ListUserOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListUserOKApplicationJSON) Validate ¶

func (s ListUserOKApplicationJSON) Validate() error

type ListUserParams ¶

type ListUserParams struct {
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListUserParams is parameters of listUser operation.

type ListUserQuestionsOKApplicationJSON ¶

type ListUserQuestionsOKApplicationJSON []UserQuestionsList

func (*ListUserQuestionsOKApplicationJSON) Decode ¶

Decode decodes ListUserQuestionsOKApplicationJSON from json.

func (ListUserQuestionsOKApplicationJSON) Encode ¶

Encode encodes ListUserQuestionsOKApplicationJSON as json.

func (ListUserQuestionsOKApplicationJSON) MarshalJSON ¶

func (s ListUserQuestionsOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListUserQuestionsOKApplicationJSON) UnmarshalJSON ¶

func (s *ListUserQuestionsOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListUserQuestionsOKApplicationJSON) Validate ¶

type ListUserQuestionsParams ¶

type ListUserQuestionsParams struct {
	// ID of the User.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListUserQuestionsParams is parameters of listUserQuestions operation.

type ListUserQuestionsRes ¶

type ListUserQuestionsRes interface {
	// contains filtered or unexported methods
}

type ListUserRes ¶

type ListUserRes interface {
	// contains filtered or unexported methods
}

type ListUserTagsOKApplicationJSON ¶

type ListUserTagsOKApplicationJSON []UserTagsList

func (*ListUserTagsOKApplicationJSON) Decode ¶

Decode decodes ListUserTagsOKApplicationJSON from json.

func (ListUserTagsOKApplicationJSON) Encode ¶

Encode encodes ListUserTagsOKApplicationJSON as json.

func (ListUserTagsOKApplicationJSON) MarshalJSON ¶

func (s ListUserTagsOKApplicationJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ListUserTagsOKApplicationJSON) UnmarshalJSON ¶

func (s *ListUserTagsOKApplicationJSON) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (ListUserTagsOKApplicationJSON) Validate ¶

func (s ListUserTagsOKApplicationJSON) Validate() error

type ListUserTagsParams ¶

type ListUserTagsParams struct {
	// ID of the User.
	ID int
	// What page to render.
	Page OptInt
	// Item count to render per page.
	ItemsPerPage OptInt
}

ListUserTagsParams is parameters of listUserTags operation.

type ListUserTagsRes ¶

type ListUserTagsRes interface {
	// contains filtered or unexported methods
}

type Middleware ¶

type Middleware = middleware.Middleware

Middleware is middleware type.

type OgentHandler ¶

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

OgentHandler implements the ogen generated Handler interface and uses Ent as data layer.

func NewOgentHandler ¶

func NewOgentHandler(c *ent.Client) *OgentHandler

NewOgentHandler returns a new OgentHandler.

func (*OgentHandler) CreateAnswer ¶

func (h *OgentHandler) CreateAnswer(ctx context.Context, req *CreateAnswerReq) (CreateAnswerRes, error)

CreateAnswer handles POST /answers requests.

func (*OgentHandler) CreateQuestion ¶

func (h *OgentHandler) CreateQuestion(ctx context.Context, req *CreateQuestionReq) (CreateQuestionRes, error)

CreateQuestion handles POST /questions requests.

func (*OgentHandler) CreateTag ¶

func (h *OgentHandler) CreateTag(ctx context.Context, req *CreateTagReq) (CreateTagRes, error)

CreateTag handles POST /tags requests.

func (*OgentHandler) CreateUser ¶

func (h *OgentHandler) CreateUser(ctx context.Context, req *CreateUserReq) (CreateUserRes, error)

CreateUser handles POST /users requests.

func (*OgentHandler) DeleteAnswer ¶

func (h *OgentHandler) DeleteAnswer(ctx context.Context, params DeleteAnswerParams) (DeleteAnswerRes, error)

DeleteAnswer handles DELETE /answers/{id} requests.

func (*OgentHandler) DeleteQuestion ¶

func (h *OgentHandler) DeleteQuestion(ctx context.Context, params DeleteQuestionParams) (DeleteQuestionRes, error)

DeleteQuestion handles DELETE /questions/{id} requests.

func (*OgentHandler) DeleteTag ¶

func (h *OgentHandler) DeleteTag(ctx context.Context, params DeleteTagParams) (DeleteTagRes, error)

DeleteTag handles DELETE /tags/{id} requests.

func (*OgentHandler) DeleteUser ¶

func (h *OgentHandler) DeleteUser(ctx context.Context, params DeleteUserParams) (DeleteUserRes, error)

DeleteUser handles DELETE /users/{id} requests.

func (*OgentHandler) ListAnswer ¶

func (h *OgentHandler) ListAnswer(ctx context.Context, params ListAnswerParams) (ListAnswerRes, error)

ListAnswer handles GET /answers requests.

func (*OgentHandler) ListQuestion ¶

func (h *OgentHandler) ListQuestion(ctx context.Context, params ListQuestionParams) (ListQuestionRes, error)

ListQuestion handles GET /questions requests.

func (*OgentHandler) ListQuestionAnswers ¶

func (h *OgentHandler) ListQuestionAnswers(ctx context.Context, params ListQuestionAnswersParams) (ListQuestionAnswersRes, error)

ListQuestionAnswers handles GET /questions/{id}/answers requests.

func (*OgentHandler) ListQuestionTags ¶

func (h *OgentHandler) ListQuestionTags(ctx context.Context, params ListQuestionTagsParams) (ListQuestionTagsRes, error)

ListQuestionTags handles GET /questions/{id}/tags requests.

func (*OgentHandler) ListTag ¶

func (h *OgentHandler) ListTag(ctx context.Context, params ListTagParams) (ListTagRes, error)

ListTag handles GET /tags requests.

func (*OgentHandler) ListTagQuestions ¶

func (h *OgentHandler) ListTagQuestions(ctx context.Context, params ListTagQuestionsParams) (ListTagQuestionsRes, error)

ListTagQuestions handles GET /tags/{id}/questions requests.

func (*OgentHandler) ListUser ¶

func (h *OgentHandler) ListUser(ctx context.Context, params ListUserParams) (ListUserRes, error)

ListUser handles GET /users requests.

func (*OgentHandler) ListUserAnswers ¶

func (h *OgentHandler) ListUserAnswers(ctx context.Context, params ListUserAnswersParams) (ListUserAnswersRes, error)

ListUserAnswers handles GET /users/{id}/answers requests.

func (*OgentHandler) ListUserQuestions ¶

func (h *OgentHandler) ListUserQuestions(ctx context.Context, params ListUserQuestionsParams) (ListUserQuestionsRes, error)

ListUserQuestions handles GET /users/{id}/questions requests.

func (*OgentHandler) ListUserTags ¶

func (h *OgentHandler) ListUserTags(ctx context.Context, params ListUserTagsParams) (ListUserTagsRes, error)

ListUserTags handles GET /users/{id}/tags requests.

func (*OgentHandler) ReadAnswer ¶

func (h *OgentHandler) ReadAnswer(ctx context.Context, params ReadAnswerParams) (ReadAnswerRes, error)

ReadAnswer handles GET /answers/{id} requests.

func (*OgentHandler) ReadAnswerAuthor ¶

func (h *OgentHandler) ReadAnswerAuthor(ctx context.Context, params ReadAnswerAuthorParams) (ReadAnswerAuthorRes, error)

ReadAnswerAuthor handles GET /answers/{id}/author requests.

func (*OgentHandler) ReadAnswerQuestion ¶

func (h *OgentHandler) ReadAnswerQuestion(ctx context.Context, params ReadAnswerQuestionParams) (ReadAnswerQuestionRes, error)

ReadAnswerQuestion handles GET /answers/{id}/question requests.

func (*OgentHandler) ReadQuestion ¶

func (h *OgentHandler) ReadQuestion(ctx context.Context, params ReadQuestionParams) (ReadQuestionRes, error)

ReadQuestion handles GET /questions/{id} requests.

func (*OgentHandler) ReadQuestionAuthor ¶

func (h *OgentHandler) ReadQuestionAuthor(ctx context.Context, params ReadQuestionAuthorParams) (ReadQuestionAuthorRes, error)

ReadQuestionAuthor handles GET /questions/{id}/author requests.

func (*OgentHandler) ReadTag ¶

func (h *OgentHandler) ReadTag(ctx context.Context, params ReadTagParams) (ReadTagRes, error)

ReadTag handles GET /tags/{id} requests.

func (*OgentHandler) ReadUser ¶

func (h *OgentHandler) ReadUser(ctx context.Context, params ReadUserParams) (ReadUserRes, error)

ReadUser handles GET /users/{id} requests.

func (*OgentHandler) UpdateAnswer ¶

func (h *OgentHandler) UpdateAnswer(ctx context.Context, req *UpdateAnswerReq, params UpdateAnswerParams) (UpdateAnswerRes, error)

UpdateAnswer handles PATCH /answers/{id} requests.

func (*OgentHandler) UpdateQuestion ¶

UpdateQuestion handles PATCH /questions/{id} requests.

func (*OgentHandler) UpdateTag ¶

func (h *OgentHandler) UpdateTag(ctx context.Context, req *UpdateTagReq, params UpdateTagParams) (UpdateTagRes, error)

UpdateTag handles PATCH /tags/{id} requests.

func (*OgentHandler) UpdateUser ¶

func (h *OgentHandler) UpdateUser(ctx context.Context, req *UpdateUserReq, params UpdateUserParams) (UpdateUserRes, error)

UpdateUser handles PATCH /users/{id} requests.

type OptBool ¶

type OptBool struct {
	Value bool
	Set   bool
}

OptBool is optional bool.

func NewOptBool ¶

func NewOptBool(v bool) OptBool

NewOptBool returns new OptBool with value set to v.

func (*OptBool) Decode ¶

func (o *OptBool) Decode(d *jx.Decoder) error

Decode decodes bool from json.

func (OptBool) Encode ¶

func (o OptBool) Encode(e *jx.Encoder)

Encode encodes bool as json.

func (OptBool) Get ¶

func (o OptBool) Get() (v bool, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptBool) IsSet ¶

func (o OptBool) IsSet() bool

IsSet returns true if OptBool was set.

func (OptBool) MarshalJSON ¶

func (s OptBool) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptBool) Or ¶

func (o OptBool) Or(d bool) bool

Or returns value if set, or given parameter if does not.

func (*OptBool) Reset ¶

func (o *OptBool) Reset()

Reset unsets value.

func (*OptBool) SetTo ¶

func (o *OptBool) SetTo(v bool)

SetTo sets value to v.

func (*OptBool) UnmarshalJSON ¶

func (s *OptBool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDateTime ¶

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime ¶

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode ¶

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode ¶

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get ¶

func (o OptDateTime) Get() (v time.Time, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptDateTime) IsSet ¶

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON ¶

func (s OptDateTime) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or ¶

func (o OptDateTime) Or(d time.Time) time.Time

Or returns value if set, or given parameter if does not.

func (*OptDateTime) Reset ¶

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo ¶

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON ¶

func (s *OptDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt ¶

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt ¶

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (*OptInt) Decode ¶

func (o *OptInt) Decode(d *jx.Decoder) error

Decode decodes int from json.

func (OptInt) Encode ¶

func (o OptInt) Encode(e *jx.Encoder)

Encode encodes int as json.

func (OptInt) Get ¶

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet ¶

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) MarshalJSON ¶

func (s OptInt) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt) Or ¶

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset ¶

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo ¶

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

func (*OptInt) UnmarshalJSON ¶

func (s *OptInt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptString ¶

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString ¶

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode ¶

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode ¶

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get ¶

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet ¶

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON ¶

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or ¶

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset ¶

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetTo ¶

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON ¶

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option ¶

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider ¶

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider ¶

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type QuestionAnswersList ¶

type QuestionAnswersList struct {
	ID               int       `json:"id"`
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
}

Ref: #/components/schemas/Question_AnswersList

func NewQuestionAnswersList ¶

func NewQuestionAnswersList(e *ent.Answer) *QuestionAnswersList

func NewQuestionAnswersLists ¶

func NewQuestionAnswersLists(es []*ent.Answer) []QuestionAnswersList

func (*QuestionAnswersList) Decode ¶

func (s *QuestionAnswersList) Decode(d *jx.Decoder) error

Decode decodes QuestionAnswersList from json.

func (*QuestionAnswersList) Elem ¶

func (*QuestionAnswersList) Encode ¶

func (s *QuestionAnswersList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionAnswersList) GetContent ¶

func (s *QuestionAnswersList) GetContent() string

GetContent returns the value of Content.

func (*QuestionAnswersList) GetCreatedAt ¶

func (s *QuestionAnswersList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*QuestionAnswersList) GetID ¶

func (s *QuestionAnswersList) GetID() int

GetID returns the value of ID.

func (*QuestionAnswersList) GetIsAcceptedAnswer ¶

func (s *QuestionAnswersList) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*QuestionAnswersList) GetLikes ¶

func (s *QuestionAnswersList) GetLikes() int

GetLikes returns the value of Likes.

func (*QuestionAnswersList) GetUpdatedAt ¶

func (s *QuestionAnswersList) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*QuestionAnswersList) MarshalJSON ¶

func (s *QuestionAnswersList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionAnswersList) SetContent ¶

func (s *QuestionAnswersList) SetContent(val string)

SetContent sets the value of Content.

func (*QuestionAnswersList) SetCreatedAt ¶

func (s *QuestionAnswersList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*QuestionAnswersList) SetID ¶

func (s *QuestionAnswersList) SetID(val int)

SetID sets the value of ID.

func (*QuestionAnswersList) SetIsAcceptedAnswer ¶

func (s *QuestionAnswersList) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*QuestionAnswersList) SetLikes ¶

func (s *QuestionAnswersList) SetLikes(val int)

SetLikes sets the value of Likes.

func (*QuestionAnswersList) SetUpdatedAt ¶

func (s *QuestionAnswersList) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*QuestionAnswersList) UnmarshalJSON ¶

func (s *QuestionAnswersList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type QuestionAuthorRead ¶

type QuestionAuthorRead struct {
	ID        int       `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
}

Ref: #/components/schemas/Question_AuthorRead

func NewQuestionAuthorRead ¶

func NewQuestionAuthorRead(e *ent.User) *QuestionAuthorRead

func NewQuestionAuthorReads ¶

func NewQuestionAuthorReads(es []*ent.User) []QuestionAuthorRead

func (*QuestionAuthorRead) Decode ¶

func (s *QuestionAuthorRead) Decode(d *jx.Decoder) error

Decode decodes QuestionAuthorRead from json.

func (*QuestionAuthorRead) Elem ¶

func (*QuestionAuthorRead) Encode ¶

func (s *QuestionAuthorRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionAuthorRead) GetCreatedAt ¶

func (s *QuestionAuthorRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*QuestionAuthorRead) GetEmail ¶

func (s *QuestionAuthorRead) GetEmail() string

GetEmail returns the value of Email.

func (*QuestionAuthorRead) GetID ¶

func (s *QuestionAuthorRead) GetID() int

GetID returns the value of ID.

func (*QuestionAuthorRead) GetLastLogin ¶

func (s *QuestionAuthorRead) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*QuestionAuthorRead) GetUsername ¶

func (s *QuestionAuthorRead) GetUsername() string

GetUsername returns the value of Username.

func (*QuestionAuthorRead) MarshalJSON ¶

func (s *QuestionAuthorRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionAuthorRead) SetCreatedAt ¶

func (s *QuestionAuthorRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*QuestionAuthorRead) SetEmail ¶

func (s *QuestionAuthorRead) SetEmail(val string)

SetEmail sets the value of Email.

func (*QuestionAuthorRead) SetID ¶

func (s *QuestionAuthorRead) SetID(val int)

SetID sets the value of ID.

func (*QuestionAuthorRead) SetLastLogin ¶

func (s *QuestionAuthorRead) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*QuestionAuthorRead) SetUsername ¶

func (s *QuestionAuthorRead) SetUsername(val string)

SetUsername sets the value of Username.

func (*QuestionAuthorRead) UnmarshalJSON ¶

func (s *QuestionAuthorRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type QuestionCreate ¶

type QuestionCreate struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/QuestionCreate

func NewQuestionCreate ¶

func NewQuestionCreate(e *ent.Question) *QuestionCreate

func NewQuestionCreates ¶

func NewQuestionCreates(es []*ent.Question) []QuestionCreate

func (*QuestionCreate) Decode ¶

func (s *QuestionCreate) Decode(d *jx.Decoder) error

Decode decodes QuestionCreate from json.

func (*QuestionCreate) Elem ¶

func (q *QuestionCreate) Elem() QuestionCreate

func (*QuestionCreate) Encode ¶

func (s *QuestionCreate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionCreate) GetContent ¶

func (s *QuestionCreate) GetContent() string

GetContent returns the value of Content.

func (*QuestionCreate) GetCreatedAt ¶

func (s *QuestionCreate) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*QuestionCreate) GetID ¶

func (s *QuestionCreate) GetID() int

GetID returns the value of ID.

func (*QuestionCreate) GetLikes ¶

func (s *QuestionCreate) GetLikes() int

GetLikes returns the value of Likes.

func (*QuestionCreate) GetSlug ¶

func (s *QuestionCreate) GetSlug() string

GetSlug returns the value of Slug.

func (*QuestionCreate) GetTitle ¶

func (s *QuestionCreate) GetTitle() string

GetTitle returns the value of Title.

func (*QuestionCreate) GetUpdatedAt ¶

func (s *QuestionCreate) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*QuestionCreate) GetViews ¶

func (s *QuestionCreate) GetViews() int

GetViews returns the value of Views.

func (*QuestionCreate) MarshalJSON ¶

func (s *QuestionCreate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionCreate) SetContent ¶

func (s *QuestionCreate) SetContent(val string)

SetContent sets the value of Content.

func (*QuestionCreate) SetCreatedAt ¶

func (s *QuestionCreate) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*QuestionCreate) SetID ¶

func (s *QuestionCreate) SetID(val int)

SetID sets the value of ID.

func (*QuestionCreate) SetLikes ¶

func (s *QuestionCreate) SetLikes(val int)

SetLikes sets the value of Likes.

func (*QuestionCreate) SetSlug ¶

func (s *QuestionCreate) SetSlug(val string)

SetSlug sets the value of Slug.

func (*QuestionCreate) SetTitle ¶

func (s *QuestionCreate) SetTitle(val string)

SetTitle sets the value of Title.

func (*QuestionCreate) SetUpdatedAt ¶

func (s *QuestionCreate) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*QuestionCreate) SetViews ¶

func (s *QuestionCreate) SetViews(val int)

SetViews sets the value of Views.

func (*QuestionCreate) UnmarshalJSON ¶

func (s *QuestionCreate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type QuestionList ¶

type QuestionList struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/QuestionList

func NewQuestionList ¶

func NewQuestionList(e *ent.Question) *QuestionList

func NewQuestionLists ¶

func NewQuestionLists(es []*ent.Question) []QuestionList

func (*QuestionList) Decode ¶

func (s *QuestionList) Decode(d *jx.Decoder) error

Decode decodes QuestionList from json.

func (*QuestionList) Elem ¶

func (q *QuestionList) Elem() QuestionList

func (*QuestionList) Encode ¶

func (s *QuestionList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionList) GetContent ¶

func (s *QuestionList) GetContent() string

GetContent returns the value of Content.

func (*QuestionList) GetCreatedAt ¶

func (s *QuestionList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*QuestionList) GetID ¶

func (s *QuestionList) GetID() int

GetID returns the value of ID.

func (*QuestionList) GetLikes ¶

func (s *QuestionList) GetLikes() int

GetLikes returns the value of Likes.

func (*QuestionList) GetSlug ¶

func (s *QuestionList) GetSlug() string

GetSlug returns the value of Slug.

func (*QuestionList) GetTitle ¶

func (s *QuestionList) GetTitle() string

GetTitle returns the value of Title.

func (*QuestionList) GetUpdatedAt ¶

func (s *QuestionList) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*QuestionList) GetViews ¶

func (s *QuestionList) GetViews() int

GetViews returns the value of Views.

func (*QuestionList) MarshalJSON ¶

func (s *QuestionList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionList) SetContent ¶

func (s *QuestionList) SetContent(val string)

SetContent sets the value of Content.

func (*QuestionList) SetCreatedAt ¶

func (s *QuestionList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*QuestionList) SetID ¶

func (s *QuestionList) SetID(val int)

SetID sets the value of ID.

func (*QuestionList) SetLikes ¶

func (s *QuestionList) SetLikes(val int)

SetLikes sets the value of Likes.

func (*QuestionList) SetSlug ¶

func (s *QuestionList) SetSlug(val string)

SetSlug sets the value of Slug.

func (*QuestionList) SetTitle ¶

func (s *QuestionList) SetTitle(val string)

SetTitle sets the value of Title.

func (*QuestionList) SetUpdatedAt ¶

func (s *QuestionList) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*QuestionList) SetViews ¶

func (s *QuestionList) SetViews(val int)

SetViews sets the value of Views.

func (*QuestionList) UnmarshalJSON ¶

func (s *QuestionList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type QuestionRead ¶

type QuestionRead struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/QuestionRead

func NewQuestionRead ¶

func NewQuestionRead(e *ent.Question) *QuestionRead

func NewQuestionReads ¶

func NewQuestionReads(es []*ent.Question) []QuestionRead

func (*QuestionRead) Decode ¶

func (s *QuestionRead) Decode(d *jx.Decoder) error

Decode decodes QuestionRead from json.

func (*QuestionRead) Elem ¶

func (q *QuestionRead) Elem() QuestionRead

func (*QuestionRead) Encode ¶

func (s *QuestionRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionRead) GetContent ¶

func (s *QuestionRead) GetContent() string

GetContent returns the value of Content.

func (*QuestionRead) GetCreatedAt ¶

func (s *QuestionRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*QuestionRead) GetID ¶

func (s *QuestionRead) GetID() int

GetID returns the value of ID.

func (*QuestionRead) GetLikes ¶

func (s *QuestionRead) GetLikes() int

GetLikes returns the value of Likes.

func (*QuestionRead) GetSlug ¶

func (s *QuestionRead) GetSlug() string

GetSlug returns the value of Slug.

func (*QuestionRead) GetTitle ¶

func (s *QuestionRead) GetTitle() string

GetTitle returns the value of Title.

func (*QuestionRead) GetUpdatedAt ¶

func (s *QuestionRead) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*QuestionRead) GetViews ¶

func (s *QuestionRead) GetViews() int

GetViews returns the value of Views.

func (*QuestionRead) MarshalJSON ¶

func (s *QuestionRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionRead) SetContent ¶

func (s *QuestionRead) SetContent(val string)

SetContent sets the value of Content.

func (*QuestionRead) SetCreatedAt ¶

func (s *QuestionRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*QuestionRead) SetID ¶

func (s *QuestionRead) SetID(val int)

SetID sets the value of ID.

func (*QuestionRead) SetLikes ¶

func (s *QuestionRead) SetLikes(val int)

SetLikes sets the value of Likes.

func (*QuestionRead) SetSlug ¶

func (s *QuestionRead) SetSlug(val string)

SetSlug sets the value of Slug.

func (*QuestionRead) SetTitle ¶

func (s *QuestionRead) SetTitle(val string)

SetTitle sets the value of Title.

func (*QuestionRead) SetUpdatedAt ¶

func (s *QuestionRead) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*QuestionRead) SetViews ¶

func (s *QuestionRead) SetViews(val int)

SetViews sets the value of Views.

func (*QuestionRead) UnmarshalJSON ¶

func (s *QuestionRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type QuestionTagsList ¶

type QuestionTagsList struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/Question_TagsList

func NewQuestionTagsList ¶

func NewQuestionTagsList(e *ent.Tag) *QuestionTagsList

func NewQuestionTagsLists ¶

func NewQuestionTagsLists(es []*ent.Tag) []QuestionTagsList

func (*QuestionTagsList) Decode ¶

func (s *QuestionTagsList) Decode(d *jx.Decoder) error

Decode decodes QuestionTagsList from json.

func (*QuestionTagsList) Elem ¶

func (*QuestionTagsList) Encode ¶

func (s *QuestionTagsList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionTagsList) GetID ¶

func (s *QuestionTagsList) GetID() int

GetID returns the value of ID.

func (*QuestionTagsList) GetName ¶

func (s *QuestionTagsList) GetName() string

GetName returns the value of Name.

func (*QuestionTagsList) MarshalJSON ¶

func (s *QuestionTagsList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionTagsList) SetID ¶

func (s *QuestionTagsList) SetID(val int)

SetID sets the value of ID.

func (*QuestionTagsList) SetName ¶

func (s *QuestionTagsList) SetName(val string)

SetName sets the value of Name.

func (*QuestionTagsList) UnmarshalJSON ¶

func (s *QuestionTagsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type QuestionUpdate ¶

type QuestionUpdate struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/QuestionUpdate

func NewQuestionUpdate ¶

func NewQuestionUpdate(e *ent.Question) *QuestionUpdate

func NewQuestionUpdates ¶

func NewQuestionUpdates(es []*ent.Question) []QuestionUpdate

func (*QuestionUpdate) Decode ¶

func (s *QuestionUpdate) Decode(d *jx.Decoder) error

Decode decodes QuestionUpdate from json.

func (*QuestionUpdate) Elem ¶

func (q *QuestionUpdate) Elem() QuestionUpdate

func (*QuestionUpdate) Encode ¶

func (s *QuestionUpdate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*QuestionUpdate) GetContent ¶

func (s *QuestionUpdate) GetContent() string

GetContent returns the value of Content.

func (*QuestionUpdate) GetCreatedAt ¶

func (s *QuestionUpdate) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*QuestionUpdate) GetID ¶

func (s *QuestionUpdate) GetID() int

GetID returns the value of ID.

func (*QuestionUpdate) GetLikes ¶

func (s *QuestionUpdate) GetLikes() int

GetLikes returns the value of Likes.

func (*QuestionUpdate) GetSlug ¶

func (s *QuestionUpdate) GetSlug() string

GetSlug returns the value of Slug.

func (*QuestionUpdate) GetTitle ¶

func (s *QuestionUpdate) GetTitle() string

GetTitle returns the value of Title.

func (*QuestionUpdate) GetUpdatedAt ¶

func (s *QuestionUpdate) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*QuestionUpdate) GetViews ¶

func (s *QuestionUpdate) GetViews() int

GetViews returns the value of Views.

func (*QuestionUpdate) MarshalJSON ¶

func (s *QuestionUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*QuestionUpdate) SetContent ¶

func (s *QuestionUpdate) SetContent(val string)

SetContent sets the value of Content.

func (*QuestionUpdate) SetCreatedAt ¶

func (s *QuestionUpdate) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*QuestionUpdate) SetID ¶

func (s *QuestionUpdate) SetID(val int)

SetID sets the value of ID.

func (*QuestionUpdate) SetLikes ¶

func (s *QuestionUpdate) SetLikes(val int)

SetLikes sets the value of Likes.

func (*QuestionUpdate) SetSlug ¶

func (s *QuestionUpdate) SetSlug(val string)

SetSlug sets the value of Slug.

func (*QuestionUpdate) SetTitle ¶

func (s *QuestionUpdate) SetTitle(val string)

SetTitle sets the value of Title.

func (*QuestionUpdate) SetUpdatedAt ¶

func (s *QuestionUpdate) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*QuestionUpdate) SetViews ¶

func (s *QuestionUpdate) SetViews(val int)

SetViews sets the value of Views.

func (*QuestionUpdate) UnmarshalJSON ¶

func (s *QuestionUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R400 ¶

type R400 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R400) Decode ¶

func (s *R400) Decode(d *jx.Decoder) error

Decode decodes R400 from json.

func (*R400) Encode ¶

func (s *R400) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R400) GetCode ¶

func (s *R400) GetCode() int

GetCode returns the value of Code.

func (*R400) GetErrors ¶

func (s *R400) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R400) GetStatus ¶

func (s *R400) GetStatus() string

GetStatus returns the value of Status.

func (*R400) MarshalJSON ¶

func (s *R400) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R400) SetCode ¶

func (s *R400) SetCode(val int)

SetCode sets the value of Code.

func (*R400) SetErrors ¶

func (s *R400) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R400) SetStatus ¶

func (s *R400) SetStatus(val string)

SetStatus sets the value of Status.

func (*R400) UnmarshalJSON ¶

func (s *R400) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R404 ¶

type R404 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R404) Decode ¶

func (s *R404) Decode(d *jx.Decoder) error

Decode decodes R404 from json.

func (*R404) Encode ¶

func (s *R404) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R404) GetCode ¶

func (s *R404) GetCode() int

GetCode returns the value of Code.

func (*R404) GetErrors ¶

func (s *R404) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R404) GetStatus ¶

func (s *R404) GetStatus() string

GetStatus returns the value of Status.

func (*R404) MarshalJSON ¶

func (s *R404) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R404) SetCode ¶

func (s *R404) SetCode(val int)

SetCode sets the value of Code.

func (*R404) SetErrors ¶

func (s *R404) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R404) SetStatus ¶

func (s *R404) SetStatus(val string)

SetStatus sets the value of Status.

func (*R404) UnmarshalJSON ¶

func (s *R404) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R409 ¶

type R409 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R409) Decode ¶

func (s *R409) Decode(d *jx.Decoder) error

Decode decodes R409 from json.

func (*R409) Encode ¶

func (s *R409) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R409) GetCode ¶

func (s *R409) GetCode() int

GetCode returns the value of Code.

func (*R409) GetErrors ¶

func (s *R409) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R409) GetStatus ¶

func (s *R409) GetStatus() string

GetStatus returns the value of Status.

func (*R409) MarshalJSON ¶

func (s *R409) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R409) SetCode ¶

func (s *R409) SetCode(val int)

SetCode sets the value of Code.

func (*R409) SetErrors ¶

func (s *R409) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R409) SetStatus ¶

func (s *R409) SetStatus(val string)

SetStatus sets the value of Status.

func (*R409) UnmarshalJSON ¶

func (s *R409) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type R500 ¶

type R500 struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
	Errors jx.Raw `json:"errors"`
}

func (*R500) Decode ¶

func (s *R500) Decode(d *jx.Decoder) error

Decode decodes R500 from json.

func (*R500) Encode ¶

func (s *R500) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*R500) GetCode ¶

func (s *R500) GetCode() int

GetCode returns the value of Code.

func (*R500) GetErrors ¶

func (s *R500) GetErrors() jx.Raw

GetErrors returns the value of Errors.

func (*R500) GetStatus ¶

func (s *R500) GetStatus() string

GetStatus returns the value of Status.

func (*R500) MarshalJSON ¶

func (s *R500) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*R500) SetCode ¶

func (s *R500) SetCode(val int)

SetCode sets the value of Code.

func (*R500) SetErrors ¶

func (s *R500) SetErrors(val jx.Raw)

SetErrors sets the value of Errors.

func (*R500) SetStatus ¶

func (s *R500) SetStatus(val string)

SetStatus sets the value of Status.

func (*R500) UnmarshalJSON ¶

func (s *R500) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ReadAnswerAuthorParams ¶

type ReadAnswerAuthorParams struct {
	// ID of the Answer.
	ID int
}

ReadAnswerAuthorParams is parameters of readAnswerAuthor operation.

type ReadAnswerAuthorRes ¶

type ReadAnswerAuthorRes interface {
	// contains filtered or unexported methods
}

type ReadAnswerParams ¶

type ReadAnswerParams struct {
	// ID of the Answer.
	ID int
}

ReadAnswerParams is parameters of readAnswer operation.

type ReadAnswerQuestionParams ¶

type ReadAnswerQuestionParams struct {
	// ID of the Answer.
	ID int
}

ReadAnswerQuestionParams is parameters of readAnswerQuestion operation.

type ReadAnswerQuestionRes ¶

type ReadAnswerQuestionRes interface {
	// contains filtered or unexported methods
}

type ReadAnswerRes ¶

type ReadAnswerRes interface {
	// contains filtered or unexported methods
}

type ReadQuestionAuthorParams ¶

type ReadQuestionAuthorParams struct {
	// ID of the Question.
	ID int
}

ReadQuestionAuthorParams is parameters of readQuestionAuthor operation.

type ReadQuestionAuthorRes ¶

type ReadQuestionAuthorRes interface {
	// contains filtered or unexported methods
}

type ReadQuestionParams ¶

type ReadQuestionParams struct {
	// ID of the Question.
	ID int
}

ReadQuestionParams is parameters of readQuestion operation.

type ReadQuestionRes ¶

type ReadQuestionRes interface {
	// contains filtered or unexported methods
}

type ReadTagParams ¶

type ReadTagParams struct {
	// ID of the Tag.
	ID int
}

ReadTagParams is parameters of readTag operation.

type ReadTagRes ¶

type ReadTagRes interface {
	// contains filtered or unexported methods
}

type ReadUserParams ¶

type ReadUserParams struct {
	// ID of the User.
	ID int
}

ReadUserParams is parameters of readUser operation.

type ReadUserRes ¶

type ReadUserRes interface {
	// contains filtered or unexported methods
}

type Route ¶

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

Route is route object.

func (Route) Args ¶

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name ¶

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID ¶

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern ¶

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary ¶

func (r Route) Summary() string

Summary returns OpenAPI summary.

type Server ¶

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

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer ¶

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath ¶

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute ¶

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP ¶

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption ¶

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler ¶

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory ¶

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed ¶

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware ¶

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound ¶

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix ¶

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type TagCreate ¶

type TagCreate struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/TagCreate

func NewTagCreate ¶

func NewTagCreate(e *ent.Tag) *TagCreate

func NewTagCreates ¶

func NewTagCreates(es []*ent.Tag) []TagCreate

func (*TagCreate) Decode ¶

func (s *TagCreate) Decode(d *jx.Decoder) error

Decode decodes TagCreate from json.

func (*TagCreate) Elem ¶

func (t *TagCreate) Elem() TagCreate

func (*TagCreate) Encode ¶

func (s *TagCreate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TagCreate) GetID ¶

func (s *TagCreate) GetID() int

GetID returns the value of ID.

func (*TagCreate) GetName ¶

func (s *TagCreate) GetName() string

GetName returns the value of Name.

func (*TagCreate) MarshalJSON ¶

func (s *TagCreate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TagCreate) SetID ¶

func (s *TagCreate) SetID(val int)

SetID sets the value of ID.

func (*TagCreate) SetName ¶

func (s *TagCreate) SetName(val string)

SetName sets the value of Name.

func (*TagCreate) UnmarshalJSON ¶

func (s *TagCreate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TagList ¶

type TagList struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/TagList

func NewTagList ¶

func NewTagList(e *ent.Tag) *TagList

func NewTagLists ¶

func NewTagLists(es []*ent.Tag) []TagList

func (*TagList) Decode ¶

func (s *TagList) Decode(d *jx.Decoder) error

Decode decodes TagList from json.

func (*TagList) Elem ¶

func (t *TagList) Elem() TagList

func (*TagList) Encode ¶

func (s *TagList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TagList) GetID ¶

func (s *TagList) GetID() int

GetID returns the value of ID.

func (*TagList) GetName ¶

func (s *TagList) GetName() string

GetName returns the value of Name.

func (*TagList) MarshalJSON ¶

func (s *TagList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TagList) SetID ¶

func (s *TagList) SetID(val int)

SetID sets the value of ID.

func (*TagList) SetName ¶

func (s *TagList) SetName(val string)

SetName sets the value of Name.

func (*TagList) UnmarshalJSON ¶

func (s *TagList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TagQuestionsList ¶

type TagQuestionsList struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/Tag_QuestionsList

func NewTagQuestionsList ¶

func NewTagQuestionsList(e *ent.Question) *TagQuestionsList

func NewTagQuestionsLists ¶

func NewTagQuestionsLists(es []*ent.Question) []TagQuestionsList

func (*TagQuestionsList) Decode ¶

func (s *TagQuestionsList) Decode(d *jx.Decoder) error

Decode decodes TagQuestionsList from json.

func (*TagQuestionsList) Elem ¶

func (*TagQuestionsList) Encode ¶

func (s *TagQuestionsList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TagQuestionsList) GetContent ¶

func (s *TagQuestionsList) GetContent() string

GetContent returns the value of Content.

func (*TagQuestionsList) GetCreatedAt ¶

func (s *TagQuestionsList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*TagQuestionsList) GetID ¶

func (s *TagQuestionsList) GetID() int

GetID returns the value of ID.

func (*TagQuestionsList) GetLikes ¶

func (s *TagQuestionsList) GetLikes() int

GetLikes returns the value of Likes.

func (*TagQuestionsList) GetSlug ¶

func (s *TagQuestionsList) GetSlug() string

GetSlug returns the value of Slug.

func (*TagQuestionsList) GetTitle ¶

func (s *TagQuestionsList) GetTitle() string

GetTitle returns the value of Title.

func (*TagQuestionsList) GetUpdatedAt ¶

func (s *TagQuestionsList) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*TagQuestionsList) GetViews ¶

func (s *TagQuestionsList) GetViews() int

GetViews returns the value of Views.

func (*TagQuestionsList) MarshalJSON ¶

func (s *TagQuestionsList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TagQuestionsList) SetContent ¶

func (s *TagQuestionsList) SetContent(val string)

SetContent sets the value of Content.

func (*TagQuestionsList) SetCreatedAt ¶

func (s *TagQuestionsList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*TagQuestionsList) SetID ¶

func (s *TagQuestionsList) SetID(val int)

SetID sets the value of ID.

func (*TagQuestionsList) SetLikes ¶

func (s *TagQuestionsList) SetLikes(val int)

SetLikes sets the value of Likes.

func (*TagQuestionsList) SetSlug ¶

func (s *TagQuestionsList) SetSlug(val string)

SetSlug sets the value of Slug.

func (*TagQuestionsList) SetTitle ¶

func (s *TagQuestionsList) SetTitle(val string)

SetTitle sets the value of Title.

func (*TagQuestionsList) SetUpdatedAt ¶

func (s *TagQuestionsList) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*TagQuestionsList) SetViews ¶

func (s *TagQuestionsList) SetViews(val int)

SetViews sets the value of Views.

func (*TagQuestionsList) UnmarshalJSON ¶

func (s *TagQuestionsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TagRead ¶

type TagRead struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/TagRead

func NewTagRead ¶

func NewTagRead(e *ent.Tag) *TagRead

func NewTagReads ¶

func NewTagReads(es []*ent.Tag) []TagRead

func (*TagRead) Decode ¶

func (s *TagRead) Decode(d *jx.Decoder) error

Decode decodes TagRead from json.

func (*TagRead) Elem ¶

func (t *TagRead) Elem() TagRead

func (*TagRead) Encode ¶

func (s *TagRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TagRead) GetID ¶

func (s *TagRead) GetID() int

GetID returns the value of ID.

func (*TagRead) GetName ¶

func (s *TagRead) GetName() string

GetName returns the value of Name.

func (*TagRead) MarshalJSON ¶

func (s *TagRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TagRead) SetID ¶

func (s *TagRead) SetID(val int)

SetID sets the value of ID.

func (*TagRead) SetName ¶

func (s *TagRead) SetName(val string)

SetName sets the value of Name.

func (*TagRead) UnmarshalJSON ¶

func (s *TagRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type TagUpdate ¶

type TagUpdate struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/TagUpdate

func NewTagUpdate ¶

func NewTagUpdate(e *ent.Tag) *TagUpdate

func NewTagUpdates ¶

func NewTagUpdates(es []*ent.Tag) []TagUpdate

func (*TagUpdate) Decode ¶

func (s *TagUpdate) Decode(d *jx.Decoder) error

Decode decodes TagUpdate from json.

func (*TagUpdate) Elem ¶

func (t *TagUpdate) Elem() TagUpdate

func (*TagUpdate) Encode ¶

func (s *TagUpdate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*TagUpdate) GetID ¶

func (s *TagUpdate) GetID() int

GetID returns the value of ID.

func (*TagUpdate) GetName ¶

func (s *TagUpdate) GetName() string

GetName returns the value of Name.

func (*TagUpdate) MarshalJSON ¶

func (s *TagUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*TagUpdate) SetID ¶

func (s *TagUpdate) SetID(val int)

SetID sets the value of ID.

func (*TagUpdate) SetName ¶

func (s *TagUpdate) SetName(val string)

SetName sets the value of Name.

func (*TagUpdate) UnmarshalJSON ¶

func (s *TagUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UnimplementedHandler ¶

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) CreateAnswer ¶

CreateAnswer implements createAnswer operation.

Creates a new Answer and persists it to storage.

POST /answers

func (UnimplementedHandler) CreateQuestion ¶

CreateQuestion implements createQuestion operation.

Creates a new Question and persists it to storage.

POST /questions

func (UnimplementedHandler) CreateTag ¶

func (UnimplementedHandler) CreateTag(ctx context.Context, req *CreateTagReq) (r CreateTagRes, _ error)

CreateTag implements createTag operation.

Creates a new Tag and persists it to storage.

POST /tags

func (UnimplementedHandler) CreateUser ¶

CreateUser implements createUser operation.

Creates a new User and persists it to storage.

POST /users

func (UnimplementedHandler) DeleteAnswer ¶

DeleteAnswer implements deleteAnswer operation.

Deletes the Answer with the requested ID.

DELETE /answers/{id}

func (UnimplementedHandler) DeleteQuestion ¶

DeleteQuestion implements deleteQuestion operation.

Deletes the Question with the requested ID.

DELETE /questions/{id}

func (UnimplementedHandler) DeleteTag ¶

func (UnimplementedHandler) DeleteTag(ctx context.Context, params DeleteTagParams) (r DeleteTagRes, _ error)

DeleteTag implements deleteTag operation.

Deletes the Tag with the requested ID.

DELETE /tags/{id}

func (UnimplementedHandler) DeleteUser ¶

DeleteUser implements deleteUser operation.

Deletes the User with the requested ID.

DELETE /users/{id}

func (UnimplementedHandler) ListAnswer ¶

ListAnswer implements listAnswer operation.

List Answers.

GET /answers

func (UnimplementedHandler) ListQuestion ¶

ListQuestion implements listQuestion operation.

List Questions.

GET /questions

func (UnimplementedHandler) ListQuestionAnswers ¶

ListQuestionAnswers implements listQuestionAnswers operation.

List attached Answers.

GET /questions/{id}/answers

func (UnimplementedHandler) ListQuestionTags ¶

ListQuestionTags implements listQuestionTags operation.

List attached Tags.

GET /questions/{id}/tags

func (UnimplementedHandler) ListTag ¶

func (UnimplementedHandler) ListTag(ctx context.Context, params ListTagParams) (r ListTagRes, _ error)

ListTag implements listTag operation.

List Tags.

GET /tags

func (UnimplementedHandler) ListTagQuestions ¶

ListTagQuestions implements listTagQuestions operation.

List attached Questions.

GET /tags/{id}/questions

func (UnimplementedHandler) ListUser ¶

func (UnimplementedHandler) ListUser(ctx context.Context, params ListUserParams) (r ListUserRes, _ error)

ListUser implements listUser operation.

List Users.

GET /users

func (UnimplementedHandler) ListUserAnswers ¶

ListUserAnswers implements listUserAnswers operation.

List attached Answers.

GET /users/{id}/answers

func (UnimplementedHandler) ListUserQuestions ¶

ListUserQuestions implements listUserQuestions operation.

List attached Questions.

GET /users/{id}/questions

func (UnimplementedHandler) ListUserTags ¶

ListUserTags implements listUserTags operation.

List attached Tags.

GET /users/{id}/tags

func (UnimplementedHandler) ReadAnswer ¶

ReadAnswer implements readAnswer operation.

Finds the Answer with the requested ID and returns it.

GET /answers/{id}

func (UnimplementedHandler) ReadAnswerAuthor ¶

ReadAnswerAuthor implements readAnswerAuthor operation.

Find the attached User of the Answer with the given ID.

GET /answers/{id}/author

func (UnimplementedHandler) ReadAnswerQuestion ¶

ReadAnswerQuestion implements readAnswerQuestion operation.

Find the attached Question of the Answer with the given ID.

GET /answers/{id}/question

func (UnimplementedHandler) ReadQuestion ¶

ReadQuestion implements readQuestion operation.

Finds the Question with the requested ID and returns it.

GET /questions/{id}

func (UnimplementedHandler) ReadQuestionAuthor ¶

ReadQuestionAuthor implements readQuestionAuthor operation.

Find the attached User of the Question with the given ID.

GET /questions/{id}/author

func (UnimplementedHandler) ReadTag ¶

func (UnimplementedHandler) ReadTag(ctx context.Context, params ReadTagParams) (r ReadTagRes, _ error)

ReadTag implements readTag operation.

Finds the Tag with the requested ID and returns it.

GET /tags/{id}

func (UnimplementedHandler) ReadUser ¶

func (UnimplementedHandler) ReadUser(ctx context.Context, params ReadUserParams) (r ReadUserRes, _ error)

ReadUser implements readUser operation.

Finds the User with the requested ID and returns it.

GET /users/{id}

func (UnimplementedHandler) UpdateAnswer ¶

UpdateAnswer implements updateAnswer operation.

Updates a Answer and persists changes to storage.

PATCH /answers/{id}

func (UnimplementedHandler) UpdateQuestion ¶

UpdateQuestion implements updateQuestion operation.

Updates a Question and persists changes to storage.

PATCH /questions/{id}

func (UnimplementedHandler) UpdateTag ¶

UpdateTag implements updateTag operation.

Updates a Tag and persists changes to storage.

PATCH /tags/{id}

func (UnimplementedHandler) UpdateUser ¶

UpdateUser implements updateUser operation.

Updates a User and persists changes to storage.

PATCH /users/{id}

type UpdateAnswerParams ¶

type UpdateAnswerParams struct {
	// ID of the Answer.
	ID int
}

UpdateAnswerParams is parameters of updateAnswer operation.

type UpdateAnswerReq ¶

type UpdateAnswerReq struct {
	Content          OptString   `json:"content"`
	Likes            OptInt      `json:"likes"`
	UpdatedAt        OptDateTime `json:"updated_at"`
	IsAcceptedAnswer OptBool     `json:"is_accepted_answer"`
	Question         OptInt      `json:"question"`
	Author           OptInt      `json:"author"`
}

func (*UpdateAnswerReq) Decode ¶

func (s *UpdateAnswerReq) Decode(d *jx.Decoder) error

Decode decodes UpdateAnswerReq from json.

func (*UpdateAnswerReq) Encode ¶

func (s *UpdateAnswerReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UpdateAnswerReq) GetAuthor ¶

func (s *UpdateAnswerReq) GetAuthor() OptInt

GetAuthor returns the value of Author.

func (*UpdateAnswerReq) GetContent ¶

func (s *UpdateAnswerReq) GetContent() OptString

GetContent returns the value of Content.

func (*UpdateAnswerReq) GetIsAcceptedAnswer ¶

func (s *UpdateAnswerReq) GetIsAcceptedAnswer() OptBool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*UpdateAnswerReq) GetLikes ¶

func (s *UpdateAnswerReq) GetLikes() OptInt

GetLikes returns the value of Likes.

func (*UpdateAnswerReq) GetQuestion ¶

func (s *UpdateAnswerReq) GetQuestion() OptInt

GetQuestion returns the value of Question.

func (*UpdateAnswerReq) GetUpdatedAt ¶

func (s *UpdateAnswerReq) GetUpdatedAt() OptDateTime

GetUpdatedAt returns the value of UpdatedAt.

func (*UpdateAnswerReq) MarshalJSON ¶

func (s *UpdateAnswerReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UpdateAnswerReq) SetAuthor ¶

func (s *UpdateAnswerReq) SetAuthor(val OptInt)

SetAuthor sets the value of Author.

func (*UpdateAnswerReq) SetContent ¶

func (s *UpdateAnswerReq) SetContent(val OptString)

SetContent sets the value of Content.

func (*UpdateAnswerReq) SetIsAcceptedAnswer ¶

func (s *UpdateAnswerReq) SetIsAcceptedAnswer(val OptBool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*UpdateAnswerReq) SetLikes ¶

func (s *UpdateAnswerReq) SetLikes(val OptInt)

SetLikes sets the value of Likes.

func (*UpdateAnswerReq) SetQuestion ¶

func (s *UpdateAnswerReq) SetQuestion(val OptInt)

SetQuestion sets the value of Question.

func (*UpdateAnswerReq) SetUpdatedAt ¶

func (s *UpdateAnswerReq) SetUpdatedAt(val OptDateTime)

SetUpdatedAt sets the value of UpdatedAt.

func (*UpdateAnswerReq) UnmarshalJSON ¶

func (s *UpdateAnswerReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateAnswerRes ¶

type UpdateAnswerRes interface {
	// contains filtered or unexported methods
}

type UpdateQuestionParams ¶

type UpdateQuestionParams struct {
	// ID of the Question.
	ID int
}

UpdateQuestionParams is parameters of updateQuestion operation.

type UpdateQuestionReq ¶

type UpdateQuestionReq struct {
	Title     OptString   `json:"title"`
	Slug      OptString   `json:"slug"`
	Content   OptString   `json:"content"`
	UpdatedAt OptDateTime `json:"updated_at"`
	Views     OptInt      `json:"views"`
	Likes     OptInt      `json:"likes"`
	Answers   []int       `json:"answers"`
	Author    OptInt      `json:"author"`
	Tags      []int       `json:"tags"`
}

func (*UpdateQuestionReq) Decode ¶

func (s *UpdateQuestionReq) Decode(d *jx.Decoder) error

Decode decodes UpdateQuestionReq from json.

func (*UpdateQuestionReq) Encode ¶

func (s *UpdateQuestionReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UpdateQuestionReq) GetAnswers ¶

func (s *UpdateQuestionReq) GetAnswers() []int

GetAnswers returns the value of Answers.

func (*UpdateQuestionReq) GetAuthor ¶

func (s *UpdateQuestionReq) GetAuthor() OptInt

GetAuthor returns the value of Author.

func (*UpdateQuestionReq) GetContent ¶

func (s *UpdateQuestionReq) GetContent() OptString

GetContent returns the value of Content.

func (*UpdateQuestionReq) GetLikes ¶

func (s *UpdateQuestionReq) GetLikes() OptInt

GetLikes returns the value of Likes.

func (*UpdateQuestionReq) GetSlug ¶

func (s *UpdateQuestionReq) GetSlug() OptString

GetSlug returns the value of Slug.

func (*UpdateQuestionReq) GetTags ¶

func (s *UpdateQuestionReq) GetTags() []int

GetTags returns the value of Tags.

func (*UpdateQuestionReq) GetTitle ¶

func (s *UpdateQuestionReq) GetTitle() OptString

GetTitle returns the value of Title.

func (*UpdateQuestionReq) GetUpdatedAt ¶

func (s *UpdateQuestionReq) GetUpdatedAt() OptDateTime

GetUpdatedAt returns the value of UpdatedAt.

func (*UpdateQuestionReq) GetViews ¶

func (s *UpdateQuestionReq) GetViews() OptInt

GetViews returns the value of Views.

func (*UpdateQuestionReq) MarshalJSON ¶

func (s *UpdateQuestionReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UpdateQuestionReq) SetAnswers ¶

func (s *UpdateQuestionReq) SetAnswers(val []int)

SetAnswers sets the value of Answers.

func (*UpdateQuestionReq) SetAuthor ¶

func (s *UpdateQuestionReq) SetAuthor(val OptInt)

SetAuthor sets the value of Author.

func (*UpdateQuestionReq) SetContent ¶

func (s *UpdateQuestionReq) SetContent(val OptString)

SetContent sets the value of Content.

func (*UpdateQuestionReq) SetLikes ¶

func (s *UpdateQuestionReq) SetLikes(val OptInt)

SetLikes sets the value of Likes.

func (*UpdateQuestionReq) SetSlug ¶

func (s *UpdateQuestionReq) SetSlug(val OptString)

SetSlug sets the value of Slug.

func (*UpdateQuestionReq) SetTags ¶

func (s *UpdateQuestionReq) SetTags(val []int)

SetTags sets the value of Tags.

func (*UpdateQuestionReq) SetTitle ¶

func (s *UpdateQuestionReq) SetTitle(val OptString)

SetTitle sets the value of Title.

func (*UpdateQuestionReq) SetUpdatedAt ¶

func (s *UpdateQuestionReq) SetUpdatedAt(val OptDateTime)

SetUpdatedAt sets the value of UpdatedAt.

func (*UpdateQuestionReq) SetViews ¶

func (s *UpdateQuestionReq) SetViews(val OptInt)

SetViews sets the value of Views.

func (*UpdateQuestionReq) UnmarshalJSON ¶

func (s *UpdateQuestionReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateQuestionRes ¶

type UpdateQuestionRes interface {
	// contains filtered or unexported methods
}

type UpdateTagParams ¶

type UpdateTagParams struct {
	// ID of the Tag.
	ID int
}

UpdateTagParams is parameters of updateTag operation.

type UpdateTagReq ¶

type UpdateTagReq struct {
	Name      OptString `json:"name"`
	Questions []int     `json:"questions"`
}

func (*UpdateTagReq) Decode ¶

func (s *UpdateTagReq) Decode(d *jx.Decoder) error

Decode decodes UpdateTagReq from json.

func (*UpdateTagReq) Encode ¶

func (s *UpdateTagReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UpdateTagReq) GetName ¶

func (s *UpdateTagReq) GetName() OptString

GetName returns the value of Name.

func (*UpdateTagReq) GetQuestions ¶

func (s *UpdateTagReq) GetQuestions() []int

GetQuestions returns the value of Questions.

func (*UpdateTagReq) MarshalJSON ¶

func (s *UpdateTagReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UpdateTagReq) SetName ¶

func (s *UpdateTagReq) SetName(val OptString)

SetName sets the value of Name.

func (*UpdateTagReq) SetQuestions ¶

func (s *UpdateTagReq) SetQuestions(val []int)

SetQuestions sets the value of Questions.

func (*UpdateTagReq) UnmarshalJSON ¶

func (s *UpdateTagReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateTagRes ¶

type UpdateTagRes interface {
	// contains filtered or unexported methods
}

type UpdateUserParams ¶

type UpdateUserParams struct {
	// ID of the User.
	ID int
}

UpdateUserParams is parameters of updateUser operation.

type UpdateUserReq ¶

type UpdateUserReq struct {
	Username  OptString   `json:"username"`
	Email     OptString   `json:"email"`
	Password  OptString   `json:"password"`
	LastLogin OptDateTime `json:"last_login"`
	Questions []int       `json:"questions"`
	Answers   []int       `json:"answers"`
	Tags      []int       `json:"tags"`
}

func (*UpdateUserReq) Decode ¶

func (s *UpdateUserReq) Decode(d *jx.Decoder) error

Decode decodes UpdateUserReq from json.

func (*UpdateUserReq) Encode ¶

func (s *UpdateUserReq) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UpdateUserReq) GetAnswers ¶

func (s *UpdateUserReq) GetAnswers() []int

GetAnswers returns the value of Answers.

func (*UpdateUserReq) GetEmail ¶

func (s *UpdateUserReq) GetEmail() OptString

GetEmail returns the value of Email.

func (*UpdateUserReq) GetLastLogin ¶

func (s *UpdateUserReq) GetLastLogin() OptDateTime

GetLastLogin returns the value of LastLogin.

func (*UpdateUserReq) GetPassword ¶

func (s *UpdateUserReq) GetPassword() OptString

GetPassword returns the value of Password.

func (*UpdateUserReq) GetQuestions ¶

func (s *UpdateUserReq) GetQuestions() []int

GetQuestions returns the value of Questions.

func (*UpdateUserReq) GetTags ¶

func (s *UpdateUserReq) GetTags() []int

GetTags returns the value of Tags.

func (*UpdateUserReq) GetUsername ¶

func (s *UpdateUserReq) GetUsername() OptString

GetUsername returns the value of Username.

func (*UpdateUserReq) MarshalJSON ¶

func (s *UpdateUserReq) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UpdateUserReq) SetAnswers ¶

func (s *UpdateUserReq) SetAnswers(val []int)

SetAnswers sets the value of Answers.

func (*UpdateUserReq) SetEmail ¶

func (s *UpdateUserReq) SetEmail(val OptString)

SetEmail sets the value of Email.

func (*UpdateUserReq) SetLastLogin ¶

func (s *UpdateUserReq) SetLastLogin(val OptDateTime)

SetLastLogin sets the value of LastLogin.

func (*UpdateUserReq) SetPassword ¶

func (s *UpdateUserReq) SetPassword(val OptString)

SetPassword sets the value of Password.

func (*UpdateUserReq) SetQuestions ¶

func (s *UpdateUserReq) SetQuestions(val []int)

SetQuestions sets the value of Questions.

func (*UpdateUserReq) SetTags ¶

func (s *UpdateUserReq) SetTags(val []int)

SetTags sets the value of Tags.

func (*UpdateUserReq) SetUsername ¶

func (s *UpdateUserReq) SetUsername(val OptString)

SetUsername sets the value of Username.

func (*UpdateUserReq) UnmarshalJSON ¶

func (s *UpdateUserReq) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UpdateUserRes ¶

type UpdateUserRes interface {
	// contains filtered or unexported methods
}

type UserAnswersList ¶

type UserAnswersList struct {
	ID               int       `json:"id"`
	Content          string    `json:"content"`
	Likes            int       `json:"likes"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	IsAcceptedAnswer bool      `json:"is_accepted_answer"`
}

Ref: #/components/schemas/User_AnswersList

func NewUserAnswersList ¶

func NewUserAnswersList(e *ent.Answer) *UserAnswersList

func NewUserAnswersLists ¶

func NewUserAnswersLists(es []*ent.Answer) []UserAnswersList

func (*UserAnswersList) Decode ¶

func (s *UserAnswersList) Decode(d *jx.Decoder) error

Decode decodes UserAnswersList from json.

func (*UserAnswersList) Elem ¶

func (a *UserAnswersList) Elem() UserAnswersList

func (*UserAnswersList) Encode ¶

func (s *UserAnswersList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserAnswersList) GetContent ¶

func (s *UserAnswersList) GetContent() string

GetContent returns the value of Content.

func (*UserAnswersList) GetCreatedAt ¶

func (s *UserAnswersList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*UserAnswersList) GetID ¶

func (s *UserAnswersList) GetID() int

GetID returns the value of ID.

func (*UserAnswersList) GetIsAcceptedAnswer ¶

func (s *UserAnswersList) GetIsAcceptedAnswer() bool

GetIsAcceptedAnswer returns the value of IsAcceptedAnswer.

func (*UserAnswersList) GetLikes ¶

func (s *UserAnswersList) GetLikes() int

GetLikes returns the value of Likes.

func (*UserAnswersList) GetUpdatedAt ¶

func (s *UserAnswersList) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*UserAnswersList) MarshalJSON ¶

func (s *UserAnswersList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserAnswersList) SetContent ¶

func (s *UserAnswersList) SetContent(val string)

SetContent sets the value of Content.

func (*UserAnswersList) SetCreatedAt ¶

func (s *UserAnswersList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*UserAnswersList) SetID ¶

func (s *UserAnswersList) SetID(val int)

SetID sets the value of ID.

func (*UserAnswersList) SetIsAcceptedAnswer ¶

func (s *UserAnswersList) SetIsAcceptedAnswer(val bool)

SetIsAcceptedAnswer sets the value of IsAcceptedAnswer.

func (*UserAnswersList) SetLikes ¶

func (s *UserAnswersList) SetLikes(val int)

SetLikes sets the value of Likes.

func (*UserAnswersList) SetUpdatedAt ¶

func (s *UserAnswersList) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*UserAnswersList) UnmarshalJSON ¶

func (s *UserAnswersList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserCreate ¶

type UserCreate struct {
	ID        int       `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
}

Ref: #/components/schemas/UserCreate

func NewUserCreate ¶

func NewUserCreate(e *ent.User) *UserCreate

func NewUserCreates ¶

func NewUserCreates(es []*ent.User) []UserCreate

func (*UserCreate) Decode ¶

func (s *UserCreate) Decode(d *jx.Decoder) error

Decode decodes UserCreate from json.

func (*UserCreate) Elem ¶

func (u *UserCreate) Elem() UserCreate

func (*UserCreate) Encode ¶

func (s *UserCreate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserCreate) GetCreatedAt ¶

func (s *UserCreate) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*UserCreate) GetEmail ¶

func (s *UserCreate) GetEmail() string

GetEmail returns the value of Email.

func (*UserCreate) GetID ¶

func (s *UserCreate) GetID() int

GetID returns the value of ID.

func (*UserCreate) GetLastLogin ¶

func (s *UserCreate) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*UserCreate) GetUsername ¶

func (s *UserCreate) GetUsername() string

GetUsername returns the value of Username.

func (*UserCreate) MarshalJSON ¶

func (s *UserCreate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserCreate) SetCreatedAt ¶

func (s *UserCreate) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*UserCreate) SetEmail ¶

func (s *UserCreate) SetEmail(val string)

SetEmail sets the value of Email.

func (*UserCreate) SetID ¶

func (s *UserCreate) SetID(val int)

SetID sets the value of ID.

func (*UserCreate) SetLastLogin ¶

func (s *UserCreate) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*UserCreate) SetUsername ¶

func (s *UserCreate) SetUsername(val string)

SetUsername sets the value of Username.

func (*UserCreate) UnmarshalJSON ¶

func (s *UserCreate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserList ¶

type UserList struct {
	ID        int       `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
}

Ref: #/components/schemas/UserList

func NewUserList ¶

func NewUserList(e *ent.User) *UserList

func NewUserLists ¶

func NewUserLists(es []*ent.User) []UserList

func (*UserList) Decode ¶

func (s *UserList) Decode(d *jx.Decoder) error

Decode decodes UserList from json.

func (*UserList) Elem ¶

func (u *UserList) Elem() UserList

func (*UserList) Encode ¶

func (s *UserList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserList) GetCreatedAt ¶

func (s *UserList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*UserList) GetEmail ¶

func (s *UserList) GetEmail() string

GetEmail returns the value of Email.

func (*UserList) GetID ¶

func (s *UserList) GetID() int

GetID returns the value of ID.

func (*UserList) GetLastLogin ¶

func (s *UserList) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*UserList) GetUsername ¶

func (s *UserList) GetUsername() string

GetUsername returns the value of Username.

func (*UserList) MarshalJSON ¶

func (s *UserList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserList) SetCreatedAt ¶

func (s *UserList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*UserList) SetEmail ¶

func (s *UserList) SetEmail(val string)

SetEmail sets the value of Email.

func (*UserList) SetID ¶

func (s *UserList) SetID(val int)

SetID sets the value of ID.

func (*UserList) SetLastLogin ¶

func (s *UserList) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*UserList) SetUsername ¶

func (s *UserList) SetUsername(val string)

SetUsername sets the value of Username.

func (*UserList) UnmarshalJSON ¶

func (s *UserList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserQuestionsList ¶

type UserQuestionsList struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int       `json:"views"`
	Likes     int       `json:"likes"`
}

Ref: #/components/schemas/User_QuestionsList

func NewUserQuestionsList ¶

func NewUserQuestionsList(e *ent.Question) *UserQuestionsList

func NewUserQuestionsLists ¶

func NewUserQuestionsLists(es []*ent.Question) []UserQuestionsList

func (*UserQuestionsList) Decode ¶

func (s *UserQuestionsList) Decode(d *jx.Decoder) error

Decode decodes UserQuestionsList from json.

func (*UserQuestionsList) Elem ¶

func (*UserQuestionsList) Encode ¶

func (s *UserQuestionsList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserQuestionsList) GetContent ¶

func (s *UserQuestionsList) GetContent() string

GetContent returns the value of Content.

func (*UserQuestionsList) GetCreatedAt ¶

func (s *UserQuestionsList) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*UserQuestionsList) GetID ¶

func (s *UserQuestionsList) GetID() int

GetID returns the value of ID.

func (*UserQuestionsList) GetLikes ¶

func (s *UserQuestionsList) GetLikes() int

GetLikes returns the value of Likes.

func (*UserQuestionsList) GetSlug ¶

func (s *UserQuestionsList) GetSlug() string

GetSlug returns the value of Slug.

func (*UserQuestionsList) GetTitle ¶

func (s *UserQuestionsList) GetTitle() string

GetTitle returns the value of Title.

func (*UserQuestionsList) GetUpdatedAt ¶

func (s *UserQuestionsList) GetUpdatedAt() time.Time

GetUpdatedAt returns the value of UpdatedAt.

func (*UserQuestionsList) GetViews ¶

func (s *UserQuestionsList) GetViews() int

GetViews returns the value of Views.

func (*UserQuestionsList) MarshalJSON ¶

func (s *UserQuestionsList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserQuestionsList) SetContent ¶

func (s *UserQuestionsList) SetContent(val string)

SetContent sets the value of Content.

func (*UserQuestionsList) SetCreatedAt ¶

func (s *UserQuestionsList) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*UserQuestionsList) SetID ¶

func (s *UserQuestionsList) SetID(val int)

SetID sets the value of ID.

func (*UserQuestionsList) SetLikes ¶

func (s *UserQuestionsList) SetLikes(val int)

SetLikes sets the value of Likes.

func (*UserQuestionsList) SetSlug ¶

func (s *UserQuestionsList) SetSlug(val string)

SetSlug sets the value of Slug.

func (*UserQuestionsList) SetTitle ¶

func (s *UserQuestionsList) SetTitle(val string)

SetTitle sets the value of Title.

func (*UserQuestionsList) SetUpdatedAt ¶

func (s *UserQuestionsList) SetUpdatedAt(val time.Time)

SetUpdatedAt sets the value of UpdatedAt.

func (*UserQuestionsList) SetViews ¶

func (s *UserQuestionsList) SetViews(val int)

SetViews sets the value of Views.

func (*UserQuestionsList) UnmarshalJSON ¶

func (s *UserQuestionsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserRead ¶

type UserRead struct {
	ID        int       `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
}

Ref: #/components/schemas/UserRead

func NewUserRead ¶

func NewUserRead(e *ent.User) *UserRead

func NewUserReads ¶

func NewUserReads(es []*ent.User) []UserRead

func (*UserRead) Decode ¶

func (s *UserRead) Decode(d *jx.Decoder) error

Decode decodes UserRead from json.

func (*UserRead) Elem ¶

func (u *UserRead) Elem() UserRead

func (*UserRead) Encode ¶

func (s *UserRead) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserRead) GetCreatedAt ¶

func (s *UserRead) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*UserRead) GetEmail ¶

func (s *UserRead) GetEmail() string

GetEmail returns the value of Email.

func (*UserRead) GetID ¶

func (s *UserRead) GetID() int

GetID returns the value of ID.

func (*UserRead) GetLastLogin ¶

func (s *UserRead) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*UserRead) GetUsername ¶

func (s *UserRead) GetUsername() string

GetUsername returns the value of Username.

func (*UserRead) MarshalJSON ¶

func (s *UserRead) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserRead) SetCreatedAt ¶

func (s *UserRead) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*UserRead) SetEmail ¶

func (s *UserRead) SetEmail(val string)

SetEmail sets the value of Email.

func (*UserRead) SetID ¶

func (s *UserRead) SetID(val int)

SetID sets the value of ID.

func (*UserRead) SetLastLogin ¶

func (s *UserRead) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*UserRead) SetUsername ¶

func (s *UserRead) SetUsername(val string)

SetUsername sets the value of Username.

func (*UserRead) UnmarshalJSON ¶

func (s *UserRead) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserTagsList ¶

type UserTagsList struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Ref: #/components/schemas/User_TagsList

func NewUserTagsList ¶

func NewUserTagsList(e *ent.Tag) *UserTagsList

func NewUserTagsLists ¶

func NewUserTagsLists(es []*ent.Tag) []UserTagsList

func (*UserTagsList) Decode ¶

func (s *UserTagsList) Decode(d *jx.Decoder) error

Decode decodes UserTagsList from json.

func (*UserTagsList) Elem ¶

func (t *UserTagsList) Elem() UserTagsList

func (*UserTagsList) Encode ¶

func (s *UserTagsList) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserTagsList) GetID ¶

func (s *UserTagsList) GetID() int

GetID returns the value of ID.

func (*UserTagsList) GetName ¶

func (s *UserTagsList) GetName() string

GetName returns the value of Name.

func (*UserTagsList) MarshalJSON ¶

func (s *UserTagsList) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserTagsList) SetID ¶

func (s *UserTagsList) SetID(val int)

SetID sets the value of ID.

func (*UserTagsList) SetName ¶

func (s *UserTagsList) SetName(val string)

SetName sets the value of Name.

func (*UserTagsList) UnmarshalJSON ¶

func (s *UserTagsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type UserUpdate ¶

type UserUpdate struct {
	ID        int       `json:"id"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	LastLogin time.Time `json:"last_login"`
}

Ref: #/components/schemas/UserUpdate

func NewUserUpdate ¶

func NewUserUpdate(e *ent.User) *UserUpdate

func NewUserUpdates ¶

func NewUserUpdates(es []*ent.User) []UserUpdate

func (*UserUpdate) Decode ¶

func (s *UserUpdate) Decode(d *jx.Decoder) error

Decode decodes UserUpdate from json.

func (*UserUpdate) Elem ¶

func (u *UserUpdate) Elem() UserUpdate

func (*UserUpdate) Encode ¶

func (s *UserUpdate) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*UserUpdate) GetCreatedAt ¶

func (s *UserUpdate) GetCreatedAt() time.Time

GetCreatedAt returns the value of CreatedAt.

func (*UserUpdate) GetEmail ¶

func (s *UserUpdate) GetEmail() string

GetEmail returns the value of Email.

func (*UserUpdate) GetID ¶

func (s *UserUpdate) GetID() int

GetID returns the value of ID.

func (*UserUpdate) GetLastLogin ¶

func (s *UserUpdate) GetLastLogin() time.Time

GetLastLogin returns the value of LastLogin.

func (*UserUpdate) GetUsername ¶

func (s *UserUpdate) GetUsername() string

GetUsername returns the value of Username.

func (*UserUpdate) MarshalJSON ¶

func (s *UserUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*UserUpdate) SetCreatedAt ¶

func (s *UserUpdate) SetCreatedAt(val time.Time)

SetCreatedAt sets the value of CreatedAt.

func (*UserUpdate) SetEmail ¶

func (s *UserUpdate) SetEmail(val string)

SetEmail sets the value of Email.

func (*UserUpdate) SetID ¶

func (s *UserUpdate) SetID(val int)

SetID sets the value of ID.

func (*UserUpdate) SetLastLogin ¶

func (s *UserUpdate) SetLastLogin(val time.Time)

SetLastLogin sets the value of LastLogin.

func (*UserUpdate) SetUsername ¶

func (s *UserUpdate) SetUsername(val string)

SetUsername sets the value of Username.

func (*UserUpdate) UnmarshalJSON ¶

func (s *UserUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

Jump to

Keyboard shortcuts

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