github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240516002902-d08759d6ca9f/pkg/renderers/deb/copyright.go (about)

     1  package deb
     2  
     3  import (
     4  	_ "embed"
     5  	"path/filepath"
     6  
     7  	"github.com/pojntfx/hydrapp/hydrapp/pkg/renderers"
     8  )
     9  
    10  //go:embed copyright
    11  var copyrightTemplate string
    12  
    13  type copyrightData struct {
    14  	AppID          string
    15  	AppGit         string
    16  	AppSPDX        string
    17  	AppLicenseText string
    18  	AppReleases    []renderers.Release
    19  }
    20  
    21  func NewCopyrightRenderer(
    22  	appID string,
    23  	appGit string,
    24  	appSPDX string,
    25  	appLicenseText string,
    26  	appReleases []renderers.Release,
    27  ) renderers.Renderer {
    28  	return renderers.NewRenderer(
    29  		filepath.Join("debian", "copyright"),
    30  		copyrightTemplate,
    31  		copyrightData{appID, appGit, appSPDX, appLicenseText, appReleases},
    32  	)
    33  }