templates

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 8 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 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 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