templates

package
v2.29.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package templates contains data-driven templates for path layouts.

Templates can use functions from the github.com/Masterminds/sprig library. All templates are cleaned with path.Clean().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithResourceInfo

func WithResourceInfo(i *providerv1beta1.ResourceInfo, tpl string) string

WithResourceInfo renders template stings with ResourceInfo variables

func WithSpacePropertiesAndUser

func WithSpacePropertiesAndUser(u *userpb.User, spaceType string, spaceName string, spaceID string, tpl string) string

WithSpacePropertiesAndUser generates a layout based on user data and a space type.

func WithUser

func WithUser(u *userpb.User, tpl string) string

WithUser generates a layout based on user data.

Types

type EmailData

type EmailData struct {
	Local  string
	Domain string
}

EmailData contains mail data split into local and domain part. It is extracted from splitting the username by @.

type ResourceData

type ResourceData struct {
	ResourceInfo *providerv1beta1.ResourceInfo
	ResourceID   string
}

ResourceData contains the ResourceInfo ResourceData.ResourceID is a stringified form of ResourceInfo.Id

type SpaceData

type SpaceData struct {
	*UserData
	SpaceType string
	SpaceName string
	SpaceId   string
}

SpaceData contains the templace placeholders for a space. For example {{.SpaceName}} {{.SpaceType}} or {{.User.Id.OpaqueId}}

type UserData

type UserData struct {
	*userpb.User
	Email EmailData
}

UserData contains the template placeholders for a user. For example {{.Username}} or {{.Id.Idp}}

Jump to

Keyboard shortcuts

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