types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SerializeError

func SerializeError(err *CommonError) []byte

Types

type CommonError

type CommonError struct {
	Errors []Error `json:"errors,omitempty"`
}

func (*CommonError) Err

func (c *CommonError) Err() error

type CommonResponse

type CommonResponse struct {
	Success any          `json:"success,omitempty"`
	Error   *CommonError `json:"error,omitempty"`
}

type CommonResponseTyped

type CommonResponseTyped[T any] struct {
	Success T            `json:"success,omitempty"`
	Error   *CommonError `json:"error,omitempty"`
}

type Error

type Error struct {
	HTTPCode int    `json:"http_code,omitempty"`
	Code     string `json:"code,omitempty"`
	Message  string `json:"message,omitempty"`
	URL      string `json:"url,omitempty"`
	IconURL  string `json:"icon_url,omitempty"`
	ImageURL string `json:"image_url,omitempty"`
}

type ProfileAvatar

type ProfileAvatar struct {
	ID          int64  `json:"id"`
	URL         string `json:"url"`
	DisplayName string `json:"display_name"`
	ImageURL    string `json:"image_url_100"`
	ClickURL    string `json:"click_url"`
	IsVerified  bool   `json:"is_verified"`
	LastOnline  string `json:"last_online"`
	Location    string `json:"location"`
}

User Identity

func (*ProfileAvatar) GetID

func (i *ProfileAvatar) GetID() int64

func (*ProfileAvatar) GetOwnerID

func (i *ProfileAvatar) GetOwnerID() int64

func (*ProfileAvatar) MarshalTo

func (i *ProfileAvatar) MarshalTo() ([]byte, error)

func (*ProfileAvatar) SetID

func (i *ProfileAvatar) SetID(id int64)

func (*ProfileAvatar) SetOwnerID

func (i *ProfileAvatar) SetOwnerID(id int64)

func (*ProfileAvatar) UnmarshalFrom

func (i *ProfileAvatar) UnmarshalFrom(payload []byte) error

func (*ProfileAvatar) Validate

func (i *ProfileAvatar) Validate() *CommonError

Jump to

Keyboard shortcuts

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