pubsubinfo

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pubsubinfo provides a mixin for ent that allows for adding annotations to fields required for message publishing

Index

Constants

This section is empty.

Variables

View Source
var (
	// PubSubInfoTemplate adds support for generating pubsub fields
	PubSubInfoTemplate = parseT("template/pubsub.tmpl")

	// TemplateFuncs contains the extra template functions used by entx.
	TemplateFuncs = template.FuncMap{
		"contains": strings.Contains,
	}

	// MixinTemplates includes all templates for extending ent to support entx mixins.
	MixinTemplates = []*gen.Template{
		PubSubInfoTemplate,
	}
)
View Source
var AnnotationName = "INFRA9_PUBSUBHOOK"

AnnotationName is the value of the annotation when read during ent compilation

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	QueueName                string
	IsAdditionalSubjectField bool
}

Annotation provides a ent.Annotaion spec

func AdditionalSubject

func AdditionalSubject() *Annotation

AdditionalSubject marks this field as a field to return as an additional subject

func (Annotation) Name

func (a Annotation) Name() string

Name implements the ent Annotation interface.

type Extension

type Extension struct {
	entc.DefaultExtension
	// contains filtered or unexported fields
}

Extension is an implementation of entc.Extension that adds all the templates that entx needs.

func NewExtension

func NewExtension(opts ...ExtensionOption) (*Extension, error)

NewExtension returns an entc Extension that allows the entx package to generate the schema changes and templates needed to function

func (*Extension) Templates

func (e *Extension) Templates() []*gen.Template

Templates of the extension

type ExtensionOption

type ExtensionOption func(*Extension) error

ExtensionOption allow for control over the behavior of the generator

Jump to

Keyboard shortcuts

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