Skip to content

drkaka/kkreport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kkreport

Build Status Coverage Status

The abuse report module for golang project.

Database

It is using PostgreSQL as the database and will create a table:

CREATE TABLE IF NOT EXISTS report (
	id uuid primary key,
	userid integer,
    at integer,
    handle boolean DEFAULT false,
    reason smallint,
    value text
);

Dependence

go get github.com/jackc/pgx
go get github.com/satori/go.uuid

Usage

####First need to use the module with the pgx pool passed in:

err := kkreport.Use(pool)

####Insert a report:

err := kkreport.InsertReport(3, 0, "value");

####Get all reports:

reports, err := kkreport.GetAllReports(0);

####Mark one report as handled:

err := kkreport.HandleReport(id);

####Delete a report record:

err := kkreport.DeleteReport(id);

####Get unhandled reports:

reports, err := kkreport.GetUnhandledReports(0);

####Get handled reports:

reports, err := kkreport.GetHandledReports(0);

About

The abuse report module for golang project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published