MCPcopy Index your code
hub / github.com/dagger/dagger / GenerateClient

Method GenerateClient

core/modulesource.go:620–635  ·  view source on GitHub ↗
(
	ctx context.Context,
	modSource dagql.ObjectResult[*ModuleSource],
	schemaJSONFile dagql.Result[*File],
	outputDir string,
)

Source from the content-addressed store, hash-verified

618}
619
620func (sdk persistedModuleSourceLazyClientGenerator) GenerateClient(
621 ctx context.Context,
622 modSource dagql.ObjectResult[*ModuleSource],
623 schemaJSONFile dagql.Result[*File],
624 outputDir string,
625) (dagql.ObjectResult[*Directory], error) {
626 loaded, err := sdk.sdk.load(ctx)
627 if err != nil {
628 return dagql.ObjectResult[*Directory]{}, err
629 }
630 clientSDK, ok := loaded.AsClientGenerator()
631 if !ok {
632 return dagql.ObjectResult[*Directory]{}, fmt.Errorf("persisted module source sdk does not implement client generator")
633 }
634 return clientSDK.GenerateClient(ctx, modSource, schemaJSONFile, outputDir)
635}
636
637func (src *ModuleSource) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error) {
638 if src == nil {

Callers

nothing calls this directly

Calls 3

AsClientGeneratorMethod · 0.65
GenerateClientMethod · 0.65
loadMethod · 0.45

Tested by

no test coverage detected