Class opendal.operator

OpenDAL operator.

Methods

opendal.operator:new (string, table) Construct an operator based on scheme and option.
opendal.operator:write (string, string) Blockingly write raw bytes to path.
opendal.operator:read (string) Blockingly read raw bytes from path.
opendal.operator:delete (string) Blockingly delete the object in path.
opendal.operator:rename (string, string) Blockingly rename the object of src to dst.
opendal.operator:create_dir (string) Blockingly create the object in path.
opendal.operator:is_exist (string) Check whether the path exists.
opendal.operator:stat (string) Stat the path, return its metadata.


Methods

opendal.operator:new (string, table)
Construct an operator based on scheme and option. Uses an table of key-value pairs to initialize the operator based on provided scheme and options. For each scheme, i.e. Backend, different options could be set, you may reference the https://opendal.apache.org/docs/category/services/ for each service, especially for the **Configuration Part**.

Parameters:

  • string scheme the service scheme you want to specify, e.g. "fs", "s3", "supabase"
  • table options the table to the options for this operators

Returns:

    table, error opendal operator table which contain opendal operator instance, error nil if success, others otherwise
opendal.operator:write (string, string)
Blockingly write raw bytes to path. Write the bytes into the path blockingly, returns nil if success, others otherwise

Parameters:

  • string bytes the bytes to be written
  • string bytes the bytes to be written

Returns:

    error nil if success, otherwise error message
opendal.operator:read (string)
Blockingly read raw bytes from path. Read the data out from `path` blockingly by operator, returns the string if success, others otherwise

Parameters:

  • string path the designated path you want to write your bytes in

Returns:

    string, error read data, error nil if success, otherwise error message
opendal.operator:delete (string)
Blockingly delete the object in path. Delete the object in path blockingly, returns error nil if success, others otherwise

Parameters:

  • string path the designated path you want to write your delete

Returns:

    error error nil if success, otherwise error message
opendal.operator:rename (string, string)
Blockingly rename the object of src to dst. Rename the object in path blockingly, returns error nil if success, others otherwise

Parameters:

  • string dst the designated path you want to rename your destination path
  • string dst the designated path you want to rename your destination path

Returns:

    error error nil if success, otherwise error message
opendal.operator:create_dir (string)
Blockingly create the object in path. Create directory the object in path blockingly, returns error nil if success, others otherwise

Parameters:

  • string path the designated path you want to create your directory

Returns:

    error error nil if success, otherwise error message
opendal.operator:is_exist (string)
Check whether the path exists.

Parameters:

  • string path the designated path you want to write your delete

Returns:

    bool, error true or false depend on operator instance and path, error nil if success, otherwise error message
opendal.operator:stat (string)
Stat the path, return its metadata.

Parameters:

  • string ,path the designated path you want to write your delete

Returns:

    table , error opendal.metadata instance table, error nil if success, otherwise error message
generated by LDoc 1.5.0 Last updated 2025-02-21 04:33:56