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

Method Create

module/application-authorization/auth-driver/auth.go:51–61  ·  view source on GitHub ↗
(config interface{})

Source from the content-addressed store, hash-verified

49}
50
51func (f *Factory[T]) Create(config interface{}) (IAuth, error) {
52 cfg, err := generateStruct[T](config)
53 if err != nil {
54 return nil, err
55 }
56 authConfig, ok := interface{}(cfg).(IAuthConfig)
57 if !ok {
58 return nil, fmt.Errorf("no implement IAuthConfig")
59 }
60 return &Auth{driver: f.driver, authConfig: authConfig}, nil
61}
62
63func generateStruct[T any](cfg interface{}) (*T, error) {
64 result := new(T)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected