backendtypes

package
v0.0.0-...-7dfa3a9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxASTNodes = 50

MaxASTNodes specifies the maximum allowed AST node complexity after deduplication.

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")

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

	// ErrUserMaxNotificationChannels indicates the user has reached the maximum
	// number of allowed notification channels.
	ErrUserMaxNotificationChannels = errors.New("user has reached the maximum number of allowed notification channels")

	// 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")

	// ErrUnsupportedVCSProvider indicates the requested VCS provider is not supported.
	ErrUnsupportedVCSProvider = errors.New("unsupported VCS provider")

	// 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")

	// ErrSavedSearchMaxDepthExceeded indicates that the saved search expansion exceeded the maximum depth.
	ErrSavedSearchMaxDepthExceeded = errors.New("saved search expansion exceeded maximum depth")

	// ErrSavedSearchCycleDetected indicates a cycle was detected in saved search expansion.
	ErrSavedSearchCycleDetected = errors.New("cycle detected in saved search expansion")

	// ErrSavedSearchNotFound indicates the saved search was not found.
	ErrSavedSearchNotFound = errors.New("saved search not found")

	// ErrHotlistNotFound indicates the hotlist was not found.
	ErrHotlistNotFound = errors.New("hotlist not found")

	// ErrQueryConsistsEntirelyOfSavedSearch indicates the query consists entirely of a saved search.
	ErrQueryConsistsEntirelyOfSavedSearch = errors.New(
		"query cannot consist entirely of a single saved search or hotlist",
	)

	// ErrQueryComplexityExceeded indicates that the search query AST complexity exceeds the maximum allowed limit.
	ErrQueryComplexityExceeded = errors.New("search query complexity limit exceeded")
)

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 QueryParseError

type QueryParseError struct {
	BadQuery string
	Err      error
}

func (*QueryParseError) Error

func (e *QueryParseError) Error() string

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 SavedSearchNotificationEvent

type SavedSearchNotificationEvent struct {
	ID            string
	SavedSearchID string
	SnapshotType  string
	Timestamp     time.Time
	EventType     string
	Reasons       []string
	BlobPath      string
	DiffBlobPath  string
	Summary       []byte // JSON bytes
}

SavedSearchNotificationEvent represents a change event for a saved search. This is the domain model used by the API layer.

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