apis

package
v1.3.0-rc Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var I18n i18n.I18n

I18n .

Functions

func GetHeader added in v1.1.0

func GetHeader(ctx context.Context, key string) string

GetHeader

func GetIdentityInfo added in v1.1.0

func GetIdentityInfo(ctx context.Context) *pb.IdentityInfo

GetIdentityInfo get User-ID and Internal-Client from header. return nil if no identity info found.

func GetIntOrgID added in v1.1.0

func GetIntOrgID(ctx context.Context) (int64, error)

GetIntOrgID .

func GetIntUserID added in v1.1.0

func GetIntUserID(ctx context.Context) (int64, error)

GetIntUserID .

func GetInternalClient added in v1.1.0

func GetInternalClient(ctx context.Context) string

func GetLang added in v1.3.0

func GetLang(ctx context.Context) string

GetLang .

func GetOrgID added in v1.1.0

func GetOrgID(ctx context.Context) string

GetOrgID .

func GetUserID added in v1.1.0

func GetUserID(ctx context.Context) string

GetUserID .

func HTTPLanguage added in v1.1.0

func HTTPLanguage(r *http.Request) i18n.LanguageCodes

HTTPLanguage .

func IsInternalClient added in v1.1.0

func IsInternalClient(ctx context.Context) bool

func Language added in v1.1.0

func Language(ctx context.Context) i18n.LanguageCodes

Language .

func Options

func Options() transport.ServiceOption

Options .

func WithInternalClientContext added in v1.1.0

func WithInternalClientContext(ctx context.Context, internalClient string) context.Context

Types

type Error

type Error struct {
	Code interface{} `json:"code,omitempty"`
	Msg  interface{} `json:"msg,omitempty"`
	Ctx  interface{} `json:"ctx,omitempty"`
}

Error .

func (*Error) Error

func (s *Error) Error() string

type Response

type Response struct {
	Success bool        `json:"success,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	UserIDs []string    `json:"userIDs,omitempty"`
	Err     *Error      `json:"err,omitempty"`
}

Response .

Jump to

Keyboard shortcuts

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