common

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Role_name = map[int32]string{
		0: "ANONYMOUS",
		1: "ADMIN",
		2: "USER",
	}
	Role_value = map[string]int32{
		"ANONYMOUS": 0,
		"ADMIN":     1,
		"USER":      2,
	}
)

Enum value maps for Role.

View Source
var (
	AuthType_name = map[int32]string{
		0: "WEB",
		1: "REST",
	}
	AuthType_value = map[string]int32{
		"WEB":  0,
		"REST": 1,
	}
)

Enum value maps for AuthType.

View Source
var (
	// optional custom.common.Auth auth = 50001;
	E_Auth = &file_custom_common_authz_proto_extTypes[0]
)

Extension fields to descriptorpb.MethodOptions.

View Source
var File_custom_common_authz_proto protoreflect.FileDescriptor
View Source
var File_custom_common_header_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Auth added in v1.0.4

type Auth struct {
	Role Role     `protobuf:"varint,1,opt,name=role,proto3,enum=custom.common.Role" json:"role,omitempty"`
	Type AuthType `protobuf:"varint,2,opt,name=type,proto3,enum=custom.common.AuthType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Auth) Descriptor deprecated added in v1.0.4

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

Deprecated: Use Auth.ProtoReflect.Descriptor instead.

func (*Auth) GetRole added in v1.0.4

func (x *Auth) GetRole() Role

func (*Auth) GetType added in v1.0.5

func (x *Auth) GetType() AuthType

func (*Auth) ProtoMessage added in v1.0.4

func (*Auth) ProtoMessage()

func (*Auth) ProtoReflect added in v1.0.4

func (x *Auth) ProtoReflect() protoreflect.Message

func (*Auth) Reset added in v1.0.4

func (x *Auth) Reset()

func (*Auth) String added in v1.0.4

func (x *Auth) String() string

type AuthType added in v1.0.5

type AuthType int32
const (
	AuthType_WEB  AuthType = 0 // web page, verify by cookie
	AuthType_REST AuthType = 1 // restful api, verify by token
)

func (AuthType) Descriptor added in v1.0.5

func (AuthType) Descriptor() protoreflect.EnumDescriptor

func (AuthType) Enum added in v1.0.5

func (x AuthType) Enum() *AuthType

func (AuthType) EnumDescriptor deprecated added in v1.0.5

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

Deprecated: Use AuthType.Descriptor instead.

func (AuthType) Number added in v1.0.5

func (x AuthType) Number() protoreflect.EnumNumber

func (AuthType) String added in v1.0.5

func (x AuthType) String() string

func (AuthType) Type added in v1.0.5

type RequestHeader

type RequestHeader struct {
	Role        Role   `protobuf:"varint,1,opt,name=role,proto3,enum=custom.common.Role" json:"role,omitempty"`
	Userid      int64  `protobuf:"varint,2,opt,name=userid,proto3" json:"userid,omitempty"`
	RequestId   string `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	SessionId   string `protobuf:"bytes,4,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	RequestFlag string `protobuf:"bytes,5,opt,name=request_flag,json=requestFlag,proto3" json:"request_flag,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestHeader) Descriptor deprecated

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

Deprecated: Use RequestHeader.ProtoReflect.Descriptor instead.

func (*RequestHeader) GetRequestFlag

func (x *RequestHeader) GetRequestFlag() string

func (*RequestHeader) GetRequestId

func (x *RequestHeader) GetRequestId() string

func (*RequestHeader) GetRole

func (x *RequestHeader) GetRole() Role

func (*RequestHeader) GetSessionId

func (x *RequestHeader) GetSessionId() string

func (*RequestHeader) GetUserid

func (x *RequestHeader) GetUserid() int64

func (*RequestHeader) ProtoMessage

func (*RequestHeader) ProtoMessage()

func (*RequestHeader) ProtoReflect

func (x *RequestHeader) ProtoReflect() protoreflect.Message

func (*RequestHeader) Reset

func (x *RequestHeader) Reset()

func (*RequestHeader) String

func (x *RequestHeader) String() string

type ResponseHeader

type ResponseHeader struct {
	Code       int32    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	ErrMsg     string   `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
	DebugInfos []string `protobuf:"bytes,3,rep,name=debug_infos,json=debugInfos,proto3" json:"debug_infos,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponseHeader) Descriptor deprecated

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

Deprecated: Use ResponseHeader.ProtoReflect.Descriptor instead.

func (*ResponseHeader) GetCode

func (x *ResponseHeader) GetCode() int32

func (*ResponseHeader) GetDebugInfos

func (x *ResponseHeader) GetDebugInfos() []string

func (*ResponseHeader) GetErrMsg

func (x *ResponseHeader) GetErrMsg() string

func (*ResponseHeader) ProtoMessage

func (*ResponseHeader) ProtoMessage()

func (*ResponseHeader) ProtoReflect

func (x *ResponseHeader) ProtoReflect() protoreflect.Message

func (*ResponseHeader) Reset

func (x *ResponseHeader) Reset()

func (*ResponseHeader) String

func (x *ResponseHeader) String() string

type Role added in v1.0.4

type Role int32
const (
	Role_ANONYMOUS Role = 0
	Role_ADMIN     Role = 1
	Role_USER      Role = 2
)

func (Role) Descriptor added in v1.0.4

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum added in v1.0.4

func (x Role) Enum() *Role

func (Role) EnumDescriptor deprecated added in v1.0.4

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

Deprecated: Use Role.Descriptor instead.

func (Role) Number added in v1.0.4

func (x Role) Number() protoreflect.EnumNumber

func (Role) String added in v1.0.4

func (x Role) String() string

func (Role) Type added in v1.0.4

func (Role) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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