leo_s3_user

The s3-user operation.

References

Description

The s3-user operation

Function Index

auth/2 Retrieve owners (omit secret_key).
bulk_put/1 Add buckets.
checksum/0 Retrieve checksum of the table.
create_table/2 Create user table(mnesia).
delete/1 Delete a user.
find_all/0 Retrieve all records.
find_by_id/1 Retrieve a user by user-id.
put/1 Insert a user.
put/3 Create a user account.
transform/0 Transform data.
update/1 Update a user.

Function Details

auth/2

auth(UserId, Passwd) -> {ok, #'?S3_USER'{}} | {error, invalid_values}

  • UserId = binary()
  • Passwd = binary()

Retrieve owners (omit secret_key)

bulk_put/1

bulk_put(UserList) -> ok

  • UserList = [#'?S3_USER'{}]

Add buckets

checksum/0

checksum() -> {ok, non_neg_integer()} | not_found | {error, any()}

Retrieve checksum of the table

create_table/2

create_table(Mode, Nodes) -> ok

  • Mode = ram_copies | disc_copies
  • Nodes = [atom()]

Create user table(mnesia)

delete/1

delete(UserId) -> ok | {error, any()}

  • UserId = binary()

Delete a user

find_all/0

find_all() -> {ok, [#'?S3_USER'{}]} | not_found | {error, any()}

Retrieve all records

find_by_id/1

find_by_id(UserId) -> {ok, #'?S3_USER'{}} | not_found | {error, any()}

  • UserId = binary()

Retrieve a user by user-id

put/1

put(User) -> ok | {error, any()}

  • User = #'?S3_USER'{}

Insert a user

put/3

put(UserId, Password, WithS3Keys) -> ok | {ok, [tuple()]} | {error, any()}

  • UserId = binary()
  • Password = binary()
  • WithS3Keys = boolean()

Create a user account

transform/0

transform() -> ok

Transform data

update/1

update(User) -> ok | {error, any()}

  • User = #'?S3_USER'{}

Update a user