Skip to content

How use pkl with a interface which holds a config for a repository configuration #193

Closed Answered by austin-barrington
austin-barrington asked this question in Q&A
Discussion options

You must be logged in to vote

Gave up and used code gen which after tinkering seemed to work.

Final output:

spec.pkl

@go.Package { name = "src/entities/pkl" }
module srenity.entities.Configuration;

import "package://pkg.pkl-lang.org/pkl-go/[email protected]#/go.pkl" 

inputs: Listing<Datasource>
outputs: Listing<Datasource>
@go.Name { value = "SLOs" }
slos: Listing<SLO>

class Datasource {
    name: String
    type: String

    // golang interface
    config: Dynamic
}

class SLO {
    name: String
    description: String
    output: String
    @go.Name { value = "SLIs" }
    slis: Listing<SLI>
}

class SLI {
    name: String
    description: String
    input: String
    interval: Duration
    query: String
    goal: …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@holzensp
Comment options

@austin-barrington
Comment options

Answer selected by holzensp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants