templates

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

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 added in v2.11.0

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

WithResourceInfo renders template stings with ResourceInfo variables

func WithSpacePropertiesAndUser added in v2.1.0

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 added in v2.11.0

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

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

type SpaceData added in v2.1.0

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