Help us shape the future of Go! Take the 2026 Go Developer Survey

services

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsentService

type ConsentService struct {
	// contains filtered or unexported fields
}

ConsentService provides business logic for consent operations

func NewConsentService

func NewConsentService(db *gorm.DB, consentPortalBaseURL string) (*ConsentService, error)

NewConsentService creates a new consent service

func (*ConsentService) CreateConsentRecord

CreateConsentRecord creates a new consent record in the database

func (*ConsentService) GetConsentInternalView

func (s *ConsentService) GetConsentInternalView(ctx context.Context, consentID *string, ownerID *string, appID *string) (*models.ConsentResponseInternalView, error)

GetConsentInternalView retrieves a consent record by ID or by (ownerID AND appID) and returns its internal view

func (*ConsentService) GetConsentPortalView

func (s *ConsentService) GetConsentPortalView(ctx context.Context, consentID string, ownerID string) (*models.ConsentResponsePortalView, error)

GetConsentPortalView retrieves a consent record by ID and returns its portal view. Ownership is verified against ownerID before any lazy-expiry write, so a caller can never mutate a consent that belongs to someone else.

func (*ConsentService) ListConsentsByOwner added in v0.5.0

func (s *ConsentService) ListConsentsByOwner(ctx context.Context, ownerID string, statuses []models.ConsentStatus, limit, offset int) (*models.ListConsentsResponse, error)

ListConsentsByOwner returns the owner's consent records (newest first), optionally filtered by status. Stale pending/approved records of the owner are expired first so the returned statuses are accurate.

func (*ConsentService) UpdateConsentStatusByPortalAction

func (s *ConsentService) UpdateConsentStatusByPortalAction(ctx context.Context, req models.ConsentPortalActionRequest) error

UpdateConsentStatusByPortalAction updates the consent status based on user action from the consent portal

Jump to

Keyboard shortcuts

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