gwtools

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBodyTenantIDAndUserID

func AddBodyTenantIDAndUserID(tenantIDFieldName string, userIDFieldName string,
	getTenantIDFunc GetTenantIDFunc, getUserIDFunc GetUserIDFunc) gateway.FormBodyFunc

func AddQueryParamsTenantIDAndUserID

func AddQueryParamsTenantIDAndUserID(tenantIDFieldName string, userIDFieldName string,
	getTenantIDFunc GetTenantIDFunc, getUserIDFunc GetUserIDFunc) gateway.FormQueryParamsFunc

func CRUD

func CRUD(builder *gateway.Builder, params *CRUDParams, opts ...any)

func CommonPassThrough

func CommonPassThrough(builder *gateway.Builder, params *CommonPassThroughParams, middlewares ...api.Handler)

func DeleteCommonPassThrough

func DeleteCommonPassThrough(builder *gateway.Builder, params *SimpleCommonPassThroughParams, middlewares ...api.Handler)

func DeletePassThrough

func DeletePassThrough(builder *gateway.Builder, params *SimplePassThroughParams, middlewares ...api.Handler)

func GetCommonPassThrough

func GetCommonPassThrough(builder *gateway.Builder, params *SimpleCommonPassThroughParams, middlewares ...api.Handler)

func GetPassThrough

func GetPassThrough(builder *gateway.Builder, params *SimplePassThroughParams, middlewares ...api.Handler)

func Many2Many

func Many2Many(builder *gateway.Builder, params *Many2ManyParams, opts ...Many2ManyOption)

func One2Many

func One2Many(builder *gateway.Builder, params *One2ManyParams, opts ...One2ManyOption)

func One2One

func One2One(builder *gateway.Builder, params *One2OneParams, opts ...One2OneOption)

func OneDeletePassThrough

func OneDeletePassThrough(builder *gateway.Builder, params *SimpleOnePassThroughParams, middlewares ...api.Handler)

func OneGetPassThrough

func OneGetPassThrough(builder *gateway.Builder, params *SimpleOnePassThroughParams, middlewares ...api.Handler)

func OnePassThrough

func OnePassThrough(builder *gateway.Builder, params *OnePassThroughParams, middlewares ...api.Handler)

func OnePostPassThrough

func OnePostPassThrough(builder *gateway.Builder, params *SimpleOnePassThroughParams, middlewares ...api.Handler)

func OnePutPassThrough

func OnePutPassThrough(builder *gateway.Builder, params *SimpleOnePassThroughParams, middlewares ...api.Handler)

func PassThrough

func PassThrough(builder *gateway.Builder, params *PassThroughParams, middlewares ...api.Handler)

func PostCommonPassThrough

func PostCommonPassThrough(builder *gateway.Builder, params *SimpleCommonPassThroughParams, middlewares ...api.Handler)

func PostPassThrough

func PostPassThrough(builder *gateway.Builder, params *SimplePassThroughParams, middlewares ...api.Handler)

func PutCommonPassThrough

func PutCommonPassThrough(builder *gateway.Builder, params *SimpleCommonPassThroughParams, middlewares ...api.Handler)

func PutPassThrough

func PutPassThrough(builder *gateway.Builder, params *SimplePassThroughParams, middlewares ...api.Handler)

Types

type CRUDCreateOption

type CRUDCreateOption func(options *CRUDCreateOptions)

func WithCRUDCreateCallbacks

func WithCRUDCreateCallbacks(callbacks gateway.RequestCallbackFunc) CRUDCreateOption

func WithCRUDCreateGetTenantIDFunc

func WithCRUDCreateGetTenantIDFunc(getTenantIDFunc GetTenantIDFunc) CRUDCreateOption

func WithCRUDCreateGetUserIDFunc

func WithCRUDCreateGetUserIDFunc(getUserIDFunc GetUserIDFunc) CRUDCreateOption

func WithCRUDCreateMiddlewares

func WithCRUDCreateMiddlewares(middlewares []api.Handler) CRUDCreateOption

type CRUDCreateOptions

type CRUDCreateOptions struct {
	// contains filtered or unexported fields
}

type CRUDDeleteOption

type CRUDDeleteOption func(options *CRUDDeleteOptions)

func WithCRUDDeleteCallbacks

func WithCRUDDeleteCallbacks(callbacks gateway.RequestCallbackFunc) CRUDDeleteOption

func WithCRUDDeleteMiddlewares

func WithCRUDDeleteMiddlewares(middlewares []api.Handler) CRUDDeleteOption

func WithCRUDDisableDelete

func WithCRUDDisableDelete() CRUDDeleteOption

type CRUDDeleteOptions

type CRUDDeleteOptions struct {
	// contains filtered or unexported fields
}

type CRUDGetByIDOption

type CRUDGetByIDOption func(options *CRUDGetByIDOptions)

func WithCRUDDisableGetByID

func WithCRUDDisableGetByID() CRUDGetByIDOption

func WithCRUDGetByIDCallbacks

func WithCRUDGetByIDCallbacks(callbacks gateway.RequestCallbackFunc) CRUDGetByIDOption

func WithCRUDGetByIDMiddlewares

func WithCRUDGetByIDMiddlewares(middlewares []api.Handler) CRUDGetByIDOption

type CRUDGetByIDOptions

type CRUDGetByIDOptions struct {
	// contains filtered or unexported fields
}

type CRUDParams

type CRUDParams struct {
	// 除去后缀的服务URL,如http://localhost:8080/example/api/v1
	ServiceVersionedUrl string

	// 领域名称
	DomainCamelName string
	// contains filtered or unexported fields
}

type CRUDQueryOption

type CRUDQueryOption func(options *CRUDQueryOptions)

func WithCRUDDisableQuery

func WithCRUDDisableQuery() CRUDQueryOption

func WithCRUDQueryCallbacks

func WithCRUDQueryCallbacks(callbacks gateway.RequestCallbackFunc) CRUDQueryOption

func WithCRUDQueryGetTenantIDFunc

func WithCRUDQueryGetTenantIDFunc(getTenantIDFunc GetTenantIDFunc) CRUDQueryOption

func WithCRUDQueryMiddlewares

func WithCRUDQueryMiddlewares(middlewares []api.Handler) CRUDQueryOption

type CRUDQueryOptions

type CRUDQueryOptions struct {
	// contains filtered or unexported fields
}

type CRUDUpdateOption

type CRUDUpdateOption func(options *CRUDUpdateOptions)

func WithCRUDDisableUpdate

func WithCRUDDisableUpdate() CRUDUpdateOption

func WithCRUDUpdateCallbacks

func WithCRUDUpdateCallbacks(callbacks gateway.RequestCallbackFunc) CRUDUpdateOption

func WithCRUDUpdateGetUserIDFunc

func WithCRUDUpdateGetUserIDFunc(getUserIDFunc GetUserIDFunc) CRUDUpdateOption

func WithCRUDUpdateMiddlewares

func WithCRUDUpdateMiddlewares(middlewares []api.Handler) CRUDUpdateOption

type CRUDUpdateOptions

type CRUDUpdateOptions struct {
	// contains filtered or unexported fields
}

type CommonPassThroughParams

type CommonPassThroughParams struct {
	HttpMethod string
	*SimpleCommonPassThroughParams
}

type GetTenantIDFunc

type GetTenantIDFunc func(c *api.Context) (string, error)

type GetUserIDFunc

type GetUserIDFunc func(c *api.Context) (string, error)

type Many2ManyOption

type Many2ManyOption func(options *Many2ManyOptions)

func WithMany2ManyDisableLeft

func WithMany2ManyDisableLeft() Many2ManyOption

func WithMany2ManyDisableLeftQuery

func WithMany2ManyDisableLeftQuery() Many2ManyOption

func WithMany2ManyDisableLeftUpdate

func WithMany2ManyDisableLeftUpdate() Many2ManyOption

func WithMany2ManyDisableRight

func WithMany2ManyDisableRight() Many2ManyOption

func WithMany2ManyDisableRightQuery

func WithMany2ManyDisableRightQuery() Many2ManyOption

func WithMany2ManyDisableRightUpdate

func WithMany2ManyDisableRightUpdate() Many2ManyOption

type Many2ManyOptions

type Many2ManyOptions struct {
	// contains filtered or unexported fields
}

type Many2ManyParams

type Many2ManyParams struct {
	// 除去后缀的服务URL,如http://localhost:8080/example/api/v1
	ServiceVersionedUrl string

	// 左领域名称
	LeftDomainCamelName string

	// 右领域名称
	RightDomainCamelName string
	// contains filtered or unexported fields
}

type One2ManyOption

type One2ManyOption func(options *One2ManyOptions)

func WithOne2ManyDisableLeft

func WithOne2ManyDisableLeft() One2ManyOption

func WithOne2ManyDisableLeftQuery

func WithOne2ManyDisableLeftQuery() One2ManyOption

func WithOne2ManyDisableLeftUpdate

func WithOne2ManyDisableLeftUpdate() One2ManyOption

func WithOne2ManyDisableRight

func WithOne2ManyDisableRight() One2ManyOption

func WithOne2ManyDisableRightQuery

func WithOne2ManyDisableRightQuery() One2ManyOption

func WithOne2ManyDisableRightUpdate

func WithOne2ManyDisableRightUpdate() One2ManyOption

func WithOne2ManyDisableRightWithLeftQuery

func WithOne2ManyDisableRightWithLeftQuery() One2ManyOption

type One2ManyOptions

type One2ManyOptions struct {
	// contains filtered or unexported fields
}

type One2ManyParams

type One2ManyParams struct {
	// 除去后缀的服务URL,如http://localhost:8080/example/api/v1
	ServiceVersionedUrl string

	// 左领域名称
	LeftDomainCamelName string

	// 右领域名称
	RightDomainCamelName string
	// contains filtered or unexported fields
}

type One2OneOption

type One2OneOption func(options *One2OneOptions)

func WithOne2ManyRightWithLeftQueryGetTenantIDFunc

func WithOne2ManyRightWithLeftQueryGetTenantIDFunc(getTenantIDFunc GetTenantIDFunc) One2OneOption

func WithOne2OneDisableLeft

func WithOne2OneDisableLeft() One2OneOption

func WithOne2OneDisableLeftQuery

func WithOne2OneDisableLeftQuery() One2OneOption

func WithOne2OneDisableLeftUpdate

func WithOne2OneDisableLeftUpdate() One2OneOption

func WithOne2OneDisableLeftWithRightQuery

func WithOne2OneDisableLeftWithRightQuery() One2OneOption

func WithOne2OneDisableRight

func WithOne2OneDisableRight() One2OneOption

func WithOne2OneDisableRightQuery

func WithOne2OneDisableRightQuery() One2OneOption

func WithOne2OneDisableRightUpdate

func WithOne2OneDisableRightUpdate() One2OneOption

func WithOne2OneDisableRightWithLeftQuery

func WithOne2OneDisableRightWithLeftQuery() One2OneOption

func WithOne2OneLeftWithRightQueryGetTenantIDFunc

func WithOne2OneLeftWithRightQueryGetTenantIDFunc(getTenantIDFunc GetTenantIDFunc) One2OneOption

func WithOne2OneRightWithLeftQueryGetTenantIDFunc

func WithOne2OneRightWithLeftQueryGetTenantIDFunc(getTenantIDFunc GetTenantIDFunc) One2OneOption

type One2OneOptions

type One2OneOptions struct {
	// contains filtered or unexported fields
}

type One2OneParams

type One2OneParams struct {
	// 除去后缀的服务URL,如http://localhost:8080/example/api/v1
	ServiceVersionedUrl string

	// 左领域名称
	LeftDomainCamelName string

	// 右领域名称
	RightDomainCamelName string
	// contains filtered or unexported fields
}

type OnePassThroughParams

type OnePassThroughParams struct {
	HttpMethod string
	*SimpleOnePassThroughParams
}

type PassThroughParams

type PassThroughParams struct {
	HttpMethod string
	*SimplePassThroughParams
}

type PassThroughRequestItem

type PassThroughRequestItem struct {
	Request  gateway.BuilderRequest
	Callback gateway.RequestCallbackFunc
}

type SimpleCommonPassThroughParams

type SimpleCommonPassThroughParams struct {
	RelativePath string
	RequestItems []PassThroughRequestItem
}

type SimpleOnePassThroughParams

type SimpleOnePassThroughParams struct {
	RelativePath string
	RequestItem  *PassThroughRequestItem
}

type SimplePassThroughParams

type SimplePassThroughParams struct {
	RelativePath string
	Request      gateway.BuilderRequest
}

Jump to

Keyboard shortcuts

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