Documentation
¶
Index ¶
- type Register
- func (r *Register) AllTypes() ast.TypeDefs
- func (r *Register) CloseType(typeDef *ast.TypeDef)
- func (r *Register) CloseTypes(resp *ast.Response) error
- func (r *Register) IsTypeRegistered(typedef *ast.TypeDef) bool
- func (r *Register) RegisterType(ctx context.Context, typeDef *ast.TypeDef, isInputType bool) *ast.TypeDef
- func (r *Register) RegisterTypeUsedInWeakUnion(typeDef *ast.TypeDef)
- func (r *Register) UnregisterOrCloneTypeInPreparationForCreatingErrorType(ctx context.Context, typ *ast.TypeDef) *ast.TypeDef
- func (r *Register) UnregisterType(typeDef *ast.TypeDef)
- func (r *Register) UpdateRegisteredTypeToErrorsScopeLegacy(ctx context.Context, typ *ast.TypeDef, isRootType bool) *ast.TypeDefdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Register ¶
type Register struct {
// types in the type register are generally considered immutable.
Types *sequencedmap.Map[string, *ast.TypeDef]
TypesUsedInWeakUnion map[string]*ast.TypeDef
Config *configuration.Config
// contains filtered or unexported fields
}
Register
The type register ensures that we have a minimal set of types needed in our SDKs It helps recognize when we can, and when we cannot de-duplicate types. The primary method is just:
RegisterType(ctx, typeDef, isInputType)
This register a given typeDef. It might return a different typeDef if it determines it is appropriate.
Extra methods to handle some special cases: in particular some types are expected to be *mutated*
func (*Register) RegisterType ¶
func (r *Register) RegisterType(ctx context.Context, typeDef *ast.TypeDef, isInputType bool) *ast.TypeDef
RegisterType registers a type based on its name and context.
func (*Register) RegisterTypeUsedInWeakUnion ¶
Notice: this won't differentiate between types with the same name in different contexts, is that a problem?
func (*Register) UnregisterOrCloneTypeInPreparationForCreatingErrorType ¶
func (*Register) UnregisterType ¶
Click to show internal directories.
Click to hide internal directories.