Commit Graph

8 Commits (fc40706ca992f2b74df26dc415a4e71f52ec74b2)

Author SHA1 Message Date
Aravinth Manivannan b7fe7ea5d5
chore: rename gists to gitpad 2022-02-20 19:21:28 +05:30
Aravinth Manivannan 96be68c734
fix and chore: apply clippy lints and create_gist returns gist public ID
fixes #1
2022-02-19 13:35:03 +05:30
Aravinth Manivannan 632fe272fa
feat: read_file processes directories
    This program supports directories in gists. This patch modifies
    Data::read_file to support directory reads. Additionally,
    CreateGistRequest is modified to accept files in subdirectories.

	When repository contains subdirectories, it will recursively
	read all files and return their contents.

	Set of known(to me) file modes that Git uses.
	GitFileMode::Unsupported is used to take advantage of
	num_enum::FromPrimitive. The alternative would have been
	num_enum::TryFromPrimitive, which returns errors on unsupported
	values. I felt the former was cleaner.
2022-02-18 21:38:38 +05:30
Aravinth Manivannan 197950c3b2
feat: accommodate binary file content
    Binary content is essential to store images. ContentType enum
    accommodates both utf-8 and and non utf-8 encodings.

    Data::write_file and Data::read_file are modified to handle
    ContentType enum
2022-02-16 20:23:04 +05:30
Aravinth Manivannan 82acb06eac
feat: Data::write_file accepts gist ID/gist repository & test cleanup 2022-02-15 23:46:31 +05:30
Aravinth Manivannan 18865552e1
feat: Data::write_file and Data::read_file to save and read gists
	Creates a new files and commits them to "master" branch on the
	bare repository allocated for the gist. If multiple files are
	supplied, all files are written and committed in a single

	Currently, empty commit message is used but this should probably
	be changed.

	If filename includes spaces it is escaped. Example "foo bar".txt
	is escaped and converted into "foo\ bar".txt.

	Reads files already committed to the repository allocated for
	the gist. This method expects filenames provided to be already
	escaped. Failure would result in file not found errors

	Receives gist public ID and returns path of the repository
	allocated for the gist. Programmers are expected to use this
	method to work on the repositories instead of manually
	constructing paths.

	Escapes spaces in the provided string, "foo bar".txt is
	converted to "foo\ bar".txt
2022-02-15 21:29:55 +05:30
Aravinth Manivannan 303a4ab0ba
feat: helper method Data::new_gist to create new gist and tests
    Data::new_gist creates a bare repository in the supplied
    Data.settings.repository.root directory and saves metadata in the

    See accompanying test for usage
2022-02-14 22:46:17 +05:30
Aravinth Manivannan 34a67a5535 feat: bootstarp gists

- Sign Up
- Sign IN

- Username Exists
- Email Exists
- Account delete
- Password update
- Email update
- Username update
- Get account secret
- Update secret

All routes are implemented with proper error handling and testing

See ./config/default.toml for full list
2022-02-12 23:48:35 +05:30