backendtypes

package
v0.0.0-...-96aafe2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidPageToken indicates the page token is invalid.
	// Raised by the adapter layer to let the server layer know that the
	// page token did not meet the expected encoding in the database layer.
	ErrInvalidPageToken = errors.New("invalid page token")

	// ErrUserMaxSavedSearches indicates the user has reached the maximum
	// number of allowed saved searches.
	ErrUserMaxSavedSearches = errors.New("user has reached the maximum number of allowed saved searches")

	// ErrUserMaxBookmarks indicates the user has reached the maximum
	// number of allowed bookmarks.
	ErrUserMaxBookmarks = errors.New("user has reached the maximum number of allowed bookmarks")

	// ErrUserNotAuthorizedForAction indicates the user is not authorized to execute the requested action.
	ErrUserNotAuthorizedForAction = errors.New("user not authorized to execute action")

	// ErrEntityDoesNotExist indicates the entity does not exist.
	ErrEntityDoesNotExist = errors.New("entity does not exist")

	// ErrJSONMarshal indicates a failure when marshalling data from a generic interface{} for conversion.
	// This typically happens during the data conversion from a database type to a JSON byte slice.
	ErrJSONMarshal = errors.New("failed to marshal data for JSON conversion")

	// ErrJSONUnmarshal indicates a failure when unmarshalling JSON data into a target struct.
	// This suggests a mismatch between the data stored in the database and the expected data contract.
	ErrJSONUnmarshal = errors.New("failed to unmarshal JSON data")

	// ErrEmptyJSONValue is a sentinel error indicating that the JSON value from the database
	// was valid but empty (e.g., an empty array or object). This allows callers to distinguish
	// between a missing value and an explicitly empty one.
	ErrEmptyJSONValue = errors.New("JSON value is empty")
)

Functions

func AttemptToStoreSubscriptionTrigger

AttemptToStoreSubscriptionTrigger attempts to convert the given subscription trigger writable into a subscription trigger response value. If the conversion fails, it logs a warning and returns an empty SubscriptionTriggerResponseValue.

func AttemptToStoreSubscriptionTriggerUnknown

func AttemptToStoreSubscriptionTriggerUnknown() backend.SubscriptionTriggerResponseValue

AttemptToStoreSubscriptionTriggerUnknown attempts to convert an unknown subscription trigger into a subscription trigger response value. If the conversion fails, it logs a warning and returns an empty SubscriptionTriggerResponseValue.

func DefaultBrowsers

func DefaultBrowsers() []backend.BrowserPathParam

Types

type FeatureResult

type FeatureResult interface {
	Visit(ctx context.Context, visitor FeatureResultVisitor) error
}

FeatureResult is the interface that all concrete results implement. The Visit method allows a visitor to operate on the concrete type.

type FeatureResultVisitor

type FeatureResultVisitor interface {
	VisitRegularFeature(ctx context.Context, result RegularFeatureResult) error
	VisitMovedFeature(ctx context.Context, result MovedFeatureResult) error
	VisitSplitFeature(ctx context.Context, result SplitFeatureResult) error
}

FeatureResultVisitor defines the methods for visiting each result type.

type GetFeatureResult

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

GetFeatureResult is a container for the result of a GetFeature operation.

func NewGetFeatureResult

func NewGetFeatureResult(result FeatureResult) *GetFeatureResult

NewGetFeatureResult creates a new GetFeatureResult.

func (GetFeatureResult) Visit

Visit allows a visitor to operate on the result.

type MovedFeatureResult

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

MovedFeatureResult represents a result for a moved feature.

func NewMovedFeatureResult

func NewMovedFeatureResult(newFeatureID string) *MovedFeatureResult

NewMovedFeatureResult creates a new MovedFeatureResult for a moved feature.

func (MovedFeatureResult) NewFeatureID

func (m MovedFeatureResult) NewFeatureID() string

func (MovedFeatureResult) Visit

type RegularFeatureResult

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

RegularFeatureResult represents a result for a regular feature.

func NewRegularFeatureResult

func NewRegularFeatureResult(feature *backend.Feature) *RegularFeatureResult

RegularFeatureResult creates a new RegularFeatureResult for a regular feature.

func (RegularFeatureResult) Feature

func (r RegularFeatureResult) Feature() *backend.Feature

func (RegularFeatureResult) Visit

type SplitFeatureResult

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

SplitFeatureResult represents a result for a split feature.

func NewSplitFeatureResult

func NewSplitFeatureResult(splitFeature backend.FeatureEvolutionSplit) *SplitFeatureResult

NewSplitFeatureResult creates a new SplitFeatureResult for a split feature.

func (SplitFeatureResult) SplitFeature

func (SplitFeatureResult) Visit

type UserProfile

type UserProfile struct {
	UserID       string
	GitHubUserID int64
	Emails       []string
}

Jump to

Keyboard shortcuts

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