types

package
v1.48.0-dev.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetMeResponse

type GetMeResponse struct {
	User    *models.User    `json:"user" required:"true" nullable:"false"`
	Session *models.Session `json:"session" required:"true" nullable:"false"`
}

type GetMeResult

type GetMeResult struct {
	User    *models.User
	Session *models.Session
}

type Optional

type Optional[T any] struct {
	Value   T
	Present bool
}

Optional represents a JSON object field that may be absent, present with a null value, or present with a concrete value. The zero value is "absent".

It is used on PATCH-style request structs to tell an omitted field apart from a field explicitly set to null, which a plain pointer cannot do.

Use the `omitzero` JSON tag so an absent field is left out when encoding.

func (Optional[T]) IsZero

func (o Optional[T]) IsZero() bool

IsZero reports whether the field was absent so that encoding/json can omit it when the `omitzero` option is used.

func (Optional[T]) MarshalJSON

func (o Optional[T]) MarshalJSON() ([]byte, error)

MarshalJSON encodes the underlying value. An absent optional is omitted from the object when the field uses the `omitzero` tag.

func (Optional[T]) PrepareJSONSchema

func (o Optional[T]) PrepareJSONSchema(schema *jsonschema.Schema) error

PrepareJSONSchema makes the generated schema describe the inner type T instead of the wrapper struct. This keeps Optional invisible to API clients.

It works for scalar, pointer, and map inner types. Named struct inner types can produce references that the outer reflector does not collect.

func (*Optional[T]) UnmarshalJSON

func (o *Optional[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON records that the field was present and decodes its value.

type SignOutRequest

type SignOutRequest struct {
	SessionID  *string `json:"session_id,omitempty" nullable:"true"`
	SignOutAll *bool   `json:"sign_out_all,omitempty" nullable:"true"`
}

func (*SignOutRequest) Validate

func (req *SignOutRequest) Validate() error

type SignOutResponse

type SignOutResponse struct {
	Message string `json:"message" required:"true" nullable:"false"`
}

type SignOutResult

type SignOutResult struct {
	Message               string
	ClearedCurrentSession bool
}

Jump to

Keyboard shortcuts

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