Documentation ¶
Overview ¶
Package jurisdiction contains jurisdiction related CRUD functionality.
Index ¶
- Variables
- type Info
- type Jurisdiction
- func (j Jurisdiction) Query(ctx context.Context, traceID string, pageNumber int, rowsPerPage int) ([]Info, error)
- func (j Jurisdiction) QueryByCode(ctx context.Context, traceID string, claims auth.Claims, ...) (Info, error)
- func (j Jurisdiction) ToggleActive(ctx context.Context, traceID string, claims auth.Claims, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is used when a specifij Jurisdiction is requested but does not exist. ErrNotFound = errors.New("not found") // ErrInvalidID occurs when an ID is not in a valid form. ErrInvalidID = errors.New("ID is not in its proper form") // ErrForbidden occurs when a user tries to do something that is forbidden to them according to our access control policies. ErrForbidden = errors.New("attempted action is not allowed") )
Functions ¶
This section is empty.
Types ¶
type Jurisdiction ¶
type Jurisdiction struct {
// contains filtered or unexported fields
}
Jurisdiction manages the set of API's for jurisdiction access.
func New ¶
func New(log *log.Logger, db *sqlx.DB) Jurisdiction
New constructs a Jurisdiction for api access.
func (Jurisdiction) Query ¶
func (j Jurisdiction) Query(ctx context.Context, traceID string, pageNumber int, rowsPerPage int) ([]Info, error)
Query retrieves a list of active jurisdictions from the database.
func (Jurisdiction) QueryByCode ¶
func (j Jurisdiction) QueryByCode(ctx context.Context, traceID string, claims auth.Claims, jurisdictionCode string) (Info, error)
QueryByjurisdictionCode gets the specified jurisdiction from the database.
func (Jurisdiction) ToggleActive ¶
func (j Jurisdiction) ToggleActive(ctx context.Context, traceID string, claims auth.Claims, jurisdictionCode string) error
ToggleActive activates a jurisdiction in the database.
Click to show internal directories.
Click to hide internal directories.