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

Function NewCreator

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

Source from the content-addressed store, hash-verified

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

Callers 15

OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92
OnCompleteMethod · 0.92

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected