tpl

command module
v0.0.0-...-d1680f0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 10 Imported by: 0

README

tpl

How to use

  1. prepare values.csv file
file,hosts,cert,crt,path
aaa,"www.example.com example.com","/web/cert/example.com.cert","/web/key/example.com.key","/a,/b"
aaa,"www.example2.com example2.com","/web/cert/example.com.cert","/web/key/example.com.key","/a"
bbb,"google.com,example.com","/abc","/abc","/a,/b"
  1. prepare template.txt file
server {
    listen 443 ssl;
    server_name {{ .hosts }};
    ssl_certificate {{ .cert }};
    ssl_key {{ .crt }};

    {{- range splitList "," .path }}
    location {{ . }} {
        {{ sha1sum . }}
    }
    {{- end }}
}

  1. exec
go run .

Templete syntax

https://pkg.go.dev/text/template

Templete functions

https://masterminds.github.io/sprig/

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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