MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / NewCreatorSoftDelete

Function NewCreatorSoftDelete

service/universally/create-softDelete.go:24–37  ·  view source on GitHub ↗
(st store.ISearchStore[E], name string, createEntityHandler func(i *INPUT) *E, uniquestHandler func(*INPUT) []map[string]any, labelHandlers ...func(*E) []string)

Source from the content-addressed store, hash-verified

22}
23
24func NewCreatorSoftDelete[INPUT any, E any](st store.ISearchStore[E], name string, createEntityHandler func(i *INPUT) *E, uniquestHandler func(*INPUT) []map[string]any, labelHandlers ...func(*E) []string) IServiceCreate[INPUT] {
25
26 assert(new(E))
27
28 s := &imlServiceCreateSoftDelete[INPUT, E]{
29 store: st,
30 createEntityHandler: createEntityHandler,
31 labelHandler: labelHandlers,
32 uniquestHandler: uniquestHandler,
33
34 name: name,
35 }
36 return s
37}
38
39func (p *imlServiceCreateSoftDelete[INPUT, E]) Create(ctx context.Context, input *INPUT, appendLabels ...string) error {
40 operator := utils.UserId(ctx)

Callers 3

OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected