Files
SugarDB/docs/docs/commands/admin/module_load.mdx
Kelvin Mwinuka 206a9fe4e6 Added docs folder at the project root. Added build_docs and publish_d… (#105)
Docs sub-directory added to the project.
2024-09-11 01:32:58 +08:00

64 lines
1.4 KiB
Plaintext

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# MODULE LOAD
### Syntax
```
MODULE LOAD path [arg [arg ...]]
```
### Module
<span className="acl-category">admin</span>
### Categories
<span className="acl-category">admin</span>
<span className="acl-category">dangerous</span>
<span className="acl-category">fast</span>
### Description
Load a module from a dynamic library at runtime.
The path should be the full path to the module, including the .so filename. Any args will be be passed unmodified to the
module's key extraction and handler functions.
### Examples
<Tabs
defaultValue="go"
values={[
{ label: 'Go (Embedded)', value: 'go', },
{ label: 'CLI', value: 'cli', },
]}
>
<TabItem value="go">
Load a modules with no args:
```go
vault, err := echovault.NewEchoVault()
if err != nil {
log.Fatal(err)
}
err := server.LoadModule("/path/to/module.so")
```
Load a module with a few args:
```go
vault, err := echovault.NewEchoVault()
if err != nil {
log.Fatal(err)
}
err := server.LoadModule("/path/to/module.so", "arg1", "arg2", "arg3")
```
</TabItem>
<TabItem value="cli">
Load a module with no args:
```
> MODULE LOAD path/to/module.so
```
Load a module with a few args:
```
> MODULE LOAD path/to/module.so arg1 arg2 arg3
```
</TabItem>
</Tabs>