github.com/voedger/voedger@v0.0.0-20240520144910-273e84102129/pkg/istructsmem/internal/descr/interface_extension.go (about)

     1  /*
     2   * Copyright (c) 2021-present Sigma-Soft, Ltd.
     3   * @author: Nikolay Nikitin
     4   */
     5  
     6  package descr
     7  
     8  import "github.com/voedger/voedger/pkg/appdef"
     9  
    10  type Extensions struct {
    11  	Commands   map[appdef.QName]*CommandFunction `json:",omitempty"`
    12  	Queries    map[appdef.QName]*QueryFunction   `json:",omitempty"`
    13  	Projectors map[appdef.QName]*Projector       `json:",omitempty"`
    14  }
    15  
    16  type Extension struct {
    17  	Type
    18  	Name   string
    19  	Engine string
    20  }
    21  
    22  type Function struct {
    23  	Extension
    24  	Arg    *appdef.QName `json:",omitempty"`
    25  	Result *appdef.QName `json:",omitempty"`
    26  }
    27  
    28  type CommandFunction struct {
    29  	Function
    30  	UnloggedArg *appdef.QName `json:",omitempty"`
    31  }
    32  
    33  type QueryFunction struct {
    34  	Function
    35  }
    36  
    37  type Projector struct {
    38  	Extension
    39  	Events     map[appdef.QName]ProjectorEvent `json:",omitempty"`
    40  	WantErrors bool                            `json:",omitempty"`
    41  	States     map[appdef.QName]appdef.QNames  `json:",omitempty"`
    42  	Intents    map[appdef.QName]appdef.QNames  `json:",omitempty"`
    43  }
    44  
    45  type ProjectorEvent struct {
    46  	Comment string       `json:",omitempty"`
    47  	On      appdef.QName `json:"-"`
    48  	Kind    []string     `json:",omitempty"`
    49  }