api

package
v0.15.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	DB    ddb.Storage
	Rules AccessRuleService
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, opts Opts) (*API, error)

New creates a new API.

func (*API) GovArchiveAccessRule

func (a *API) GovArchiveAccessRule(w http.ResponseWriter, r *http.Request, ruleId string)

Archive Access Rule (POST /api/v1/gov/access-rules/{ruleId}/archive)

func (*API) GovCreateAccessRule

func (a *API) GovCreateAccessRule(w http.ResponseWriter, r *http.Request)

Create Access Rule (POST /api/v1/gov/access-rules)

func (*API) GovGetAccessRule

func (a *API) GovGetAccessRule(w http.ResponseWriter, r *http.Request, ruleId string)

Get Access Rule (GET /api/v1/gov/access-rules/{ruleId})

func (*API) GovListAccessRules

func (a *API) GovListAccessRules(w http.ResponseWriter, r *http.Request, params gov_types.GovListAccessRulesParams)

List Access Rules (GET /api/v1/gov/access-rules)

func (*API) GovUpdateAccessRule

func (a *API) GovUpdateAccessRule(w http.ResponseWriter, r *http.Request, ruleId string)

Update Access Rule (PUT /api/v1/gov/access-rules/{ruleId})

func (*API) Handler

func (a *API) Handler(r chi.Router) http.Handler

Handler returns a HTTP handler. Hander doesn't add any middleware. It is the caller's responsibility to add any middleware.

type AccessRuleService

type AccessRuleService interface {
	ArchiveAccessRule(ctx context.Context, userID string, in rule.AccessRule) (*rule.AccessRule, error)
	CreateAccessRule(ctx context.Context, userID string, in types.CreateAccessRuleRequest) (*rule.AccessRule, error)
	UpdateRule(ctx context.Context, in *rulesvc.UpdateOpts) (*rule.AccessRule, error)
}

AccessRuleService can create and get rules

type Opts

type Opts struct {
	Log                 *zap.SugaredLogger
	PaginationKMSKeyARN string
	DynamoTable         string
	DeploymentConfig    deploy.DeployConfigReader

	AccessHandlerClient ahtypes.ClientWithResponsesInterface
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL