models

package
Version: v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID     string // 客户端ID
	Secret string // 密钥
	Domain string // 域名url
}

Client 客户端信息

func NewClient

func NewClient() *Client

NewClient 创建客户端模型实例

func (*Client) GetDomain

func (c *Client) GetDomain() string

GetDomain 域名URL

func (*Client) GetExtraData

func (c *Client) GetExtraData() interface{}

GetExtraData 扩展数据

func (*Client) GetID

func (c *Client) GetID() string

GetID 客户端ID

func (*Client) GetSecret

func (c *Client) GetSecret() string

GetSecret 客户端秘钥

type Token

type Token struct {
	ClientID         string        `bson:"ClientID"`         // 客户端标识
	UserID           string        `bson:"UserID"`           // 用户标识
	RedirectURI      string        `bson:"RedirectURI"`      // 重定向URI
	Scope            string        `bson:"Scope"`            // 权限范围
	AuthType         string        `bson:"AuthType"`         // 令牌授权类型
	Access           string        `bson:"Access"`           // 访问令牌
	AccessCreateAt   time.Time     `bson:"AccessCreateAt"`   // 访问令牌创建时间
	AccessExpiresIn  time.Duration `bson:"AccessExpiresIn"`  // 访问令牌有效期
	Refresh          string        `bson:"Refresh"`          // 更新令牌
	RefreshCreateAt  time.Time     `bson:"RefreshCreateAt"`  // 更新令牌创建时间
	RefreshExpiresIn time.Duration `bson:"RefreshExpiresIn"` // 更新令牌有效期
}

Token 令牌信息

func NewToken

func NewToken() *Token

NewToken 创建令牌模型实例

func (*Token) GetAccess

func (t *Token) GetAccess() string

GetAccess 访问令牌

func (*Token) GetAccessCreateAt

func (t *Token) GetAccessCreateAt() time.Time

GetAccessCreateAt 访问令牌创建时间

func (*Token) GetAccessExpiresIn

func (t *Token) GetAccessExpiresIn() time.Duration

GetAccessExpiresIn 访问令牌有效期

func (*Token) GetAuthType

func (t *Token) GetAuthType() string

GetAuthType 授权类型

func (*Token) GetClientID

func (t *Token) GetClientID() string

GetClientID 客户端ID

func (*Token) GetRedirectURI

func (t *Token) GetRedirectURI() string

GetRedirectURI 重定向URI

func (*Token) GetRefresh

func (t *Token) GetRefresh() string

GetRefresh 更新令牌

func (*Token) GetRefreshCreateAt

func (t *Token) GetRefreshCreateAt() time.Time

GetRefreshCreateAt 更新令牌创建时间

func (*Token) GetRefreshExpiresIn

func (t *Token) GetRefreshExpiresIn() time.Duration

GetRefreshExpiresIn 更新令牌有效期

func (*Token) GetScope

func (t *Token) GetScope() string

GetScope 权限范围

func (*Token) GetUserID

func (t *Token) GetUserID() string

GetUserID 用户ID

func (*Token) SetAccess

func (t *Token) SetAccess(access string)

SetAccess 设置访问令牌

func (*Token) SetAccessCreateAt

func (t *Token) SetAccessCreateAt(createAt time.Time)

SetAccessCreateAt 设置访问令牌创建时间

func (*Token) SetAccessExpiresIn

func (t *Token) SetAccessExpiresIn(exp time.Duration)

SetAccessExpiresIn 设置访问令牌有效期

func (*Token) SetAuthType

func (t *Token) SetAuthType(authType string)

SetAuthType 设置授权类型

func (*Token) SetClientID

func (t *Token) SetClientID(clientID string)

SetClientID 设置客户端ID

func (*Token) SetRedirectURI

func (t *Token) SetRedirectURI(redirectURI string)

SetRedirectURI 设置重定向URI

func (*Token) SetRefresh

func (t *Token) SetRefresh(refresh string)

SetRefresh 设置更新令牌

func (*Token) SetRefreshCreateAt

func (t *Token) SetRefreshCreateAt(createAt time.Time)

SetRefreshCreateAt 设置更新令牌创建时间

func (*Token) SetRefreshExpiresIn

func (t *Token) SetRefreshExpiresIn(exp time.Duration)

SetRefreshExpiresIn 设置更新令牌有效期

func (*Token) SetScope

func (t *Token) SetScope(scope string)

SetScope 设置权限范围

func (*Token) SetUserID

func (t *Token) SetUserID(userID string)

SetUserID 设置用户ID

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL