templates

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 8 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 WithSpacePropertiesAndUser added in v2.1.0

func WithSpacePropertiesAndUser(u *userpb.User, spaceType string, spaceName 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 SpaceData added in v2.1.0

type SpaceData struct {
	*UserData
	SpaceType string
	SpaceName 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