common

package module
v0.0.0-...-7a8c910 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package common is a generated protocol buffer package.

It is generated from these files:

common.proto

It has these top-level messages:

Empty
AccessPerms
Result
SimpleResp

Index

Constants

This section is empty.

Variables

View Source
var EMPTY = &Empty{}

EMPTY is a global instance for commn.Empty

View Source
var E_ApiPrefix = &proto.ExtensionDesc{
	ExtendedType:  (*google_protobuf.ServiceOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         50001,
	Name:          "common.api_prefix",
	Tag:           "bytes,50001,opt,name=api_prefix,json=apiPrefix",
	Filename:      "common.proto",
}
View Source
var E_ApiVersion = &proto.ExtensionDesc{
	ExtendedType:  (*google_protobuf.ServiceOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         50002,
	Name:          "common.api_version",
	Tag:           "bytes,50002,opt,name=api_version,json=apiVersion",
	Filename:      "common.proto",
}
View Source
var E_FieldRequired = &proto.ExtensionDesc{
	ExtendedType:  (*google_protobuf.FieldOptions)(nil),
	ExtensionType: (*bool)(nil),
	Field:         52001,
	Name:          "common.field_required",
	Tag:           "varint,52001,opt,name=field_required,json=fieldRequired",
	Filename:      "common.proto",
}
View Source
var E_GrantPerm = &proto.ExtensionDesc{
	ExtendedType:  (*google_protobuf.MethodOptions)(nil),
	ExtensionType: (*Perm)(nil),
	Field:         51002,
	Name:          "common.grant_perm",
	Tag:           "varint,51002,opt,name=grant_perm,json=grantPerm,enum=common.Perm",
	Filename:      "common.proto",
}
View Source
var E_GrantScope = &proto.ExtensionDesc{
	ExtendedType:  (*google_protobuf.MethodOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         51001,
	Name:          "common.grant_scope",
	Tag:           "bytes,51001,opt,name=grant_scope,json=grantScope",
	Filename:      "common.proto",
}

OK represents ok result

View Source
var Perm_name = map[int32]string{
	0: "NONE",
	1: "READ",
	2: "WRITE",
	3: "BOTH",
}
View Source
var Perm_value = map[string]int32{
	"NONE":  0,
	"READ":  1,
	"WRITE": 2,
	"BOTH":  3,
}
View Source
var SimpleOK = &SimpleResp{
	Res: OK,
}

SimpleOK represents a ok simple respsonse

Functions

This section is empty.

Types

type AccessPerms

type AccessPerms struct {
	// 账号 id
	AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId" json:"account_id,omitempty"`
	// client id
	AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId" json:"app_id,omitempty"`
	// 权限信息
	Perms map[string]Perm `` /* 148-byte string literal not displayed */
}

func (*AccessPerms) Descriptor

func (*AccessPerms) Descriptor() ([]byte, []int)

func (*AccessPerms) GetAccountId

func (m *AccessPerms) GetAccountId() string

func (*AccessPerms) GetAppId

func (m *AccessPerms) GetAppId() string

func (*AccessPerms) GetPerms

func (m *AccessPerms) GetPerms() map[string]Perm

func (*AccessPerms) ProtoMessage

func (*AccessPerms) ProtoMessage()

func (*AccessPerms) Reset

func (m *AccessPerms) Reset()

func (*AccessPerms) String

func (m *AccessPerms) String() string

type Empty

type Empty struct {
}

空结构

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type Perm

type Perm int32

权限枚举

const (
	// 无权限
	Perm_NONE Perm = 0
	// 可读
	Perm_READ Perm = 1
	// 可写
	Perm_WRITE Perm = 2
	// 可读可写
	Perm_BOTH Perm = 3
)

func (Perm) EnumDescriptor

func (Perm) EnumDescriptor() ([]byte, []int)

func (Perm) String

func (x Perm) String() string

type Result

type Result struct {
	// 返回码
	Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
	// 返回信息
	Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"`
}

API 请求结果

func NewResult

func NewResult(code int32, msg string) *Result

NewResult returns a *common.Result with given code & msg

func (*Result) Descriptor

func (*Result) Descriptor() ([]byte, []int)

func (*Result) GetCode

func (m *Result) GetCode() int32

func (*Result) GetMsg

func (m *Result) GetMsg() string

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

type SimpleResp

type SimpleResp struct {
	Res *Result `protobuf:"bytes,1,opt,name=res" json:"res,omitempty"`
}

仅包含 API 请求结果的简单 Response

func (*SimpleResp) Descriptor

func (*SimpleResp) Descriptor() ([]byte, []int)

func (*SimpleResp) GetRes

func (m *SimpleResp) GetRes() *Result

func (*SimpleResp) ProtoMessage

func (*SimpleResp) ProtoMessage()

func (*SimpleResp) Reset

func (m *SimpleResp) Reset()

func (*SimpleResp) String

func (m *SimpleResp) String() string

Jump to

Keyboard shortcuts

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