cputil

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 188

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllHeaders

func GetAllHeaders(ctx context.Context) metadata.MD

GetAllHeaders get all headers from ctx.

func GetHeader

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

GetHeader .

func GetIdentity

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

GetIdentity get identity from ctx.

func GetInParamByKey

func GetInParamByKey(ctx context.Context, key string) interface{}

GetInParamByKey return cp inParam by key for easy use.

func GetOrgID

func GetOrgID(ctx context.Context) string

GetOrgID .

func GetScenarioAndCompNameFromProviderKey

func GetScenarioAndCompNameFromProviderKey(providerKey string) (scenario, compName, instanceName string, err error)

GetScenarioAndCompNameFromProviderKey .

func GetURLQuery

func GetURLQuery(sdk *cptype.SDK, resultStructPtr interface{}) error

GetURLQuery get component's url query and parse to `resultStructPtr`.

func GetUserID

func GetUserID(ctx context.Context) string

GetUserID .

func I18n

func I18n(ctx context.Context, key string, args ...interface{}) string

I18n .

func Language

func Language(ctx context.Context) i18n.LanguageCodes

Language .

func MakeCompURLQueryKey

func MakeCompURLQueryKey(compName string) string

MakeCompURLQueryKey make url query key for component.

func MakeComponentProviderName

func MakeComponentProviderName(scenario, compType string) string

MakeComponentProviderName .

func MustConvertProps

func MustConvertProps(props interface{}) cptype.ComponentProps

MustConvertProps .

func MustFlatMapMeta

func MustFlatMapMeta(input interface{}, removeMetaAfterFlat bool)

MustFlatMapMeta .

func MustGetScenarioAndCompNameFromProviderKey

func MustGetScenarioAndCompNameFromProviderKey(providerKey string) (scenario, compName, instanceName string)

MustGetScenarioAndCompNameFromProviderKey .

func MustGetURLQuery

func MustGetURLQuery(sdk *cptype.SDK, resultStructPtr interface{})

MustGetURLQuery must GetURLQuery.

func MustObjJSONTransfer

func MustObjJSONTransfer(src interface{}, dst interface{}) interface{}

MustObjJSONTransfer .

func NewExtra

func NewExtra(inputPtr interface{}) cptype.Extra

NewExtra .

func ObjJSONTransfer

func ObjJSONTransfer(src interface{}, dst interface{}) error

ObjJSONTransfer transfer from src to dst using json.

func SDK

func SDK(ctx context.Context) (sdk *cptype.SDK)

SDK return cp sdk for easy use.

func SetURLQuery

func SetURLQuery(sdk *cptype.SDK, data interface{})

SetURLQuery set data to url query.

Types

type OperationBuilder

type OperationBuilder struct {
	cptype.Operation
}

OperationBuilder .

func NewOpBuilder

func NewOpBuilder() *OperationBuilder

NewOpBuilder .

func (*OperationBuilder) Build

func (b *OperationBuilder) Build() cptype.Operation

Build .

func (*OperationBuilder) WithAsync

func (b *OperationBuilder) WithAsync(async bool) *OperationBuilder

WithAsync .

func (*OperationBuilder) WithConfirmTip

func (b *OperationBuilder) WithConfirmTip(confirmTip string) *OperationBuilder

WithConfirmTip .

func (*OperationBuilder) WithDisable

func (b *OperationBuilder) WithDisable(disable bool, tip string) *OperationBuilder

WithDisable .

func (*OperationBuilder) WithServerDataPtr

func (b *OperationBuilder) WithServerDataPtr(inputPtr interface{}) *OperationBuilder

WithServerDataPtr .

func (*OperationBuilder) WithSkipRender

func (b *OperationBuilder) WithSkipRender(skipRender bool) *OperationBuilder

WithSkipRender .

func (*OperationBuilder) WithText

func (b *OperationBuilder) WithText(text string) *OperationBuilder

WithText .

func (*OperationBuilder) WithTip

func (b *OperationBuilder) WithTip(tip string) *OperationBuilder

WithTip .

Jump to

Keyboard shortcuts

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