engcontext

package
v0.0.72 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package engcontext defines the EngineContext type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithEntityContext

func WithEntityContext(ctx context.Context, c *EntityContext) context.Context

WithEntityContext stores an EntityContext in the current context.

Types

type EntityContext

type EntityContext struct {
	Project  Project
	Provider Provider
}

EntityContext is the context of an entity. This is relevant for getting the full information about an entity.

func EntityFromContext

func EntityFromContext(ctx context.Context) EntityContext

EntityFromContext extracts the current EntityContext, WHICH MAY BE NIL!

func (*EntityContext) Validate

func (c *EntityContext) Validate(ctx context.Context, q db.Querier, providerStore providers.ProviderStore) error

Validate validates that the entity context contains values that are present in the DB

func (*EntityContext) ValidateProject

func (c *EntityContext) ValidateProject(ctx context.Context, q db.Querier) error

ValidateProject validates that the entity context contains a project that is present in the DB

type Project

type Project struct {
	ID uuid.UUID
}

Project is a construct relevant to an entity's context. This is relevant for getting the full information about an entity.

type Provider

type Provider struct {
	Name string
}

Provider is a construct relevant to an entity's context. This is relevant for getting the full information about an entity.

Jump to

Keyboard shortcuts

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