Skip to content

Repository files navigation

DatResources

DATCODE's esource management system.

Requirements

  • Go 1.22.x
  • Either a copy of the resources.csv or resources.db (sqlite file)

Build the executable

While in the project directory, run

go build -o resources cmd/main.go

Running the program

The resources executable is a CLI app that can spawn a webserver.

Availabe CLI commands:

CommandInput
./resources loadLoads the Neo4j csv backup to the db. This onlhy needs to be done if the db hasnt already been created--csv /path/to/backup.csv
./resources addAdds a new resource to the db--title "some title"--description "resource description" --user--slack_id--uri
./resources searchExecutes a search against the db--query "some search query @user @user #tag"
./resources webStarts the webserver--port=":9999"

Webserver Routes

MethodURIParamsDescription
GET/searchquery=some query string (same as cli)limitoffsetpowerset_cap=5 (the number of items to turn into a powerset in lue of full text searching)Does a search against the db
POST/resource{"user": {"username": "mark", "slack_id": "XXXX"}, "resource": {"description": "test"}, "tags": ["one", "two", "three"]}Creates a new resource and will create a new user if necessary

TO-DO

  • Add functionality to manage users directly
  • Add full text searching and drop the powerset term like matching

About

datcode's public website

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages