Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMicroRequest ¶
type CreateMicroRequest struct { *token.Session `bson:"-" json:"-"` Name string `bson:"name" json:"name" validate:"required,lte=200"` // 名称 Label map[string]string `bson:"label" json:"label" validate:"lte=80"` // 服务标签 Description string `bson:"description" json:"description,omitempty"` // 描述信息 Enabled bool `bson:"enabled" json:"enabled"` // 是否启用该服务 TokenExpireTime int64 `bson:"token_expire_time" json:"token_expire_time,omitempty"` // 凭证申请的token的过期时间 // 创建者ID }
CreateMicroRequest 服务创建请求
func NewCreateMicroRequest ¶
func NewCreateMicroRequest() *CreateMicroRequest
NewCreateMicroRequest todo
func (*CreateMicroRequest) Validate ¶
func (req *CreateMicroRequest) Validate() error
Validate 校验请求是否合法
type DescribeMicroRequest ¶
DescribeMicroRequest 查询应用详情
func NewDescriptServiceRequest ¶
func NewDescriptServiceRequest() *DescribeMicroRequest
NewDescriptServiceRequest new实例
func (*DescribeMicroRequest) Validate ¶
func (req *DescribeMicroRequest) Validate() error
Validate 校验详情查询请求
type Micro ¶
type Micro struct { ID string `bson:"_id" json:"id"` // 微服务ID *CreateMicroRequest `bson:",inline"` CreaterID string `bson:"creater_id" json:"creater_id"` CreateAt ftime.Time `bson:"create_at" json:"create_at,omitempty"` // 创建的时间 UpdateAt ftime.Time `bson:"update_at" json:"update_at,omitempty"` // 更新时间 AccountID string `bson:"account_id" json:"account_id"` // 服务账号 AccessToken string `bson:"access_token" json:"access_token"` // 服务访问凭证 RefreshToken string `bson:"refresh_token" json:"-"` // 服务刷新凭证 }
Micro is service provider
type QueryMicroRequest ¶
type QueryMicroRequest struct {
*request.PageRequest
}
QueryMicroRequest 查询应用列表
func NewQueryMicroRequest ¶
func NewQueryMicroRequest(pageReq *request.PageRequest) *QueryMicroRequest
NewQueryMicroRequest 列表查询请求
type Service ¶
type Service interface { CreateService(req *CreateMicroRequest) (*Micro, error) QueryService(req *QueryMicroRequest) (*Set, error) DescribeService(req *DescribeMicroRequest) (*Micro, error) DeleteService(name string) error }
Service token管理服务
Click to show internal directories.
Click to hide internal directories.