templategen

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 7 Imported by: 0

README

Template-Generator

Template Generator transforms Portal API metadata into valid Gateway Bundles that can either be bootstrapped or applied directly to running Gateways. This functionality is also present in the Portal Init Container.

  1. go generate

Issues

  1. QuickTemplate is encoding apostrophe as &#39 , velocity/Portal encodes as &apos

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTemplate

func BuildTemplate(portalApi PortalAPI) string

func FromApiFragmentTemplate

func FromApiFragmentTemplate(portalApi PortalAPI) string

func FromApiServiceTemplate

func FromApiServiceTemplate(portalApi PortalAPI) string

func FromRestmamTemplate

func FromRestmamTemplate(portalApi PortalAPI, apiServiceXml string, apiFragmentXml string, isSoapApi string, wsdl string) string

func StreamFromApiFragmentTemplate

func StreamFromApiFragmentTemplate(qw422016 *qt422016.Writer, portalApi PortalAPI)

func StreamFromApiServiceTemplate

func StreamFromApiServiceTemplate(qw422016 *qt422016.Writer, portalApi PortalAPI)

func StreamFromRestmamTemplate

func StreamFromRestmamTemplate(qw422016 *qt422016.Writer, portalApi PortalAPI, apiServiceXml string, apiFragmentXml string, isSoapApi string, wsdl string)

func WriteFromApiFragmentTemplate

func WriteFromApiFragmentTemplate(qq422016 qtio422016.Writer, portalApi PortalAPI)

func WriteFromApiServiceTemplate

func WriteFromApiServiceTemplate(qq422016 qtio422016.Writer, portalApi PortalAPI)

func WriteFromRestmamTemplate

func WriteFromRestmamTemplate(qq422016 qtio422016.Writer, portalApi PortalAPI, apiServiceXml string, apiFragmentXml string, isSoapApi string, wsdl string)

Types

type CustomField

type CustomField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type PolicyTemplate

type PolicyTemplate struct {
	Uuid                       string              `json:"policyEntityUuid"`
	ApiPolicyTemplateArguments []PolicyTemplateArg `json:"policyTemplateArguments"`
}

type PolicyTemplateArg

type PolicyTemplateArg struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type PortalAPI

type PortalAPI struct {
	Uuid         string `json:"apiUuid"`
	UuidStripped string `json:"apiId"`     // templates have cases where uuid is stripped of -
	ServiceId    string `json:"serviceId"` // Portal calculates this as UUID.nameUUIDFromBytes(api.getUuid().toString().getBytes());
	Name         string `json:"name"`
	//Description       string           `json:"description"`
	//Type              string           `json:"type"`
	//PortalStatus      string           `json:"portalStatus"`
	ApiEnabled bool `json:"enabled"` // Added as a String to make it easier to use in qtpl
	//AccessStatus      string           `json:"accessStatus"`
	SsgUrl       string `json:"ssgUrl"`
	SsgUrlBase64 string `json:"ssgUrlEncoded"` // added as Fragment wants B64 version
	LocationUrl  string `json:"locationUrl"`   // backend full URL
	//Version      string `json:"version"`
	//ApiEulaUuid       string           `json:"apiEulaUuid"`
	PublishedTs    int    `json:"publishedTs"`
	CreateTs       int    `json:"createTs"`
	ModifyTs       int    `json:"modifyTs"`
	SsgServiceType string `json:"ssgServiceType"`
	//ApplicationUsage  int              `json:"applicationUsage"`
	//Tags              []string         `json:"tags"`
	PolicyTemplates []PolicyTemplate `json:"policyEntities"`              // required by qtpl templates
	CustomFields    []CustomField    `json:"customFieldValues,omitempty"` // required by qtpl templates
	//PublishedByPortal bool             `json:"publishedByPortal"`
	Checksum string `json:"checksum"`
}

Jump to

Keyboard shortcuts

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