dto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubTeam

type GithubTeam struct {
	Id           int                    `json:"id,omitempty"`
	Organization map[string]interface{} `json:"organization,omitempty"`
	Name         string                 `json:"name,omitempty"`
	Slug         string                 `json:"slug,omitempty"`
}

GithubTeam Github OAuth 协议登录Team结构

type GithubUser

type GithubUser struct {
	Id        int    `json:"id,omitempty"`
	Login     string `json:"login,omitempty"`
	Name      string `json:"name,omitempty"`
	AvatarURL string `json:"avatar_url,omitempty"`
	HTMLURL   string `json:"html_url,omitempty"`
	Type      string `json:"type,omitempty"` // "Type" must be "user", "team", oder "org"
}

GithubUser Github OAuth 协议登录用户结构

type GitlabUser

type GitlabUser struct {
	Id       int    `json:"Id"`
	Username string `json:"Username"`
	Email    string `json:"Email"`
	Name     string `json:"Name"`
	State    string `json:"State"`
}

GitlabUser Gitlab OAuth 协议登录用户结构

type Token

type Token struct {
	Token     string `json:"token" msgpack:"t"`
	AuthAt    int64  `json:"auth_at" msgpack:"at"`
	ExpiresIn int64  `json:"expires_in" msgpack:"ex"` // Token 多长时间后过期(s)
}

func NewToken

func NewToken(expiresIn int64) Token

func (Token) Marshal

func (t Token) Marshal() ([]byte, error)

func (*Token) Unmarshal added in v0.2.0

func (t *Token) Unmarshal(content []byte) error

type User

type User struct {
	Uid      int64  `json:"uid"`      // 用户uid
	Nickname string `json:"nickname"` // 用户昵称,中文名
	Username string `json:"username"` // 用户名,拼音
	Avatar   string `json:"avatar"`   // 头像
	Email    string `json:"email"`    // 邮箱
	State    int    `json:"state"`    // 状态
}

User 用户信息

func (*User) Marshal

func (u *User) Marshal() (string, error)

func (*User) ToGithubUser

func (u *User) ToGithubUser() GithubUser

func (*User) ToGitlabUser

func (u *User) ToGitlabUser() GitlabUser

func (*User) Unmarshal added in v0.2.0

func (u *User) Unmarshal(content []byte) error

Jump to

Keyboard shortcuts

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