Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Cmd = &cobra.Command{ Use: "casbin", Short: "Casbin policy migration", SilenceUsage: true, SilenceErrors: true, Run: func(_ *cobra.Command, _ []string) { var ( srv *casbin.Casbin c func() e error ) defer func() { if c != nil { c() } }() cmd.Slave.Executor(func(ctx context.Context) error { initial, _ := entrypoint.CtxExtractInitial(ctx) srv, c, e = casbin.Build(ctx, initial, cmd.Observer) if e != nil { return e } return nil }, func(ctx context.Context) error { e := srv.ImportPolicy(cmd.Slave.WorkDir() + "/assets/policy.conf") if e != nil { srv.L().Error("import policy failed: %v", logger.Args(e.Error())) os.Exit(1) } return nil }) }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.