createprecheck

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package createprecheck contains helpers for create operations that must avoid hidden duplicate disclosure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureVisibleCreate

func EnsureVisibleCreate(
	ctx context.Context,
	exists ExistsFunc,
	read ReadFunc,
	conflictMessage string,
	deniedMessage string,
) error

EnsureVisibleCreate verifies that a create request does not disclose hidden duplicates.

func EnsureVisibleDuplicate

func EnsureVisibleDuplicate(
	ctx context.Context,
	resourceExists bool,
	read ReadFunc,
	conflictMessage string,
	deniedMessage string,
) error

EnsureVisibleDuplicate maps an existing resource to conflict or denied without disclosing duplicates hidden by the active create formula.

func ResponseStatus

func ResponseStatus(err error) (int, string)

ResponseStatus maps create precheck errors to an HTTP status and response step.

func ReturnError

func ReturnError(err error) error

ReturnError keeps internal precheck failures visible to generated service callers.

Types

type ExistsFunc

type ExistsFunc func(context.Context) (bool, error)

ExistsFunc checks raw resource existence without visibility filtering.

type ReadFunc

type ReadFunc func(context.Context) error

ReadFunc performs a visibility-aware resource read.

Jump to

Keyboard shortcuts

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