Documentation
¶
Index ¶
- Constants
- Variables
- func BoolP(value bool) *bool
- func Contains[T comparable](s []T, e T) bool
- func GenerateAuthResourcesHook(ex *Extension) gen.Hook
- func GeneratorHook(ex *Extension) gen.Hook
- func Int32P(value int32) *int32
- func Int64P(value int64) *int64
- func IntP(value int) *int
- func NewEntgqlExtension(opts ...entgql.ExtensionOption) (*entgql.Extension, error)
- func PBool(value *bool) bool
- func PInt(value *int) int
- func PInt32(value *int32) int32
- func PInt64(value *int64) int64
- func PString(value *string) string
- func StringP(value string) *string
- type Action
- type ActionOption
- func ActionAsGeneral() ActionOption
- func ActionDisplayOn(actionNames ...string) ActionOption
- func ActionWithIcon(icon string) ActionOption
- func ActionWithLabel(label string) ActionOption
- func ActionWithOperation(operation *Operation) ActionOption
- func ActionWithProps(props map[string]any) ActionOption
- func ActionWithRoute(route *Route) ActionOption
- func ActionWithScope(scope string) ActionOption
- func WithCustomComponent(component string) ActionOption
- func WithDescription(description string) ActionOption
- type Annotation
- func Actions(actions ...*Action) Annotation
- func Badge(name string) Annotation
- func CodeField(config *CodeFieldOptions) Annotation
- func Description(description string) Annotation
- func FilterOperator(operator gen.Op) Annotation
- func HideOnCreate() Annotation
- func HideOnForm() Annotation
- func HideOnList() Annotation
- func HideOnShow() Annotation
- func HideOnUpdate() Annotation
- func Icon(icon string) Annotation
- func ImageField() Annotation
- func IndexRoute() Annotation
- func Label(label string) Annotation
- func MainImageField() Annotation
- func OnlyOnForm() Annotation
- func OnlyOnList() Annotation
- func OnlyOnShow() Annotation
- func Prefix(prefix string) Annotation
- func RichTextField() Annotation
- func RoutePath(path string) Annotation
- func Suffix(suffix string) Annotation
- func TitleField() Annotation
- func URLField() Annotation
- func View(name string) Annotation
- func ViewOnForm(name string) Annotation
- func ViewOnList(name string) Annotation
- func ViewOnShow(name string) Annotation
- type Annotations
- type Auth
- type AuthContext
- type AuthEnvironment
- type AuthOption
- type CodeFieldOptions
- type Environment
- type EnvironmentAdapter
- type Extension
- func (ex *Extension) Annotations() []entc.Annotation
- func (ex *Extension) Camel(s string) string
- func (ex *Extension) FieldTSType(field *gen.Field) string
- func (ex *Extension) GetActionByName(node *gen.Type, name string) *Action
- func (ex *Extension) GetEdgeAnnotations(field *gen.Edge) *Annotation
- func (ex *Extension) GetFieldAnnotations(field *gen.Field) *Annotation
- func (ex *Extension) GetNodeAction(node *gen.Type, name string) *Action
- func (ex *Extension) GetNodeAnnotations(node *gen.Type) *Annotation
- func (ex *Extension) Hooks() []gen.Hook
- func (ex *Extension) IndexNode(graph *gen.Graph) *gen.Type
- func (ex *Extension) LcFirst(str string) string
- func (ex *Extension) MainImageField(node *gen.Type) *gen.Field
- func (ex *Extension) NodeActionRoutePattern(node *gen.Type, actionName string) *string
- func (ex *Extension) Pascal(s string) string
- func (ex *Extension) PrepareName(name string) string
- func (ex *Extension) Replace(old string, new string, s string) string
- func (ex *Extension) Snake(s string) string
- func (ex *Extension) Templates() []*gen.Template
- func (ex *Extension) TitleField(node *gen.Type) *gen.Field
- func (ex *Extension) ToLabel(str string) string
- func (ex *Extension) TsType(gotype string, prefix string) string
- func (ex *Extension) UcFirst(str string) string
- type ExtensionOption
- func IgnoreUncommittedChanges() ExtensionOption
- func WithAuth(options ...AuthOption) ExtensionOption
- func WithDefaultEdgesDiagram(name string) ExtensionOption
- func WithForceGraph2D(options ForceGraph2DOptions) ExtensionOption
- func WithGenerator(name string, adapter GeneratorAdapter, options ...GeneratorOption) ExtensionOption
- func WithGoJs(options GoJSOptions) ExtensionOption
- func WithGraphqlURL(url string) ExtensionOption
- func WithMeta(key string, value any) ExtensionOption
- func WithPrefix(prefix string) ExtensionOption
- type ForceGraph2DOptions
- type Generator
- type GeneratorAdapter
- type GeneratorAdapterWithAfter
- type GeneratorAdapterWithAfterCommand
- type GeneratorAdapterWithBefore
- type GeneratorAdapterWithBeforeCommand
- type GeneratorAdapterWithDependencies
- type GeneratorAdapterWithFS
- type GeneratorAdapterWithStaticTemplates
- type GeneratorAdapterWithTemplates
- type GeneratorOption
- type GoJSOptions
- type Keycloak
- type KeycloakEnvironment
- type KeycloakOption
- func KeycloakBackendClientConfig(clientConfig gocloak.Client) KeycloakOption
- func KeycloakFrontendClientConfig(clientConfig gocloak.Client) KeycloakOption
- func KeycloakGeneratedAdminCredentials(username string, password string) KeycloakOption
- func KeycloakHost(host string) KeycloakOption
- func KeycloakMasterAdminCredentials(username string, password string) KeycloakOption
- func KeycloakMasterRealm(realm string) KeycloakOption
- func KeycloakRealm(realm string) KeycloakOption
- type Mutation
- type Operation
- type OperationOption
- func OperationAsBulk() OperationOption
- func OperationAsMutation() OperationOption
- func OperationAsQuery() OperationOption
- func OperationAsSingle() OperationOption
- func OperationWithFailMessage(message string) OperationOption
- func OperationWithFields(fields ...string) OperationOption
- func OperationWithSuccessMessage(message string) OperationOption
- type Permission
- type Refine
- func (r Refine) BuildPath() string
- func (r Refine) CommandAfterGen(generator *Generator) string
- func (r Refine) GetDependencies() []GeneratorAdapter
- func (r Refine) GetFS() fs.FS
- func (r Refine) GetName() string
- func (r Refine) GetStaticTemplates() []string
- func (r Refine) GetTemplates() []string
- func (r Refine) RewritePath() string
- func (r Refine) StaticPaths() []string
- type Route
- type RouteOption
- type ServableAdapter
- type ServerAdapter
- func (r ServerAdapter) BeforeGen(generator *Generator) error
- func (r ServerAdapter) CommandAfterGen(generator *Generator) string
- func (r ServerAdapter) GetFS() fs.FS
- func (r ServerAdapter) GetName() string
- func (r ServerAdapter) GetStaticTemplates() []string
- func (r ServerAdapter) GetTemplates() []string
- type SkipModes
- type TypescriptAdapter
Constants ¶
const AnnotationKey = "ENTKIT"
Variables ¶
var ( // ListAction standard list action ListAction = NewAction( "list", ActionAsGeneral(), ActionWithLabel("List"), ActionWithScope(ActionReadScope), ActionWithIcon("AntdIcons.UnorderedListOutlined"), ActionDisplayOn("show", "edgesDiagram"), ActionWithRoute(NewRoute("/", "List.{name}List", RouteAsIndex())), ) // EditAction standard edit action EditAction = NewAction( "edit", ActionWithLabel("Edit"), ActionWithScope(ActionUpdateScope), ActionWithRoute(NewRoute("edit/:id", "Edit.{name}Edit")), ActionWithIcon("AntdIcons.EditOutlined"), ActionDisplayOn("list", "show", "edgesDiagram"), ) // CreateAction standard create action CreateAction = NewAction( "create", ActionAsGeneral(), ActionWithLabel("Create"), ActionWithScope(ActionCreateScope), ActionWithIcon("AntdIcons.PlusCircleOutlined"), ActionWithRoute(NewRoute("create", "Create.{name}Create")), ActionDisplayOn("list"), ) // ShowAction standard show action ShowAction = NewAction( "show", ActionWithLabel("Show"), ActionWithScope(ActionReadScope), ActionWithIcon("AntdIcons.EyeOutlined"), ActionWithRoute(NewRoute("show/:id", "Show.{name}MainShow")), ActionDisplayOn("list", "edit", "edgesDiagram"), ) // DeleteAction standard delete action DeleteAction = NewAction( "delete", ActionWithLabel("Delete"), ActionWithScope(ActionDeleteScope), ActionWithIcon("AntdIcons.DeleteOutlined"), ActionWithProps(map[string]any{ "danger": true, }), ActionDisplayOn("list", "show", "edgesDiagram"), ActionWithOperation(NewOperation( "delete", OperationAsBulk(), OperationAsMutation(), )), ) // EdgesDiagramAction edges diagram action (optional) EdgesDiagramAction = NewAction( "edgesDiagram", ActionWithLabel("Edges Diagram"), ActionWithScope(ActionReadScope), ActionWithIcon("AntdIcons.ClusterOutlined"), ActionWithRoute(NewRoute("edges/:id", "EdgesDiagram.{name}EdgesDiagram")), ActionDisplayOn("show", "edit"), ) DefaultActions = []*Action{ ShowAction, ListAction, CreateAction, EditAction, DeleteAction, } )
var ( ActionReadScope = "Read" ActionCreateScope = "Create" ActionUpdateScope = "Update" ActionDeleteScope = "Delete" DefaultActionScopes = []string{ ActionReadScope, ActionCreateScope, ActionUpdateScope, ActionDeleteScope, } )
var AuthContextKey = "entkit_auth_context"
var DefaultEnvironmentAdapter = EnvironmentAdapter{}
DefaultEnvironmentAdapter main struct
var DefaultRefineAdapter = Refine{}
var DefaultServerAdapter = ServerAdapter{}
var DefaultTypescriptAdapter = TypescriptAdapter{}
Functions ¶
func Contains ¶
func Contains[T comparable](s []T, e T) bool
Contains checks if slice contains element
func GeneratorHook ¶
func NewEntgqlExtension ¶
func NewEntgqlExtension(opts ...entgql.ExtensionOption) (*entgql.Extension, error)
Types ¶
type Action ¶
type Action struct { Name *string `json:"Name,omitempty"` // Name of action (Required) General *bool `json:"General,omitempty"` // Mark action as general (independent of record) (e.g. create, list) Scope *string `json:"Scope,omitempty"` // Scope of resource authorization Props *map[string]any `json:"Props,omitempty"` // Props are directly passing to react component CustomComponent *string `json:"CustomComponent,omitempty"` // Custom component TODO: custom component Description *string `json:"Description,omitempty"` // Description of action Label *string `json:"Label,omitempty"` // Label of button Icon *string `json:"Icon,omitempty"` // Icon of button OnList *bool `json:"OnList,omitempty"` // Display on list OnShow *bool `json:"OnShow,omitempty"` // Display on show OnEdit *bool `json:"OnEdit,omitempty"` // Display on edit OnCreate *bool `json:"OnCreate,omitempty"` // Display on edit DisplayOn []string `json:"DisplayOn,omitempty"` Route *Route `json:"Route,omitempty"` // Route of action Operation *Operation `json:"Operation,omitempty"` // Operation of action }
Action item related action
func NewAction ¶
func NewAction(name string, options ...ActionOption) *Action
type ActionOption ¶
func ActionAsGeneral ¶
func ActionAsGeneral() ActionOption
func ActionDisplayOn ¶
func ActionDisplayOn(actionNames ...string) ActionOption
func ActionWithIcon ¶
func ActionWithIcon(icon string) ActionOption
func ActionWithLabel ¶
func ActionWithLabel(label string) ActionOption
func ActionWithOperation ¶
func ActionWithOperation(operation *Operation) ActionOption
func ActionWithProps ¶
func ActionWithProps(props map[string]any) ActionOption
func ActionWithRoute ¶
func ActionWithRoute(route *Route) ActionOption
func ActionWithScope ¶
func ActionWithScope(scope string) ActionOption
func WithCustomComponent ¶
func WithCustomComponent(component string) ActionOption
func WithDescription ¶
func WithDescription(description string) ActionOption
type Annotation ¶
type Annotation struct { TitleField *bool `json:"TitleField,omitempty"` // Mark field as title of entity ImageField *bool `json:"ImageField,omitempty"` // Mark field as image MainImageField *bool `json:"MainImageField,omitempty"` // Mark field as main image of entity CodeField *CodeFieldOptions `json:"CodeField,omitempty"` // Mark field as code field URLField *bool `json:"URLField,omitempty"` // Mark field as url field RichTextField *bool `json:"RichTextField,omitempty"` // Mark field as rich text field HideOnList *bool `json:"HideOnList,omitempty"` // Hide field on list HideOnShow *bool `json:"HideOnShow,omitempty"` // Hide field on show HideOnForm *bool `json:"HideOnForm,omitempty"` // Hide field on all forms HideOnCreate *bool `json:"HideOnCreate,omitempty"` // Hide field on create form HideOnUpdate *bool `json:"HideOnUpdate,omitempty"` // Hide field on update form FilterOperator *string `json:"FilterOperator,omitempty"` // Set filter operator for field `gen.Op` Icon *string `json:"Icon,omitempty"` // Set entity or field icon Label *string `json:"Label,omitempty"` // Set label for entity or field Description *string `json:"Description,omitempty"` // Set description for entity or field Prefix *string `json:"Prefix,omitempty"` // Set prefix on field: TODO Suffix *string `json:"Suffix,omitempty"` // Set suffix on field: TODO Actions []*Action `json:"Actions,omitempty"` // Set entity related actions View *string `json:"View,omitempty"` // Set view for field Route *string `json:"Route,omitempty"` // Set root Route for entity IndexRoute *bool `json:"IndexRoute,omitempty"` // Mark entity as index route ViewOnShow *string `json:"ViewOnShow,omitempty"` // Set a view of entity on show ViewOnList *string `json:"ViewOnList,omitempty"` // Set a view of entity on list ViewOnForm *string `json:"ViewOnForm,omitempty"` // Set a view on entity on form Badge *string `json:"Badge,omitempty"` // Set a badge view EdgesDiagram *string `json:"EdgesDiagram,omitempty"` }
Annotation struct container of all annotations
func CodeField ¶
func CodeField(config *CodeFieldOptions) Annotation
CodeField mark field as a code field
func Description ¶
func Description(description string) Annotation
Description define description of field/entity todo: implement generator
func FilterOperator ¶
func FilterOperator(operator gen.Op) Annotation
FilterOperator define entity field filter operator
func Icon ¶
func Icon(icon string) Annotation
Icon define icon of entity that will be shown on navigations, breadcrumbs etc.
func Label ¶
func Label(label string) Annotation
Label define label of field todo: implement generator
func MainImageField ¶
func MainImageField() Annotation
MainImageField mark field as a main image field
func Prefix ¶
func Prefix(prefix string) Annotation
Prefix add prefix to value of field todo: implement generator
func RichTextField ¶
func RichTextField() Annotation
RichTextField mark field as a rich text field (wysiwyg editor)
func (Annotation) Merge ¶
func (at Annotation) Merge(other schema.Annotation) schema.Annotation
Merge implements the schema.Merger interface.
type Annotations ¶
Annotations Define Ent annotations
func (Annotations) Name ¶
func (Annotations) Name() string
Name of the annotation. Used by the codegen templates.
type Auth ¶
type Auth struct { Extension *Extension `json:"Extension,omitempty"` Enabled *bool `json:"Enabled,omitempty"` Keycloak *Keycloak `json:"Keycloak,omitempty"` }
func NewAuth ¶
func NewAuth(ex *Extension, options ...AuthOption) *Auth
func (*Auth) GetEnvironmentConfig ¶
func (at *Auth) GetEnvironmentConfig() *AuthEnvironment
type AuthContext ¶
type AuthContext struct { Roles []string // Not supporting yet. TODO: create support Permissions []*Permission }
type AuthEnvironment ¶
type AuthEnvironment struct {
Keycloak *KeycloakEnvironment `json:"keycloak,omitempty"`
}
type AuthOption ¶
func AuthWithKeycloak ¶
func AuthWithKeycloak(keycloakOption ...KeycloakOption) AuthOption
AuthWithKeycloak configure authentication and authorization
type CodeFieldOptions ¶
type CodeFieldOptions struct {
Language string `json:"Language,omitempty"`
}
CodeFieldOptions code field is configurable
**Example**
```go
CodeFieldOptions{ Language: "javascript" }
```
type Environment ¶
type Environment = struct { Meta map[string]any `json:"meta,omitempty"` GraphqlURL string `json:"graphqlUrl,omitempty"` AppPath string `json:"appPath,omitempty"` Auth *AuthEnvironment `json:"auth,omitempty"` }
Environment main struct
type EnvironmentAdapter ¶
type EnvironmentAdapter struct{}
EnvironmentAdapter main struct
func (EnvironmentAdapter) GetFS ¶
func (r EnvironmentAdapter) GetFS() fs.FS
GetFS returns fs of adapter
func (EnvironmentAdapter) GetName ¶
func (r EnvironmentAdapter) GetName() string
GetName returns name of adapter
func (EnvironmentAdapter) GetTemplates ¶
func (r EnvironmentAdapter) GetTemplates() []string
GetTemplates returns templates of adapter
type Extension ¶
type Extension struct { entc.DefaultExtension IgnoreUncommittedChanges *bool // Ignore uncommitted changes warning message GraphqlURL *string // Graphql URL Prefix *string // General prefix for all generated resources GoJs GoJSOptions // TODO: must be moved ForceGraph2D ForceGraph2DOptions // TODO: must be moved DefaultEdgesDiagram string // TODO: must be moved Auth *Auth Generators []*Generator Environment *Environment Meta map[string]any // Meta to share with frontend application FileHeader *string // contains filtered or unexported fields }
Extension main struct
func NewExtension ¶
func NewExtension(opts ...ExtensionOption) (*Extension, error)
NewExtension initialize extension
func (*Extension) Annotations ¶
func (ex *Extension) Annotations() []entc.Annotation
Annotations Define Ent annotations
func (*Extension) FieldTSType ¶
FieldTSType returns typescript type for field
func (*Extension) GetActionByName ¶
GetActionByName returns action by name
func (*Extension) GetEdgeAnnotations ¶
func (ex *Extension) GetEdgeAnnotations(field *gen.Edge) *Annotation
GetEdgeAnnotations returns edge annotations
func (*Extension) GetFieldAnnotations ¶
func (ex *Extension) GetFieldAnnotations(field *gen.Field) *Annotation
GetFieldAnnotations returns field annotations
func (*Extension) GetNodeAction ¶
GetNodeAction returns action by name
func (*Extension) GetNodeAnnotations ¶
func (ex *Extension) GetNodeAnnotations(node *gen.Type) *Annotation
GetNodeAnnotations returns node annotations
func (*Extension) MainImageField ¶
MainImageField returns main image field
func (*Extension) NodeActionRoutePattern ¶
NodeActionRoutePattern returns route pattern for node action
func (*Extension) PrepareName ¶
PrepareName returns prepared name
func (*Extension) TitleField ¶
TitleField returns title field
type ExtensionOption ¶
ExtensionOption is a functional option for Extension
func IgnoreUncommittedChanges ¶
func IgnoreUncommittedChanges() ExtensionOption
IgnoreUncommittedChanges ignore uncommitted changes warning message
func WithAuth ¶
func WithAuth(options ...AuthOption) ExtensionOption
WithAuth configure authentication and authorization
func WithDefaultEdgesDiagram ¶
func WithDefaultEdgesDiagram(name string) ExtensionOption
WithDefaultEdgesDiagram set default edges graph/diagram view component name
func WithForceGraph2D ¶
func WithForceGraph2D(options ForceGraph2DOptions) ExtensionOption
WithForceGraph2D use react-force-graph-2d for edges diagrams
func WithGenerator ¶
func WithGenerator(name string, adapter GeneratorAdapter, options ...GeneratorOption) ExtensionOption
WithGenerator add generator to extension
func WithGoJs ¶
func WithGoJs(options GoJSOptions) ExtensionOption
WithGoJs use gojs for edges diagrams
func WithGraphqlURL ¶
func WithGraphqlURL(url string) ExtensionOption
WithGraphqlURL define graphql server url
func WithMeta ¶
func WithMeta(key string, value any) ExtensionOption
WithMeta add metadata to `{AppPath}/entkit.json`
func WithPrefix ¶
func WithPrefix(prefix string) ExtensionOption
WithPrefix define typescript types/vars prefix
type ForceGraph2DOptions ¶
type ForceGraph2DOptions struct {
Enabled bool `json:"Enabled,omitempty"`
}
type Generator ¶
type Generator struct { Name *string `json:"Name,omitempty"` Extension *Extension `json:"Extension,omitempty"` SkipGoModTidy *bool `json:"SkipGoModTidy,omitempty"` Adapter GeneratorAdapter Path *string `json:"Path,omitempty"` Enabled *bool `json:"Enabled,omitempty"` Serve *bool `json:"Serve,omitempty"` Graph *gen.Graph SkipModes SkipModes Ops []gen.Op CWD *string `json:"CWD,omitempty"` // base directory of gen.go file or running `go generate` command CWD RelCWD *string `json:"RelCWD"` // relative directory of CWD and current generator path }
Generator main struct
func NewGenerator ¶
func NewGenerator(extension *Extension, name string, adapter GeneratorAdapter, options ...GeneratorOption) *Generator
func (*Generator) DefaultActions ¶
func (*Generator) ServableAdapter ¶
func (gr *Generator) ServableAdapter() ServableAdapter
type GeneratorAdapter ¶
type GeneratorAdapter interface {
GetName() string
}
GeneratorAdapter interface
type GeneratorAdapterWithAfter ¶
GeneratorAdapterWithAfter interface
type GeneratorAdapterWithAfterCommand ¶
GeneratorAdapterWithAfterCommand interface
type GeneratorAdapterWithBefore ¶
GeneratorAdapterWithBefore interface
type GeneratorAdapterWithBeforeCommand ¶
GeneratorAdapterWithBeforeCommand interface
type GeneratorAdapterWithDependencies ¶
type GeneratorAdapterWithDependencies interface {
GetDependencies() []GeneratorAdapter
}
GeneratorAdapterWithDependencies interface
type GeneratorAdapterWithFS ¶
GeneratorAdapterWithFS interface
type GeneratorAdapterWithStaticTemplates ¶
type GeneratorAdapterWithStaticTemplates interface { GeneratorAdapterWithFS GetStaticTemplates() []string }
GeneratorAdapterWithStaticTemplates interface
type GeneratorAdapterWithTemplates ¶
type GeneratorAdapterWithTemplates interface { GeneratorAdapterWithFS GetTemplates() []string }
GeneratorAdapterWithTemplates interface
type GeneratorOption ¶
func SkipGoModTidy ¶
func SkipGoModTidy() GeneratorOption
func TargetPath ¶
func TargetPath(path string) GeneratorOption
type GoJSOptions ¶
type Keycloak ¶
type Keycloak struct { Auth *Auth `json:"Auth,omitempty"` Enabled *bool `json:"Enabled,omitempty"` Host *string `json:"Host,omitempty"` Realm *string `json:"Realm,omitempty"` MasterAdminUsername *string `json:"MasterAdminUsername,omitempty"` MasterAdminPassword *string `json:"MasterAdminPassword,omitempty"` MasterRealm *string `json:"MasterRealm,omitempty"` AdminUsername *string `json:"AdminUsername,omitempty"` AdminPassword *string `json:"AdminPassword,omitempty"` BackendClientConfig *gocloak.Client `json:"BackendClientConfig,omitempty"` FrontendClientConfig *gocloak.Client `json:"FrontendClientConfig,omitempty"` GoCloak *gocloak.GoCloak `json:"GoCloak,omitempty"` }
Keycloak is a struct that contains keycloak configuration
func NewBackendKeycloak ¶
NewBackendKeycloak returns new backend keycloak instance
func NewKeycloak ¶
func NewKeycloak( auth *Auth, options ...KeycloakOption, ) *Keycloak
NewKeycloak returns new keycloak instance
func (*Keycloak) GenerateKeycloakResources ¶
GenerateKeycloakResources generates keycloak resources
func (*Keycloak) GetEnvironmentConfig ¶
func (kc *Keycloak) GetEnvironmentConfig() *KeycloakEnvironment
GetEnvironmentConfig returns keycloak environment configuration
func (*Keycloak) MiddlewareReqHandlerFunc ¶
func (kc *Keycloak) MiddlewareReqHandlerFunc(w http.ResponseWriter, r *http.Request) (*http.Request, error)
MiddlewareReqHandlerFunc is a middleware that checks if the request is authorized
type KeycloakEnvironment ¶
type KeycloakEnvironment struct { URL string `json:"url,omitempty"` Realm string `json:"realm,omitempty"` ClientID string `json:"clientId,omitempty"` BackendClientID string `json:"backendClientId,omitempty"` }
KeycloakEnvironment is a struct that contains keycloak environment configuration
type KeycloakOption ¶
KeycloakOption is a function that configure keycloak
func KeycloakBackendClientConfig ¶
func KeycloakBackendClientConfig(clientConfig gocloak.Client) KeycloakOption
KeycloakBackendClientConfig set keycloak backend client config
func KeycloakFrontendClientConfig ¶
func KeycloakFrontendClientConfig(clientConfig gocloak.Client) KeycloakOption
KeycloakFrontendClientConfig set keycloak frontend client config
func KeycloakGeneratedAdminCredentials ¶
func KeycloakGeneratedAdminCredentials(username string, password string) KeycloakOption
KeycloakGeneratedAdminCredentials set keycloak generated admin credentials
func KeycloakMasterAdminCredentials ¶
func KeycloakMasterAdminCredentials(username string, password string) KeycloakOption
KeycloakMasterAdminCredentials set keycloak master admin credentials
func KeycloakMasterRealm ¶
func KeycloakMasterRealm(realm string) KeycloakOption
KeycloakMasterRealm set keycloak master realm
func KeycloakRealm ¶
func KeycloakRealm(realm string) KeycloakOption
KeycloakRealm set keycloak realm
type Mutation ¶
type Mutation struct {
// contains filtered or unexported fields
}
func NewMutation ¶
func (Mutation) Description ¶
func (v Mutation) Description(desc string) entgql.MutationOption
func (Mutation) GetDescription ¶
type Operation ¶
type Operation struct { Mutation *bool `json:"Mutation,omitempty"` // Mark operation as mutation Query *bool `json:"Query,omitempty"` // Mark operation as query Name *string `json:"Name,omitempty"` // Operation of graphql Fields *[]string `json:"Fields,omitempty"` // Fields to take after operation Single *bool `json:"Single,omitempty"` // Show on single item Bulk *bool `json:"Bulk,omitempty"` // Show on bulk selected items SuccessMessage *string `json:"SuccessMessage,omitempty"` // Message on success FailMessage *string `json:"FailMessage,omitempty"` // Message on fail }
Operation struct
func NewOperation ¶
func NewOperation(name string, options ...OperationOption) *Operation
NewOperation creates new operation
type OperationOption ¶
func OperationAsBulk ¶
func OperationAsBulk() OperationOption
OperationAsBulk marks operation as bulk
func OperationAsMutation ¶
func OperationAsMutation() OperationOption
OperationAsMutation marks operation as mutation
func OperationAsQuery ¶
func OperationAsQuery() OperationOption
OperationAsQuery marks operation as query
func OperationAsSingle ¶
func OperationAsSingle() OperationOption
OperationAsSingle marks operation as single
func OperationWithFailMessage ¶
func OperationWithFailMessage(message string) OperationOption
OperationWithFailMessage sets fail message
func OperationWithFields ¶
func OperationWithFields(fields ...string) OperationOption
OperationWithFields sets fields
func OperationWithSuccessMessage ¶
func OperationWithSuccessMessage(message string) OperationOption
OperationWithSuccessMessage sets success message
type Permission ¶
type Refine ¶
type Refine struct{}
func (Refine) CommandAfterGen ¶
func (Refine) GetDependencies ¶
func (r Refine) GetDependencies() []GeneratorAdapter
func (Refine) GetStaticTemplates ¶
func (Refine) GetTemplates ¶
func (Refine) RewritePath ¶
func (Refine) StaticPaths ¶
type Route ¶
type RouteOption ¶
func RouteAsIndex ¶
func RouteAsIndex() RouteOption
type ServableAdapter ¶
type ServerAdapter ¶
type ServerAdapter struct{}
func (ServerAdapter) BeforeGen ¶
func (r ServerAdapter) BeforeGen(generator *Generator) error
func (ServerAdapter) CommandAfterGen ¶
func (r ServerAdapter) CommandAfterGen(generator *Generator) string
func (ServerAdapter) GetFS ¶
func (r ServerAdapter) GetFS() fs.FS
func (ServerAdapter) GetName ¶
func (r ServerAdapter) GetName() string
func (ServerAdapter) GetStaticTemplates ¶
func (r ServerAdapter) GetStaticTemplates() []string
func (ServerAdapter) GetTemplates ¶
func (r ServerAdapter) GetTemplates() []string
type SkipModes ¶
type TypescriptAdapter ¶
type TypescriptAdapter struct{}
func (TypescriptAdapter) GetFS ¶
func (r TypescriptAdapter) GetFS() fs.FS
func (TypescriptAdapter) GetName ¶
func (r TypescriptAdapter) GetName() string
func (TypescriptAdapter) GetTemplates ¶
func (r TypescriptAdapter) GetTemplates() []string