pax_global_header00006660000000000000000000000064144403572020014513gustar00rootroot0000000000000052 comment=4d97c015aacb6867609ef0189ae6baa6ed66c64b godartsass-2.0.0/000077500000000000000000000000001444035720200136645ustar00rootroot00000000000000godartsass-2.0.0/.github/000077500000000000000000000000001444035720200152245ustar00rootroot00000000000000godartsass-2.0.0/.github/FUNDING.yml000066400000000000000000000000151444035720200170350ustar00rootroot00000000000000github: [bep]godartsass-2.0.0/.github/workflows/000077500000000000000000000000001444035720200172615ustar00rootroot00000000000000godartsass-2.0.0/.github/workflows/test.yml000066400000000000000000000036571444035720200207760ustar00rootroot00000000000000on: push: branches: [ main ] pull_request: name: Test env: SASS_VERSION: 1.63.2 jobs: test: strategy: matrix: go-version: [~1.19, ~1.20] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v3 - name: Install dart-sass Linux if: matrix.os == 'ubuntu-latest' run: | curl -LJO "https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-linux-x64.tar.gz"; tar -xvf "dart-sass-${SASS_VERSION}-linux-x64.tar.gz"; echo "DART_SASS_BINARY=$GITHUB_WORKSPACE/dart-sass/sass" >> $GITHUB_ENV ./dart-sass/sass --version - name: Install dart-sass MacOS if: matrix.os == 'macos-latest' run: | curl -LJO "https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-macos-x64.tar.gz"; tar -xvf "dart-sass-${SASS_VERSION}-macos-x64.tar.gz"; echo "DART_SASS_BINARY=$GITHUB_WORKSPACE/dart-sass/sass" >> $GITHUB_ENV - name: Install dart-sass Windows if: matrix.os == 'windows-latest' run: | curl -LJO "https://github.com/sass/dart-sass/releases/download/${env:SASS_VERSION}/dart-sass-${env:SASS_VERSION}-windows-x64.zip"; Expand-Archive -Path "dart-sass-${env:SASS_VERSION}-windows-x64.zip" -DestinationPath .; echo "DART_SASS_BINARY=$env:GITHUB_WORKSPACE/dart-sass/sass.bat" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append - name: Test run: go test -race . -coverprofile=coverage.txt -covermode=atomic - name: Upload coverage if: success() && matrix.os == 'ubuntu-latest' run: | curl -s https://codecov.io/bash | bash env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} shell: bash godartsass-2.0.0/.gitignore000066400000000000000000000004231444035720200156530ustar00rootroot00000000000000# Binaries for programs and plugins *.exe *.exe~ *.dll *.so *.dylib # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out lib/ # Dependency directories (remove the comment below to include it) # vendor/ godartsass-2.0.0/LICENSE000066400000000000000000000020651444035720200146740ustar00rootroot00000000000000MIT License Copyright (c) 2020 Bjørn Erik Pedersen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. godartsass-2.0.0/README.md000066400000000000000000000024201444035720200151410ustar00rootroot00000000000000[![Tests on Linux, MacOS and Windows](https://github.com/bep/godartsass/workflows/Test/badge.svg)](https://github.com/bep/godartsass/actions?query=workflow%3ATest) [![Go Report Card](https://goreportcard.com/badge/github.com/bep/godartsass)](https://goreportcard.com/report/github.com/bep/godartsass) [![codecov](https://codecov.io/gh/bep/godartsass/branch/main/graph/badge.svg?token=OWZ9RCAYWO)](https://codecov.io/gh/bep/godartsass) [![GoDoc](https://godoc.org/github.com/bep/godartsass?status.svg)](https://godoc.org/github.com/bep/godartsass) This is a Go API backed by the native [Dart Sass](https://github.com/sass/dart-sass/releases) executable running with `sass --embedded`. >**Note:** The `v2.x.x` of this project targets the `v2` of the Dart Sass Embedded protocol with the `sass` exexutable in releases that can be downloaeded [here](https://github.com/sass/dart-sass/releases). For `v1` you need to import `github.com/bep/godartsass` and not `github.com/bep/godartsass/v2`. The primary motivation for this project is to provide `SCSS` support to [Hugo](https://gohugo.io/). I welcome PRs with bug fixes. I will also consider adding functionality, but please raise an issue discussing it first. For LibSass bindings in Go, see [GoLibSass](https://github.com/bep/golibsass). ``` godartsass-2.0.0/codecov.yml000066400000000000000000000002161444035720200160300ustar00rootroot00000000000000coverage: status: project: default: target: auto threshold: 0.5% patch: off comment: require_changes: true godartsass-2.0.0/conn.go000066400000000000000000000042621444035720200151540ustar00rootroot00000000000000package godartsass import ( "bufio" "bytes" "errors" "io" "os" "os/exec" "regexp" "runtime" "time" ) func newConn(cmd *exec.Cmd) (_ conn, err error) { in, err := cmd.StdinPipe() if err != nil { return conn{}, err } defer func() { if err != nil { in.Close() } }() out, err := cmd.StdoutPipe() stdErr := &tailBuffer{limit: 1024} buff := bufio.NewReader(out) c := conn{buff, buff, out, in, stdErr, cmd} cmd.Stderr = c.stdErr return c, err } type byteReadWriteCloser interface { io.ReadWriteCloser io.ByteReader } type conn struct { io.ByteReader io.Reader readerCloser io.Closer io.WriteCloser stdErr *tailBuffer cmd *exec.Cmd } // Start starts conn's Cmd. func (c conn) Start() error { err := c.cmd.Start() if err != nil { return c.Close() } return err } // Close closes conn's WriteCloser, ReadClosers, and waits for the command to finish. func (c conn) Close() error { writeErr := c.WriteCloser.Close() readErr := c.readerCloser.Close() var interruptErr error if runtime.GOOS != "windows" { // See https://github.com/bep/godartsass/issues/19 interruptErr = c.cmd.Process.Signal(os.Interrupt) if interruptErr == os.ErrProcessDone { interruptErr = nil } } cmdErr := c.waitWithTimeout() if writeErr != nil { return writeErr } if readErr != nil { return readErr } if interruptErr != nil { return interruptErr } return cmdErr } var brokenPipeRe = regexp.MustCompile("Broken pipe|pipe is being closed") // dart-sass ends on itself on EOF, this is just to give it some // time to do so. func (c conn) waitWithTimeout() error { result := make(chan error, 1) go func() { result <- c.cmd.Wait() }() select { case err := <-result: if eerr, ok := err.(*exec.ExitError); ok { if eerr.Error() == "signal: interrupt" { return nil } if brokenPipeRe.MatchString(c.stdErr.String()) { return nil } } return err case <-time.After(5 * time.Second): return errors.New("timed out waiting for dart-sass to finish") } } type tailBuffer struct { limit int bytes.Buffer } func (b *tailBuffer) Write(p []byte) (n int, err error) { if len(p)+b.Buffer.Len() > b.limit { b.Reset() } n, err = b.Buffer.Write(p) return } godartsass-2.0.0/go.mod000066400000000000000000000006501444035720200147730ustar00rootroot00000000000000module github.com/bep/godartsass/v2 go 1.19 require ( github.com/cli/safeexec v1.0.1 github.com/frankban/quicktest v1.14.2 google.golang.org/protobuf v1.30.0 ) require ( github.com/google/go-cmp v0.5.7 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/rogpeppe/go-internal v1.6.1 // indirect golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect ) godartsass-2.0.0/go.sum000066400000000000000000000206161444035720200150240ustar00rootroot00000000000000cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI= github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00= github.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/frankban/quicktest v1.14.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns= github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= godartsass-2.0.0/internal/000077500000000000000000000000001444035720200155005ustar00rootroot00000000000000godartsass-2.0.0/internal/embeddedsass/000077500000000000000000000000001444035720200201235ustar00rootroot00000000000000godartsass-2.0.0/internal/embeddedsass/README.md000066400000000000000000000006401444035720200214020ustar00rootroot00000000000000 * Install protobuf: https://github.com/protocolbuffers/protobuf * Install the Go plugin: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest * Download the correct version of the proto file: https://github.com/sass/sass/blob/main/spec/embedded_sass.proto * protoc --go_opt=Membedded_sass.proto=github.com/bep/godartsass/internal/embeddedsass --go_opt=paths=source_relative --go_out=. embedded_sass.proto godartsass-2.0.0/internal/embeddedsass/embedded_sass.pb.go000066400000000000000000006161731444035720200236520ustar00rootroot00000000000000// Copyright 2019 Google Inc. Use of this source code is governed by an // MIT-style license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 // protoc v4.23.2 // source: embedded_sass.proto package embeddedsass import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // Possible ways to format the CSS output. The compiler is not required to // support all possible options; if the host requests an unsupported style, the // compiler should choose the closest supported style. type OutputStyle int32 const ( // Each selector and declaration is written on its own line. OutputStyle_EXPANDED OutputStyle = 0 // The entire stylesheet is written on a single line, with as few characters // as possible. OutputStyle_COMPRESSED OutputStyle = 1 ) // Enum value maps for OutputStyle. var ( OutputStyle_name = map[int32]string{ 0: "EXPANDED", 1: "COMPRESSED", } OutputStyle_value = map[string]int32{ "EXPANDED": 0, "COMPRESSED": 1, } ) func (x OutputStyle) Enum() *OutputStyle { p := new(OutputStyle) *p = x return p } func (x OutputStyle) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (OutputStyle) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[0].Descriptor() } func (OutputStyle) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[0] } func (x OutputStyle) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use OutputStyle.Descriptor instead. func (OutputStyle) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0} } // Possible syntaxes for a Sass stylesheet. type Syntax int32 const ( // The CSS-superset `.scss` syntax. Syntax_SCSS Syntax = 0 // The indented `.sass` syntax. Syntax_INDENTED Syntax = 1 // Plain CSS syntax that doesn't support any special Sass features. Syntax_CSS Syntax = 2 ) // Enum value maps for Syntax. var ( Syntax_name = map[int32]string{ 0: "SCSS", 1: "INDENTED", 2: "CSS", } Syntax_value = map[string]int32{ "SCSS": 0, "INDENTED": 1, "CSS": 2, } ) func (x Syntax) Enum() *Syntax { p := new(Syntax) *p = x return p } func (x Syntax) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (Syntax) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[1].Descriptor() } func (Syntax) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[1] } func (x Syntax) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use Syntax.Descriptor instead. func (Syntax) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1} } // The possible types of [LogEvent]. type LogEventType int32 const ( // A warning for something other than a deprecated Sass feature. Often emitted // due to a stylesheet using the `@warn` rule. LogEventType_WARNING LogEventType = 0 // A warning indicating that the stylesheet is using a deprecated Sass // feature. Compilers should not add text like "deprecation warning" to // deprecation warnings; it's up to the host to determine how to signal that // to the user. LogEventType_DEPRECATION_WARNING LogEventType = 1 // A message generated by the user for their own debugging purposes. LogEventType_DEBUG LogEventType = 2 ) // Enum value maps for LogEventType. var ( LogEventType_name = map[int32]string{ 0: "WARNING", 1: "DEPRECATION_WARNING", 2: "DEBUG", } LogEventType_value = map[string]int32{ "WARNING": 0, "DEPRECATION_WARNING": 1, "DEBUG": 2, } ) func (x LogEventType) Enum() *LogEventType { p := new(LogEventType) *p = x return p } func (x LogEventType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (LogEventType) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[2].Descriptor() } func (LogEventType) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[2] } func (x LogEventType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use LogEventType.Descriptor instead. func (LogEventType) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{2} } // Potential types of protocol errors. type ProtocolErrorType int32 const ( // A message was received that couldn't be decoded as an `InboundMessage` (for // the compiler) or `OutboundMessage` (for the host). ProtocolErrorType_PARSE ProtocolErrorType = 0 // A message was received that violated a documented restriction, such as not // providing a mandatory field. ProtocolErrorType_PARAMS ProtocolErrorType = 1 // Something unexpected went wrong within the endpoint. ProtocolErrorType_INTERNAL ProtocolErrorType = 2 ) // Enum value maps for ProtocolErrorType. var ( ProtocolErrorType_name = map[int32]string{ 0: "PARSE", 1: "PARAMS", 2: "INTERNAL", } ProtocolErrorType_value = map[string]int32{ "PARSE": 0, "PARAMS": 1, "INTERNAL": 2, } ) func (x ProtocolErrorType) Enum() *ProtocolErrorType { p := new(ProtocolErrorType) *p = x return p } func (x ProtocolErrorType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ProtocolErrorType) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[3].Descriptor() } func (ProtocolErrorType) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[3] } func (x ProtocolErrorType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ProtocolErrorType.Descriptor instead. func (ProtocolErrorType) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{3} } // Different types of separators a list can have. type ListSeparator int32 const ( // List elements are separated by a comma. ListSeparator_COMMA ListSeparator = 0 // List elements are separated by whitespace. ListSeparator_SPACE ListSeparator = 1 // List elements are separated by a forward slash. ListSeparator_SLASH ListSeparator = 2 // The list's separator hasn't yet been determined. This is only allowed for // singleton and empty lists. // // Singleton lists and empty lists don't have separators defined. This means // that list functions will prefer other lists' separators if possible. ListSeparator_UNDECIDED ListSeparator = 3 ) // Enum value maps for ListSeparator. var ( ListSeparator_name = map[int32]string{ 0: "COMMA", 1: "SPACE", 2: "SLASH", 3: "UNDECIDED", } ListSeparator_value = map[string]int32{ "COMMA": 0, "SPACE": 1, "SLASH": 2, "UNDECIDED": 3, } ) func (x ListSeparator) Enum() *ListSeparator { p := new(ListSeparator) *p = x return p } func (x ListSeparator) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ListSeparator) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[4].Descriptor() } func (ListSeparator) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[4] } func (x ListSeparator) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ListSeparator.Descriptor instead. func (ListSeparator) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4} } // Singleton SassScript values that have no internal state. type SingletonValue int32 const ( // The SassScript boolean true value. SingletonValue_TRUE SingletonValue = 0 // The SassScript boolean false value. SingletonValue_FALSE SingletonValue = 1 // The SassScript null value. SingletonValue_NULL SingletonValue = 2 ) // Enum value maps for SingletonValue. var ( SingletonValue_name = map[int32]string{ 0: "TRUE", 1: "FALSE", 2: "NULL", } SingletonValue_value = map[string]int32{ "TRUE": 0, "FALSE": 1, "NULL": 2, } ) func (x SingletonValue) Enum() *SingletonValue { p := new(SingletonValue) *p = x return p } func (x SingletonValue) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (SingletonValue) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[5].Descriptor() } func (SingletonValue) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[5] } func (x SingletonValue) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use SingletonValue.Descriptor instead. func (SingletonValue) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{5} } // An operator used in a calculation value's operation. type CalculationOperator int32 const ( // The addition operator. CalculationOperator_PLUS CalculationOperator = 0 // The subtraction operator. CalculationOperator_MINUS CalculationOperator = 1 // The multiplication operator. CalculationOperator_TIMES CalculationOperator = 2 // The division operator. CalculationOperator_DIVIDE CalculationOperator = 3 ) // Enum value maps for CalculationOperator. var ( CalculationOperator_name = map[int32]string{ 0: "PLUS", 1: "MINUS", 2: "TIMES", 3: "DIVIDE", } CalculationOperator_value = map[string]int32{ "PLUS": 0, "MINUS": 1, "TIMES": 2, "DIVIDE": 3, } ) func (x CalculationOperator) Enum() *CalculationOperator { p := new(CalculationOperator) *p = x return p } func (x CalculationOperator) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (CalculationOperator) Descriptor() protoreflect.EnumDescriptor { return file_embedded_sass_proto_enumTypes[6].Descriptor() } func (CalculationOperator) Type() protoreflect.EnumType { return &file_embedded_sass_proto_enumTypes[6] } func (x CalculationOperator) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use CalculationOperator.Descriptor instead. func (CalculationOperator) EnumDescriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{6} } // The wrapper type for all messages sent from the host to the compiler. This // provides a `oneof` that makes it possible to determine the type of each // inbound message. type InboundMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The wrapped message. Mandatory. // // Types that are assignable to Message: // // *InboundMessage_CompileRequest_ // *InboundMessage_CanonicalizeResponse_ // *InboundMessage_ImportResponse_ // *InboundMessage_FileImportResponse_ // *InboundMessage_FunctionCallResponse_ // *InboundMessage_VersionRequest_ Message isInboundMessage_Message `protobuf_oneof:"message"` } func (x *InboundMessage) Reset() { *x = InboundMessage{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage) ProtoMessage() {} func (x *InboundMessage) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage.ProtoReflect.Descriptor instead. func (*InboundMessage) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0} } func (m *InboundMessage) GetMessage() isInboundMessage_Message { if m != nil { return m.Message } return nil } func (x *InboundMessage) GetCompileRequest() *InboundMessage_CompileRequest { if x, ok := x.GetMessage().(*InboundMessage_CompileRequest_); ok { return x.CompileRequest } return nil } func (x *InboundMessage) GetCanonicalizeResponse() *InboundMessage_CanonicalizeResponse { if x, ok := x.GetMessage().(*InboundMessage_CanonicalizeResponse_); ok { return x.CanonicalizeResponse } return nil } func (x *InboundMessage) GetImportResponse() *InboundMessage_ImportResponse { if x, ok := x.GetMessage().(*InboundMessage_ImportResponse_); ok { return x.ImportResponse } return nil } func (x *InboundMessage) GetFileImportResponse() *InboundMessage_FileImportResponse { if x, ok := x.GetMessage().(*InboundMessage_FileImportResponse_); ok { return x.FileImportResponse } return nil } func (x *InboundMessage) GetFunctionCallResponse() *InboundMessage_FunctionCallResponse { if x, ok := x.GetMessage().(*InboundMessage_FunctionCallResponse_); ok { return x.FunctionCallResponse } return nil } func (x *InboundMessage) GetVersionRequest() *InboundMessage_VersionRequest { if x, ok := x.GetMessage().(*InboundMessage_VersionRequest_); ok { return x.VersionRequest } return nil } type isInboundMessage_Message interface { isInboundMessage_Message() } type InboundMessage_CompileRequest_ struct { CompileRequest *InboundMessage_CompileRequest `protobuf:"bytes,2,opt,name=compile_request,json=compileRequest,proto3,oneof"` } type InboundMessage_CanonicalizeResponse_ struct { CanonicalizeResponse *InboundMessage_CanonicalizeResponse `protobuf:"bytes,3,opt,name=canonicalize_response,json=canonicalizeResponse,proto3,oneof"` } type InboundMessage_ImportResponse_ struct { ImportResponse *InboundMessage_ImportResponse `protobuf:"bytes,4,opt,name=import_response,json=importResponse,proto3,oneof"` } type InboundMessage_FileImportResponse_ struct { FileImportResponse *InboundMessage_FileImportResponse `protobuf:"bytes,5,opt,name=file_import_response,json=fileImportResponse,proto3,oneof"` } type InboundMessage_FunctionCallResponse_ struct { FunctionCallResponse *InboundMessage_FunctionCallResponse `protobuf:"bytes,6,opt,name=function_call_response,json=functionCallResponse,proto3,oneof"` } type InboundMessage_VersionRequest_ struct { VersionRequest *InboundMessage_VersionRequest `protobuf:"bytes,7,opt,name=version_request,json=versionRequest,proto3,oneof"` } func (*InboundMessage_CompileRequest_) isInboundMessage_Message() {} func (*InboundMessage_CanonicalizeResponse_) isInboundMessage_Message() {} func (*InboundMessage_ImportResponse_) isInboundMessage_Message() {} func (*InboundMessage_FileImportResponse_) isInboundMessage_Message() {} func (*InboundMessage_FunctionCallResponse_) isInboundMessage_Message() {} func (*InboundMessage_VersionRequest_) isInboundMessage_Message() {} // The wrapper type for all messages sent from the compiler to the host. This // provides a `oneof` that makes it possible to determine the type of each // outbound message. type OutboundMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The wrapped message. Mandatory. // // Types that are assignable to Message: // // *OutboundMessage_Error // *OutboundMessage_CompileResponse_ // *OutboundMessage_LogEvent_ // *OutboundMessage_CanonicalizeRequest_ // *OutboundMessage_ImportRequest_ // *OutboundMessage_FileImportRequest_ // *OutboundMessage_FunctionCallRequest_ // *OutboundMessage_VersionResponse_ Message isOutboundMessage_Message `protobuf_oneof:"message"` } func (x *OutboundMessage) Reset() { *x = OutboundMessage{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage) ProtoMessage() {} func (x *OutboundMessage) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage.ProtoReflect.Descriptor instead. func (*OutboundMessage) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1} } func (m *OutboundMessage) GetMessage() isOutboundMessage_Message { if m != nil { return m.Message } return nil } func (x *OutboundMessage) GetError() *ProtocolError { if x, ok := x.GetMessage().(*OutboundMessage_Error); ok { return x.Error } return nil } func (x *OutboundMessage) GetCompileResponse() *OutboundMessage_CompileResponse { if x, ok := x.GetMessage().(*OutboundMessage_CompileResponse_); ok { return x.CompileResponse } return nil } func (x *OutboundMessage) GetLogEvent() *OutboundMessage_LogEvent { if x, ok := x.GetMessage().(*OutboundMessage_LogEvent_); ok { return x.LogEvent } return nil } func (x *OutboundMessage) GetCanonicalizeRequest() *OutboundMessage_CanonicalizeRequest { if x, ok := x.GetMessage().(*OutboundMessage_CanonicalizeRequest_); ok { return x.CanonicalizeRequest } return nil } func (x *OutboundMessage) GetImportRequest() *OutboundMessage_ImportRequest { if x, ok := x.GetMessage().(*OutboundMessage_ImportRequest_); ok { return x.ImportRequest } return nil } func (x *OutboundMessage) GetFileImportRequest() *OutboundMessage_FileImportRequest { if x, ok := x.GetMessage().(*OutboundMessage_FileImportRequest_); ok { return x.FileImportRequest } return nil } func (x *OutboundMessage) GetFunctionCallRequest() *OutboundMessage_FunctionCallRequest { if x, ok := x.GetMessage().(*OutboundMessage_FunctionCallRequest_); ok { return x.FunctionCallRequest } return nil } func (x *OutboundMessage) GetVersionResponse() *OutboundMessage_VersionResponse { if x, ok := x.GetMessage().(*OutboundMessage_VersionResponse_); ok { return x.VersionResponse } return nil } type isOutboundMessage_Message interface { isOutboundMessage_Message() } type OutboundMessage_Error struct { Error *ProtocolError `protobuf:"bytes,1,opt,name=error,proto3,oneof"` } type OutboundMessage_CompileResponse_ struct { CompileResponse *OutboundMessage_CompileResponse `protobuf:"bytes,2,opt,name=compile_response,json=compileResponse,proto3,oneof"` } type OutboundMessage_LogEvent_ struct { LogEvent *OutboundMessage_LogEvent `protobuf:"bytes,3,opt,name=log_event,json=logEvent,proto3,oneof"` } type OutboundMessage_CanonicalizeRequest_ struct { CanonicalizeRequest *OutboundMessage_CanonicalizeRequest `protobuf:"bytes,4,opt,name=canonicalize_request,json=canonicalizeRequest,proto3,oneof"` } type OutboundMessage_ImportRequest_ struct { ImportRequest *OutboundMessage_ImportRequest `protobuf:"bytes,5,opt,name=import_request,json=importRequest,proto3,oneof"` } type OutboundMessage_FileImportRequest_ struct { FileImportRequest *OutboundMessage_FileImportRequest `protobuf:"bytes,6,opt,name=file_import_request,json=fileImportRequest,proto3,oneof"` } type OutboundMessage_FunctionCallRequest_ struct { FunctionCallRequest *OutboundMessage_FunctionCallRequest `protobuf:"bytes,7,opt,name=function_call_request,json=functionCallRequest,proto3,oneof"` } type OutboundMessage_VersionResponse_ struct { VersionResponse *OutboundMessage_VersionResponse `protobuf:"bytes,8,opt,name=version_response,json=versionResponse,proto3,oneof"` } func (*OutboundMessage_Error) isOutboundMessage_Message() {} func (*OutboundMessage_CompileResponse_) isOutboundMessage_Message() {} func (*OutboundMessage_LogEvent_) isOutboundMessage_Message() {} func (*OutboundMessage_CanonicalizeRequest_) isOutboundMessage_Message() {} func (*OutboundMessage_ImportRequest_) isOutboundMessage_Message() {} func (*OutboundMessage_FileImportRequest_) isOutboundMessage_Message() {} func (*OutboundMessage_FunctionCallRequest_) isOutboundMessage_Message() {} func (*OutboundMessage_VersionResponse_) isOutboundMessage_Message() {} // An error reported when an endpoint violates the embedded Sass protocol. type ProtocolError struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type ProtocolErrorType `protobuf:"varint,1,opt,name=type,proto3,enum=sass.embedded_protocol.ProtocolErrorType" json:"type,omitempty"` // The ID of the request that had an error. This MUST be `4294967295` if the // request ID couldn't be determined, or if the error is being reported for a // response or an event. Id uint32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // A human-readable message providing more detail about the error. Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` } func (x *ProtocolError) Reset() { *x = ProtocolError{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ProtocolError) String() string { return protoimpl.X.MessageStringOf(x) } func (*ProtocolError) ProtoMessage() {} func (x *ProtocolError) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ProtocolError.ProtoReflect.Descriptor instead. func (*ProtocolError) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{2} } func (x *ProtocolError) GetType() ProtocolErrorType { if x != nil { return x.Type } return ProtocolErrorType_PARSE } func (x *ProtocolError) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *ProtocolError) GetMessage() string { if x != nil { return x.Message } return "" } // A chunk of a source file. type SourceSpan struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The text covered by the source span. Compilers must guarantee that this is // the text between `start.offset` and `end.offset` in the source file // referred to by `url`. Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // The location of the first character in this span. Start *SourceSpan_SourceLocation `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"` // The location of the first character after this span. // // If this is omitted, it indicates that the span is empty and points // immediately before `start`. In that case, `text` must be empty. // // This must not point to a location before `start`. End *SourceSpan_SourceLocation `protobuf:"bytes,3,opt,name=end,proto3,oneof" json:"end,omitempty"` // The URL of the file to which this span refers. // // This may be empty, indicating that the span refers to a // `CompileRequest.StringInput` file that doesn't specify a URL. Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // Additional source text surrounding this span. // // If this isn't empty, it must contain `text`. Furthermore, `text` must begin // at column `start.column` of a line in `context`. // // This usually contains the full lines the span begins and ends on if the // span itself doesn't cover the full lines. Context string `protobuf:"bytes,5,opt,name=context,proto3" json:"context,omitempty"` } func (x *SourceSpan) Reset() { *x = SourceSpan{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SourceSpan) String() string { return protoimpl.X.MessageStringOf(x) } func (*SourceSpan) ProtoMessage() {} func (x *SourceSpan) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SourceSpan.ProtoReflect.Descriptor instead. func (*SourceSpan) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{3} } func (x *SourceSpan) GetText() string { if x != nil { return x.Text } return "" } func (x *SourceSpan) GetStart() *SourceSpan_SourceLocation { if x != nil { return x.Start } return nil } func (x *SourceSpan) GetEnd() *SourceSpan_SourceLocation { if x != nil { return x.End } return nil } func (x *SourceSpan) GetUrl() string { if x != nil { return x.Url } return "" } func (x *SourceSpan) GetContext() string { if x != nil { return x.Context } return "" } // A SassScript value, passed to and returned by functions. type Value struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The value itself. Mandatory. // // This is wrapped in a message type rather than used directly to reduce // repetition, and because oneofs can't be repeated. // // Types that are assignable to Value: // // *Value_String_ // *Value_Number_ // *Value_RgbColor_ // *Value_HslColor_ // *Value_List_ // *Value_Map_ // *Value_Singleton // *Value_CompilerFunction_ // *Value_HostFunction_ // *Value_ArgumentList_ // *Value_HwbColor_ // *Value_Calculation_ Value isValue_Value `protobuf_oneof:"value"` } func (x *Value) Reset() { *x = Value{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value) ProtoMessage() {} func (x *Value) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value.ProtoReflect.Descriptor instead. func (*Value) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4} } func (m *Value) GetValue() isValue_Value { if m != nil { return m.Value } return nil } func (x *Value) GetString_() *Value_String { if x, ok := x.GetValue().(*Value_String_); ok { return x.String_ } return nil } func (x *Value) GetNumber() *Value_Number { if x, ok := x.GetValue().(*Value_Number_); ok { return x.Number } return nil } func (x *Value) GetRgbColor() *Value_RgbColor { if x, ok := x.GetValue().(*Value_RgbColor_); ok { return x.RgbColor } return nil } func (x *Value) GetHslColor() *Value_HslColor { if x, ok := x.GetValue().(*Value_HslColor_); ok { return x.HslColor } return nil } func (x *Value) GetList() *Value_List { if x, ok := x.GetValue().(*Value_List_); ok { return x.List } return nil } func (x *Value) GetMap() *Value_Map { if x, ok := x.GetValue().(*Value_Map_); ok { return x.Map } return nil } func (x *Value) GetSingleton() SingletonValue { if x, ok := x.GetValue().(*Value_Singleton); ok { return x.Singleton } return SingletonValue_TRUE } func (x *Value) GetCompilerFunction() *Value_CompilerFunction { if x, ok := x.GetValue().(*Value_CompilerFunction_); ok { return x.CompilerFunction } return nil } func (x *Value) GetHostFunction() *Value_HostFunction { if x, ok := x.GetValue().(*Value_HostFunction_); ok { return x.HostFunction } return nil } func (x *Value) GetArgumentList() *Value_ArgumentList { if x, ok := x.GetValue().(*Value_ArgumentList_); ok { return x.ArgumentList } return nil } func (x *Value) GetHwbColor() *Value_HwbColor { if x, ok := x.GetValue().(*Value_HwbColor_); ok { return x.HwbColor } return nil } func (x *Value) GetCalculation() *Value_Calculation { if x, ok := x.GetValue().(*Value_Calculation_); ok { return x.Calculation } return nil } type isValue_Value interface { isValue_Value() } type Value_String_ struct { String_ *Value_String `protobuf:"bytes,1,opt,name=string,proto3,oneof"` } type Value_Number_ struct { Number *Value_Number `protobuf:"bytes,2,opt,name=number,proto3,oneof"` } type Value_RgbColor_ struct { RgbColor *Value_RgbColor `protobuf:"bytes,3,opt,name=rgb_color,json=rgbColor,proto3,oneof"` } type Value_HslColor_ struct { HslColor *Value_HslColor `protobuf:"bytes,4,opt,name=hsl_color,json=hslColor,proto3,oneof"` } type Value_List_ struct { List *Value_List `protobuf:"bytes,5,opt,name=list,proto3,oneof"` } type Value_Map_ struct { Map *Value_Map `protobuf:"bytes,6,opt,name=map,proto3,oneof"` } type Value_Singleton struct { Singleton SingletonValue `protobuf:"varint,7,opt,name=singleton,proto3,enum=sass.embedded_protocol.SingletonValue,oneof"` } type Value_CompilerFunction_ struct { CompilerFunction *Value_CompilerFunction `protobuf:"bytes,8,opt,name=compiler_function,json=compilerFunction,proto3,oneof"` } type Value_HostFunction_ struct { HostFunction *Value_HostFunction `protobuf:"bytes,9,opt,name=host_function,json=hostFunction,proto3,oneof"` } type Value_ArgumentList_ struct { ArgumentList *Value_ArgumentList `protobuf:"bytes,10,opt,name=argument_list,json=argumentList,proto3,oneof"` } type Value_HwbColor_ struct { HwbColor *Value_HwbColor `protobuf:"bytes,11,opt,name=hwb_color,json=hwbColor,proto3,oneof"` } type Value_Calculation_ struct { Calculation *Value_Calculation `protobuf:"bytes,12,opt,name=calculation,proto3,oneof"` } func (*Value_String_) isValue_Value() {} func (*Value_Number_) isValue_Value() {} func (*Value_RgbColor_) isValue_Value() {} func (*Value_HslColor_) isValue_Value() {} func (*Value_List_) isValue_Value() {} func (*Value_Map_) isValue_Value() {} func (*Value_Singleton) isValue_Value() {} func (*Value_CompilerFunction_) isValue_Value() {} func (*Value_HostFunction_) isValue_Value() {} func (*Value_ArgumentList_) isValue_Value() {} func (*Value_HwbColor_) isValue_Value() {} func (*Value_Calculation_) isValue_Value() {} // A request for information about the version of the embedded compiler. The // host can use this to provide diagnostic information to the user, to check // which features the compiler supports, or to ensure that it's compatible // with the same protocol version the compiler supports. type InboundMessage_VersionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // This version request's id. Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *InboundMessage_VersionRequest) Reset() { *x = InboundMessage_VersionRequest{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_VersionRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_VersionRequest) ProtoMessage() {} func (x *InboundMessage_VersionRequest) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_VersionRequest.ProtoReflect.Descriptor instead. func (*InboundMessage_VersionRequest) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 0} } func (x *InboundMessage_VersionRequest) GetId() uint32 { if x != nil { return x.Id } return 0 } // A request that compiles an entrypoint to CSS. type InboundMessage_CompileRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The input stylesheet to parse. Mandatory. // // Types that are assignable to Input: // // *InboundMessage_CompileRequest_String_ // *InboundMessage_CompileRequest_Path Input isInboundMessage_CompileRequest_Input `protobuf_oneof:"input"` // How to format the CSS output. Style OutputStyle `protobuf:"varint,4,opt,name=style,proto3,enum=sass.embedded_protocol.OutputStyle" json:"style,omitempty"` // Whether to generate a source map. Note that this will *not* add a source // map comment to the stylesheet; that's up to the host or its users. SourceMap bool `protobuf:"varint,5,opt,name=source_map,json=sourceMap,proto3" json:"source_map,omitempty"` // Importers (including load paths on the filesystem) to use when resolving // imports that can't be resolved relative to the file that contains it. Each // importer is checked in order until one recognizes the imported URL. Importers []*InboundMessage_CompileRequest_Importer `protobuf:"bytes,6,rep,name=importers,proto3" json:"importers,omitempty"` // Signatures for custom global functions whose behavior is defined by the // host. // // If this is not a valid Sass function signature that could appear after // `@function` in a Sass stylesheet (such as `mix($color1, $color2, $weight: // 50%)`), or if it conflicts with a function name that's built into the // Sass language, the compiler must treat the compilation as failed. // // Compilers must ensure that pure-Sass functions take precedence over // custom global functions. GlobalFunctions []string `protobuf:"bytes,7,rep,name=global_functions,json=globalFunctions,proto3" json:"global_functions,omitempty"` // Whether to use terminal colors in the formatted message of errors and // logs. AlertColor bool `protobuf:"varint,8,opt,name=alert_color,json=alertColor,proto3" json:"alert_color,omitempty"` // Whether to encode the formatted message of errors and logs in ASCII. AlertAscii bool `protobuf:"varint,9,opt,name=alert_ascii,json=alertAscii,proto3" json:"alert_ascii,omitempty"` // Whether to report all deprecation warnings or only the first few ones. // If this is `false`, the compiler may choose not to send events for // repeated deprecation warnings. If this is `true`, the compiler must emit // an event for every deprecation warning it encounters. Verbose bool `protobuf:"varint,10,opt,name=verbose,proto3" json:"verbose,omitempty"` // Whether to omit events for deprecation warnings coming from dependencies // (files loaded from a different importer than the input). QuietDeps bool `protobuf:"varint,11,opt,name=quiet_deps,json=quietDeps,proto3" json:"quiet_deps,omitempty"` // Whether to include sources in the generated sourcemap SourceMapIncludeSources bool `protobuf:"varint,12,opt,name=source_map_include_sources,json=sourceMapIncludeSources,proto3" json:"source_map_include_sources,omitempty"` // Whether to emit a `@charset`/BOM for non-ASCII stylesheets. Charset bool `protobuf:"varint,13,opt,name=charset,proto3" json:"charset,omitempty"` } func (x *InboundMessage_CompileRequest) Reset() { *x = InboundMessage_CompileRequest{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_CompileRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_CompileRequest) ProtoMessage() {} func (x *InboundMessage_CompileRequest) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_CompileRequest.ProtoReflect.Descriptor instead. func (*InboundMessage_CompileRequest) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 1} } func (m *InboundMessage_CompileRequest) GetInput() isInboundMessage_CompileRequest_Input { if m != nil { return m.Input } return nil } func (x *InboundMessage_CompileRequest) GetString_() *InboundMessage_CompileRequest_StringInput { if x, ok := x.GetInput().(*InboundMessage_CompileRequest_String_); ok { return x.String_ } return nil } func (x *InboundMessage_CompileRequest) GetPath() string { if x, ok := x.GetInput().(*InboundMessage_CompileRequest_Path); ok { return x.Path } return "" } func (x *InboundMessage_CompileRequest) GetStyle() OutputStyle { if x != nil { return x.Style } return OutputStyle_EXPANDED } func (x *InboundMessage_CompileRequest) GetSourceMap() bool { if x != nil { return x.SourceMap } return false } func (x *InboundMessage_CompileRequest) GetImporters() []*InboundMessage_CompileRequest_Importer { if x != nil { return x.Importers } return nil } func (x *InboundMessage_CompileRequest) GetGlobalFunctions() []string { if x != nil { return x.GlobalFunctions } return nil } func (x *InboundMessage_CompileRequest) GetAlertColor() bool { if x != nil { return x.AlertColor } return false } func (x *InboundMessage_CompileRequest) GetAlertAscii() bool { if x != nil { return x.AlertAscii } return false } func (x *InboundMessage_CompileRequest) GetVerbose() bool { if x != nil { return x.Verbose } return false } func (x *InboundMessage_CompileRequest) GetQuietDeps() bool { if x != nil { return x.QuietDeps } return false } func (x *InboundMessage_CompileRequest) GetSourceMapIncludeSources() bool { if x != nil { return x.SourceMapIncludeSources } return false } func (x *InboundMessage_CompileRequest) GetCharset() bool { if x != nil { return x.Charset } return false } type isInboundMessage_CompileRequest_Input interface { isInboundMessage_CompileRequest_Input() } type InboundMessage_CompileRequest_String_ struct { // A stylesheet loaded from its contents. String_ *InboundMessage_CompileRequest_StringInput `protobuf:"bytes,2,opt,name=string,proto3,oneof"` } type InboundMessage_CompileRequest_Path struct { // A stylesheet loaded from the given path on the filesystem. Path string `protobuf:"bytes,3,opt,name=path,proto3,oneof"` } func (*InboundMessage_CompileRequest_String_) isInboundMessage_CompileRequest_Input() {} func (*InboundMessage_CompileRequest_Path) isInboundMessage_CompileRequest_Input() {} // A response indicating the result of canonicalizing an imported URL. type InboundMessage_CanonicalizeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The result of canonicalization. If this is unset, it indicates that the // importer either did not recognize the URL, or could not find a stylesheet // at the location it referred to. Optional. // // Types that are assignable to Result: // // *InboundMessage_CanonicalizeResponse_Url // *InboundMessage_CanonicalizeResponse_Error Result isInboundMessage_CanonicalizeResponse_Result `protobuf_oneof:"result"` } func (x *InboundMessage_CanonicalizeResponse) Reset() { *x = InboundMessage_CanonicalizeResponse{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_CanonicalizeResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_CanonicalizeResponse) ProtoMessage() {} func (x *InboundMessage_CanonicalizeResponse) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_CanonicalizeResponse.ProtoReflect.Descriptor instead. func (*InboundMessage_CanonicalizeResponse) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 2} } func (x *InboundMessage_CanonicalizeResponse) GetId() uint32 { if x != nil { return x.Id } return 0 } func (m *InboundMessage_CanonicalizeResponse) GetResult() isInboundMessage_CanonicalizeResponse_Result { if m != nil { return m.Result } return nil } func (x *InboundMessage_CanonicalizeResponse) GetUrl() string { if x, ok := x.GetResult().(*InboundMessage_CanonicalizeResponse_Url); ok { return x.Url } return "" } func (x *InboundMessage_CanonicalizeResponse) GetError() string { if x, ok := x.GetResult().(*InboundMessage_CanonicalizeResponse_Error); ok { return x.Error } return "" } type isInboundMessage_CanonicalizeResponse_Result interface { isInboundMessage_CanonicalizeResponse_Result() } type InboundMessage_CanonicalizeResponse_Url struct { // The successfully canonicalized URL. // // If this is not an absolute URL (including scheme), the compiler must // treat that as an error thrown by the importer. Url string `protobuf:"bytes,2,opt,name=url,proto3,oneof"` } type InboundMessage_CanonicalizeResponse_Error struct { // An error message explaining why canonicalization failed. // // This indicates that a stylesheet was found, but a canonical URL for it // could not be determined. If no stylesheet was found, `result` should be // `null` instead. Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"` } func (*InboundMessage_CanonicalizeResponse_Url) isInboundMessage_CanonicalizeResponse_Result() {} func (*InboundMessage_CanonicalizeResponse_Error) isInboundMessage_CanonicalizeResponse_Result() {} // A response indicating the result of importing a canonical URL. type InboundMessage_ImportResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The result of loading the URL. If this is unset, it indicates that the // importer either did not recognize the URL, or could not find a stylesheet // at the location it referred to. Optional. // // Types that are assignable to Result: // // *InboundMessage_ImportResponse_Success // *InboundMessage_ImportResponse_Error Result isInboundMessage_ImportResponse_Result `protobuf_oneof:"result"` } func (x *InboundMessage_ImportResponse) Reset() { *x = InboundMessage_ImportResponse{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_ImportResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_ImportResponse) ProtoMessage() {} func (x *InboundMessage_ImportResponse) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_ImportResponse.ProtoReflect.Descriptor instead. func (*InboundMessage_ImportResponse) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 3} } func (x *InboundMessage_ImportResponse) GetId() uint32 { if x != nil { return x.Id } return 0 } func (m *InboundMessage_ImportResponse) GetResult() isInboundMessage_ImportResponse_Result { if m != nil { return m.Result } return nil } func (x *InboundMessage_ImportResponse) GetSuccess() *InboundMessage_ImportResponse_ImportSuccess { if x, ok := x.GetResult().(*InboundMessage_ImportResponse_Success); ok { return x.Success } return nil } func (x *InboundMessage_ImportResponse) GetError() string { if x, ok := x.GetResult().(*InboundMessage_ImportResponse_Error); ok { return x.Error } return "" } type isInboundMessage_ImportResponse_Result interface { isInboundMessage_ImportResponse_Result() } type InboundMessage_ImportResponse_Success struct { // The contents of the loaded stylesheet. Success *InboundMessage_ImportResponse_ImportSuccess `protobuf:"bytes,2,opt,name=success,proto3,oneof"` } type InboundMessage_ImportResponse_Error struct { // An error message explaining why the URL could not be loaded. Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"` } func (*InboundMessage_ImportResponse_Success) isInboundMessage_ImportResponse_Result() {} func (*InboundMessage_ImportResponse_Error) isInboundMessage_ImportResponse_Result() {} // A response indicating the result of redirecting a URL to the filesystem. type InboundMessage_FileImportResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The result of loading the URL. An unset result indicates that the // importer did not recognize the URL and other importers or load paths // should be tried. Optional. // // Types that are assignable to Result: // // *InboundMessage_FileImportResponse_FileUrl // *InboundMessage_FileImportResponse_Error Result isInboundMessage_FileImportResponse_Result `protobuf_oneof:"result"` } func (x *InboundMessage_FileImportResponse) Reset() { *x = InboundMessage_FileImportResponse{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_FileImportResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_FileImportResponse) ProtoMessage() {} func (x *InboundMessage_FileImportResponse) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_FileImportResponse.ProtoReflect.Descriptor instead. func (*InboundMessage_FileImportResponse) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 4} } func (x *InboundMessage_FileImportResponse) GetId() uint32 { if x != nil { return x.Id } return 0 } func (m *InboundMessage_FileImportResponse) GetResult() isInboundMessage_FileImportResponse_Result { if m != nil { return m.Result } return nil } func (x *InboundMessage_FileImportResponse) GetFileUrl() string { if x, ok := x.GetResult().(*InboundMessage_FileImportResponse_FileUrl); ok { return x.FileUrl } return "" } func (x *InboundMessage_FileImportResponse) GetError() string { if x, ok := x.GetResult().(*InboundMessage_FileImportResponse_Error); ok { return x.Error } return "" } type isInboundMessage_FileImportResponse_Result interface { isInboundMessage_FileImportResponse_Result() } type InboundMessage_FileImportResponse_FileUrl struct { // The absolute `file:` URL to look for the file on the physical // filesystem. // // The compiler must verify to the best of its ability that this URL // follows the format for an absolute `file:` URL on the current operating // system without a hostname. If it doesn't, the compiler must treat that // as an error thrown by the importer. See // https://en.wikipedia.org/wiki/File_URI_scheme for details on the // format. // // The compiler must handle turning this into a canonical URL by resolving // it for partials, file extensions, and index files. The compiler must // then loading the contents of the resulting canonical URL from the // filesystem. FileUrl string `protobuf:"bytes,2,opt,name=file_url,json=fileUrl,proto3,oneof"` } type InboundMessage_FileImportResponse_Error struct { // An error message explaining why the URL could not be loaded. Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"` } func (*InboundMessage_FileImportResponse_FileUrl) isInboundMessage_FileImportResponse_Result() {} func (*InboundMessage_FileImportResponse_Error) isInboundMessage_FileImportResponse_Result() {} // A response indicating the result of calling a custom Sass function defined // in the host. type InboundMessage_FunctionCallResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The result of calling the function. Mandatory. // // Types that are assignable to Result: // // *InboundMessage_FunctionCallResponse_Success // *InboundMessage_FunctionCallResponse_Error Result isInboundMessage_FunctionCallResponse_Result `protobuf_oneof:"result"` // The IDs of all `Value.ArgumentList`s in `FunctionCallRequest.arguments` // whose keywords were accessed. See `Value.ArgumentList` for details. This // may not include the special value `0` and it may not include multiple // instances of the same ID. AccessedArgumentLists []uint32 `protobuf:"varint,4,rep,packed,name=accessed_argument_lists,json=accessedArgumentLists,proto3" json:"accessed_argument_lists,omitempty"` } func (x *InboundMessage_FunctionCallResponse) Reset() { *x = InboundMessage_FunctionCallResponse{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_FunctionCallResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_FunctionCallResponse) ProtoMessage() {} func (x *InboundMessage_FunctionCallResponse) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_FunctionCallResponse.ProtoReflect.Descriptor instead. func (*InboundMessage_FunctionCallResponse) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 5} } func (x *InboundMessage_FunctionCallResponse) GetId() uint32 { if x != nil { return x.Id } return 0 } func (m *InboundMessage_FunctionCallResponse) GetResult() isInboundMessage_FunctionCallResponse_Result { if m != nil { return m.Result } return nil } func (x *InboundMessage_FunctionCallResponse) GetSuccess() *Value { if x, ok := x.GetResult().(*InboundMessage_FunctionCallResponse_Success); ok { return x.Success } return nil } func (x *InboundMessage_FunctionCallResponse) GetError() string { if x, ok := x.GetResult().(*InboundMessage_FunctionCallResponse_Error); ok { return x.Error } return "" } func (x *InboundMessage_FunctionCallResponse) GetAccessedArgumentLists() []uint32 { if x != nil { return x.AccessedArgumentLists } return nil } type isInboundMessage_FunctionCallResponse_Result interface { isInboundMessage_FunctionCallResponse_Result() } type InboundMessage_FunctionCallResponse_Success struct { // The return value of a successful function call. Success *Value `protobuf:"bytes,2,opt,name=success,proto3,oneof"` } type InboundMessage_FunctionCallResponse_Error struct { // An error message explaining why the function call failed. Error string `protobuf:"bytes,3,opt,name=error,proto3,oneof"` } func (*InboundMessage_FunctionCallResponse_Success) isInboundMessage_FunctionCallResponse_Result() {} func (*InboundMessage_FunctionCallResponse_Error) isInboundMessage_FunctionCallResponse_Result() {} // An input stylesheet provided as plain text, rather than loaded from the // filesystem. type InboundMessage_CompileRequest_StringInput struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The contents of the stylesheet. Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` // The location from which `source` was loaded. If this is empty, it // indicates that the URL is unknown. // // This must be a canonical URL recognized by `importer`, if it's passed. Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // The syntax to use to parse `source`. Syntax Syntax `protobuf:"varint,3,opt,name=syntax,proto3,enum=sass.embedded_protocol.Syntax" json:"syntax,omitempty"` // The importer to use to resolve imports relative to `url`. Importer *InboundMessage_CompileRequest_Importer `protobuf:"bytes,4,opt,name=importer,proto3" json:"importer,omitempty"` } func (x *InboundMessage_CompileRequest_StringInput) Reset() { *x = InboundMessage_CompileRequest_StringInput{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_CompileRequest_StringInput) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_CompileRequest_StringInput) ProtoMessage() {} func (x *InboundMessage_CompileRequest_StringInput) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_CompileRequest_StringInput.ProtoReflect.Descriptor instead. func (*InboundMessage_CompileRequest_StringInput) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 1, 0} } func (x *InboundMessage_CompileRequest_StringInput) GetSource() string { if x != nil { return x.Source } return "" } func (x *InboundMessage_CompileRequest_StringInput) GetUrl() string { if x != nil { return x.Url } return "" } func (x *InboundMessage_CompileRequest_StringInput) GetSyntax() Syntax { if x != nil { return x.Syntax } return Syntax_SCSS } func (x *InboundMessage_CompileRequest_StringInput) GetImporter() *InboundMessage_CompileRequest_Importer { if x != nil { return x.Importer } return nil } // A wrapper message that represents either a user-defined importer or a // load path on disk. This must be a wrapper because `oneof` types can't be // `repeated`. type InboundMessage_CompileRequest_Importer struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The possible types of importer. Mandatory. // // Types that are assignable to Importer: // // *InboundMessage_CompileRequest_Importer_Path // *InboundMessage_CompileRequest_Importer_ImporterId // *InboundMessage_CompileRequest_Importer_FileImporterId Importer isInboundMessage_CompileRequest_Importer_Importer `protobuf_oneof:"importer"` } func (x *InboundMessage_CompileRequest_Importer) Reset() { *x = InboundMessage_CompileRequest_Importer{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_CompileRequest_Importer) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_CompileRequest_Importer) ProtoMessage() {} func (x *InboundMessage_CompileRequest_Importer) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_CompileRequest_Importer.ProtoReflect.Descriptor instead. func (*InboundMessage_CompileRequest_Importer) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 1, 1} } func (m *InboundMessage_CompileRequest_Importer) GetImporter() isInboundMessage_CompileRequest_Importer_Importer { if m != nil { return m.Importer } return nil } func (x *InboundMessage_CompileRequest_Importer) GetPath() string { if x, ok := x.GetImporter().(*InboundMessage_CompileRequest_Importer_Path); ok { return x.Path } return "" } func (x *InboundMessage_CompileRequest_Importer) GetImporterId() uint32 { if x, ok := x.GetImporter().(*InboundMessage_CompileRequest_Importer_ImporterId); ok { return x.ImporterId } return 0 } func (x *InboundMessage_CompileRequest_Importer) GetFileImporterId() uint32 { if x, ok := x.GetImporter().(*InboundMessage_CompileRequest_Importer_FileImporterId); ok { return x.FileImporterId } return 0 } type isInboundMessage_CompileRequest_Importer_Importer interface { isInboundMessage_CompileRequest_Importer_Importer() } type InboundMessage_CompileRequest_Importer_Path struct { // A built-in importer that loads Sass files within the given directory // on disk. Path string `protobuf:"bytes,1,opt,name=path,proto3,oneof"` } type InboundMessage_CompileRequest_Importer_ImporterId struct { // A unique ID for a user-defined importer. This ID will be included in // outbound `CanonicalizeRequest` and `ImportRequest` messages to // indicate which importer is being called. The host is responsible for // generating this ID and ensuring that it's unique across all // importers registered for this compilation. ImporterId uint32 `protobuf:"varint,2,opt,name=importer_id,json=importerId,proto3,oneof"` } type InboundMessage_CompileRequest_Importer_FileImporterId struct { // A unique ID for a special kind of user-defined importer that tells // the compiler where to look for files on the physical filesystem, but // leaves the details of resolving partials and extensions and loading // the file from disk up to the compiler itself. // // This ID will be included in outbound `FileImportRequest` messages to // indicate which importer is being called. The host is responsible for // generating this ID and ensuring that it's unique across all importers // registered for this compilation. FileImporterId uint32 `protobuf:"varint,3,opt,name=file_importer_id,json=fileImporterId,proto3,oneof"` } func (*InboundMessage_CompileRequest_Importer_Path) isInboundMessage_CompileRequest_Importer_Importer() { } func (*InboundMessage_CompileRequest_Importer_ImporterId) isInboundMessage_CompileRequest_Importer_Importer() { } func (*InboundMessage_CompileRequest_Importer_FileImporterId) isInboundMessage_CompileRequest_Importer_Importer() { } // The stylesheet's contents were loaded successfully. type InboundMessage_ImportResponse_ImportSuccess struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The text of the stylesheet. Contents string `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"` // The syntax of `contents`. Syntax Syntax `protobuf:"varint,2,opt,name=syntax,proto3,enum=sass.embedded_protocol.Syntax" json:"syntax,omitempty"` // An absolute, browser-accessible URL indicating the resolved location of // the imported stylesheet. // // This should be a `file:` URL if one is available, but an `http:` URL is // acceptable as well. If no URL is supplied, a `data:` URL is generated // automatically from `contents`. // // If this is provided and is not an absolute URL (including scheme) the // compiler must treat that as an error thrown by the importer. SourceMapUrl *string `protobuf:"bytes,3,opt,name=source_map_url,json=sourceMapUrl,proto3,oneof" json:"source_map_url,omitempty"` } func (x *InboundMessage_ImportResponse_ImportSuccess) Reset() { *x = InboundMessage_ImportResponse_ImportSuccess{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *InboundMessage_ImportResponse_ImportSuccess) String() string { return protoimpl.X.MessageStringOf(x) } func (*InboundMessage_ImportResponse_ImportSuccess) ProtoMessage() {} func (x *InboundMessage_ImportResponse_ImportSuccess) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use InboundMessage_ImportResponse_ImportSuccess.ProtoReflect.Descriptor instead. func (*InboundMessage_ImportResponse_ImportSuccess) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{0, 3, 0} } func (x *InboundMessage_ImportResponse_ImportSuccess) GetContents() string { if x != nil { return x.Contents } return "" } func (x *InboundMessage_ImportResponse_ImportSuccess) GetSyntax() Syntax { if x != nil { return x.Syntax } return Syntax_SCSS } func (x *InboundMessage_ImportResponse_ImportSuccess) GetSourceMapUrl() string { if x != nil && x.SourceMapUrl != nil { return *x.SourceMapUrl } return "" } // A response that contains the version of the embedded compiler. type OutboundMessage_VersionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // This version request's id. Id uint32 `protobuf:"varint,5,opt,name=id,proto3" json:"id,omitempty"` // The version of the embedded protocol, in semver format. ProtocolVersion string `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // The version of the embedded compiler package. This has no guaranteed // format, although compilers are encouraged to use semver. CompilerVersion string `protobuf:"bytes,2,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` // The version of the Sass implementation that the embedded compiler wraps. // This has no guaranteed format, although Sass implementations are // encouraged to use semver. ImplementationVersion string `protobuf:"bytes,3,opt,name=implementation_version,json=implementationVersion,proto3" json:"implementation_version,omitempty"` // The name of the Sass implementation that the embedded compiler wraps. ImplementationName string `protobuf:"bytes,4,opt,name=implementation_name,json=implementationName,proto3" json:"implementation_name,omitempty"` } func (x *OutboundMessage_VersionResponse) Reset() { *x = OutboundMessage_VersionResponse{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_VersionResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_VersionResponse) ProtoMessage() {} func (x *OutboundMessage_VersionResponse) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_VersionResponse.ProtoReflect.Descriptor instead. func (*OutboundMessage_VersionResponse) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 0} } func (x *OutboundMessage_VersionResponse) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *OutboundMessage_VersionResponse) GetProtocolVersion() string { if x != nil { return x.ProtocolVersion } return "" } func (x *OutboundMessage_VersionResponse) GetCompilerVersion() string { if x != nil { return x.CompilerVersion } return "" } func (x *OutboundMessage_VersionResponse) GetImplementationVersion() string { if x != nil { return x.ImplementationVersion } return "" } func (x *OutboundMessage_VersionResponse) GetImplementationName() string { if x != nil { return x.ImplementationName } return "" } // A response that contains the result of a compilation. type OutboundMessage_CompileResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The success or failure result of the compilation. Mandatory. // // Types that are assignable to Result: // // *OutboundMessage_CompileResponse_Success // *OutboundMessage_CompileResponse_Failure Result isOutboundMessage_CompileResponse_Result `protobuf_oneof:"result"` // The canonical URLs of all source files loaded during the compilation. // // The compiler must ensure that each canonical URL appears only once in // this list. This must include the entrypoint file's URL if either // `CompileRequest.input.path` or `CompileRequest.StringInput.url` was // passed. LoadedUrls []string `protobuf:"bytes,4,rep,name=loaded_urls,json=loadedUrls,proto3" json:"loaded_urls,omitempty"` } func (x *OutboundMessage_CompileResponse) Reset() { *x = OutboundMessage_CompileResponse{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_CompileResponse) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_CompileResponse) ProtoMessage() {} func (x *OutboundMessage_CompileResponse) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_CompileResponse.ProtoReflect.Descriptor instead. func (*OutboundMessage_CompileResponse) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 1} } func (m *OutboundMessage_CompileResponse) GetResult() isOutboundMessage_CompileResponse_Result { if m != nil { return m.Result } return nil } func (x *OutboundMessage_CompileResponse) GetSuccess() *OutboundMessage_CompileResponse_CompileSuccess { if x, ok := x.GetResult().(*OutboundMessage_CompileResponse_Success); ok { return x.Success } return nil } func (x *OutboundMessage_CompileResponse) GetFailure() *OutboundMessage_CompileResponse_CompileFailure { if x, ok := x.GetResult().(*OutboundMessage_CompileResponse_Failure); ok { return x.Failure } return nil } func (x *OutboundMessage_CompileResponse) GetLoadedUrls() []string { if x != nil { return x.LoadedUrls } return nil } type isOutboundMessage_CompileResponse_Result interface { isOutboundMessage_CompileResponse_Result() } type OutboundMessage_CompileResponse_Success struct { // The result of a successful compilation. Success *OutboundMessage_CompileResponse_CompileSuccess `protobuf:"bytes,2,opt,name=success,proto3,oneof"` } type OutboundMessage_CompileResponse_Failure struct { // The result of a failed compilation. Failure *OutboundMessage_CompileResponse_CompileFailure `protobuf:"bytes,3,opt,name=failure,proto3,oneof"` } func (*OutboundMessage_CompileResponse_Success) isOutboundMessage_CompileResponse_Result() {} func (*OutboundMessage_CompileResponse_Failure) isOutboundMessage_CompileResponse_Result() {} // An event indicating that a message should be displayed to the user. type OutboundMessage_LogEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Type LogEventType `protobuf:"varint,2,opt,name=type,proto3,enum=sass.embedded_protocol.LogEventType" json:"type,omitempty"` // The text of the message. Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // The span associated with this message. Span *SourceSpan `protobuf:"bytes,4,opt,name=span,proto3,oneof" json:"span,omitempty"` // The stack trace associated with this message. // // The empty string indicates that no stack trace is available. Otherwise, // the format of this stack trace is not specified and is likely to be // inconsistent between implementations. StackTrace string `protobuf:"bytes,5,opt,name=stack_trace,json=stackTrace,proto3" json:"stack_trace,omitempty"` // A formatted, human-readable string that contains the message, span (if // available), and trace (if available). The format of this string is not // specified and is likely to be inconsistent between implementations. Formatted string `protobuf:"bytes,6,opt,name=formatted,proto3" json:"formatted,omitempty"` } func (x *OutboundMessage_LogEvent) Reset() { *x = OutboundMessage_LogEvent{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_LogEvent) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_LogEvent) ProtoMessage() {} func (x *OutboundMessage_LogEvent) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_LogEvent.ProtoReflect.Descriptor instead. func (*OutboundMessage_LogEvent) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 2} } func (x *OutboundMessage_LogEvent) GetType() LogEventType { if x != nil { return x.Type } return LogEventType_WARNING } func (x *OutboundMessage_LogEvent) GetMessage() string { if x != nil { return x.Message } return "" } func (x *OutboundMessage_LogEvent) GetSpan() *SourceSpan { if x != nil { return x.Span } return nil } func (x *OutboundMessage_LogEvent) GetStackTrace() string { if x != nil { return x.StackTrace } return "" } func (x *OutboundMessage_LogEvent) GetFormatted() string { if x != nil { return x.Formatted } return "" } // A request for a custom importer to convert an imported URL to its canonical // format. // // If the URL is not recognized by this importer, or if no stylesheet is found // at that URL, `CanonicalizeResponse.result` must be `null`. Otherwise, the // importer must return an absolute URL, including a scheme. // // > The host's documentation should encourage the use of file importers (via // > `CompileRequest.Importer.file_importer_id`, `FileImportRequest`, and // > `FileImportResponse`) for any importers that simply refer to files on // > disk. This will allow Sass to handle the logic of resolving partials, // > file extensions, and index files. // // If Sass has already loaded a stylesheet with the returned canonical URL, it // re-uses the existing parse tree. This means that importers must ensure that // the same canonical URL always refers to the same stylesheet, *even across // different importers*. Importers must also ensure that any canonicalized // URLs they return can be passed back to `CanonicalizeRequest` and will be // returned unchanged. // // If this importer's URL format supports file extensions, it should // canonicalize them the same way as the default filesystem importer: // // - The importer should look for stylesheets by adding the prefix `_` to the // URL's basename, and by adding the extensions `.sass` and `.scss` if the // URL doesn't already have one of those extensions. For example, if the URL // was `foo/bar/baz`, the importer would look for: // // - `foo/bar/baz.sass` // // - `foo/bar/baz.scss` // // - `foo/bar/_baz.sass` // // - `foo/bar/_baz.scss` // // If the URL was foo/bar/baz.scss, the importer would just look for: // // - `foo/bar/baz.scss` // // - `foo/bar/_baz.scss` // // If the importer finds a stylesheet at more than one of these URLs, it // should respond with a `CanonicalizeResponse.result.error` indicating that // the import is ambiguous. Note that if the extension is explicitly // specified, a stylesheet with another extension may exist without error. // // - If none of the possible paths is valid, the importer should perform the // same resolution on the URL followed by `/index`. In the example above, it // would look for: // // - `foo/bar/baz/_index.sass` // // - `foo/bar/baz/index.sass` // // - `foo/bar/baz/_index.scss` // // - `foo/bar/baz/index.scss` // // As above, if the importer finds a stylesheet at more than one of these // URLs, it should respond with a `CanonicalizeResponse.result.error` // indicating that the import is ambiguous. type OutboundMessage_CanonicalizeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The unique ID of the importer being invoked. This must match an importer // ID passed to this compilation in `CompileRequest.importers` or // `CompileRequest.input.string.importer`. ImporterId uint32 `protobuf:"varint,3,opt,name=importer_id,json=importerId,proto3" json:"importer_id,omitempty"` // The URL of the import to be canonicalized. This may be either absolute or // relative. // // When loading a URL, the compiler must first try resolving that URL // relative to the canonical URL of the current file, and canonicalizing the // result using the importer that loaded the current file. If this returns // `null`, the compiler must then try canonicalizing the original URL with // each importer in order until one returns something other than `null`. // That is the result of the import. Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // / Whether this request comes from an `@import` rule. // / // / When evaluating `@import` rules, URLs should canonicalize to an // / [import-only file] if one exists for the URL being canonicalized. // / Otherwise, canonicalization should be identical for `@import` and `@use` // / rules. // / // / [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files FromImport bool `protobuf:"varint,5,opt,name=from_import,json=fromImport,proto3" json:"from_import,omitempty"` } func (x *OutboundMessage_CanonicalizeRequest) Reset() { *x = OutboundMessage_CanonicalizeRequest{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_CanonicalizeRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_CanonicalizeRequest) ProtoMessage() {} func (x *OutboundMessage_CanonicalizeRequest) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_CanonicalizeRequest.ProtoReflect.Descriptor instead. func (*OutboundMessage_CanonicalizeRequest) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 3} } func (x *OutboundMessage_CanonicalizeRequest) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *OutboundMessage_CanonicalizeRequest) GetImporterId() uint32 { if x != nil { return x.ImporterId } return 0 } func (x *OutboundMessage_CanonicalizeRequest) GetUrl() string { if x != nil { return x.Url } return "" } func (x *OutboundMessage_CanonicalizeRequest) GetFromImport() bool { if x != nil { return x.FromImport } return false } // A request for a custom importer to load the contents of a stylesheet. type OutboundMessage_ImportRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The unique ID of the importer being invoked. This must match an // `Importer.importer_id` passed to this compilation in // `CompileRequest.importers` or `CompileRequest.input.string.importer`. ImporterId uint32 `protobuf:"varint,3,opt,name=importer_id,json=importerId,proto3" json:"importer_id,omitempty"` // The canonical URL of the import. This is guaranteed to be a URL returned // by a `CanonicalizeRequest` to this importer. Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` } func (x *OutboundMessage_ImportRequest) Reset() { *x = OutboundMessage_ImportRequest{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_ImportRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_ImportRequest) ProtoMessage() {} func (x *OutboundMessage_ImportRequest) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_ImportRequest.ProtoReflect.Descriptor instead. func (*OutboundMessage_ImportRequest) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 4} } func (x *OutboundMessage_ImportRequest) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *OutboundMessage_ImportRequest) GetImporterId() uint32 { if x != nil { return x.ImporterId } return 0 } func (x *OutboundMessage_ImportRequest) GetUrl() string { if x != nil { return x.Url } return "" } // A request for a custom filesystem importer to load the contents of a // stylesheet. // // A filesystem importer is represented in the compiler as an [importer]. When // the importer is invoked with a string `string`: // // * If `string` is an absolute URL whose scheme is `file`: // // - Let `url` be string. // // * Otherwise: // // - Let `fromImport` be `true` if the importer is being run for an // `@import` and `false` otherwise. // // - Let `response` be the result of sending a `FileImportRequest` with // `string` as its `url` and `fromImport` as `from_import`. // // - If `response.result` is null, return null. // // - Otherwise, if `response.result.error` is set, throw an error. // // - Otherwise, let `url` be `response.result.file_url`. // // * Let `resolved` be the result of [resolving `url`]. // // * If `resolved` is null, return null. // // * Let `text` be the contents of the file at `resolved`. // // * Let `syntax` be: // // - "scss" if `url` ends in `.scss`. // // - "indented" if `url` ends in `.sass`. // // - "css" if `url` ends in `.css`. // // > The algorithm for resolving a `file:` URL guarantees that `url` will have // > one of these extensions. // // * Return `text`, `syntax`, and `resolved`. // // [importer]: https://github.com/sass/sass/tree/main/spec/modules.md#importer // [resolving `url`]: https://github.com/sass/sass/tree/main/spec/modules.md#resolving-a-file-url type OutboundMessage_FileImportRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The unique ID of the importer being invoked. This must match an // `Importer.file_importer_id` passed to this compilation in // `CompileRequest.importers` or `CompileRequest.input.string.importer`. ImporterId uint32 `protobuf:"varint,3,opt,name=importer_id,json=importerId,proto3" json:"importer_id,omitempty"` // The (non-canonicalized) URL of the import. Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // / Whether this request comes from an `@import` rule. // / // / When evaluating `@import` rules, filesystem importers should load an // / [import-only file] if one exists for the URL being canonicalized. // / Otherwise, canonicalization should be identical for `@import` and `@use` // / rules. // / // / [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files FromImport bool `protobuf:"varint,5,opt,name=from_import,json=fromImport,proto3" json:"from_import,omitempty"` } func (x *OutboundMessage_FileImportRequest) Reset() { *x = OutboundMessage_FileImportRequest{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_FileImportRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_FileImportRequest) ProtoMessage() {} func (x *OutboundMessage_FileImportRequest) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_FileImportRequest.ProtoReflect.Descriptor instead. func (*OutboundMessage_FileImportRequest) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 5} } func (x *OutboundMessage_FileImportRequest) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *OutboundMessage_FileImportRequest) GetImporterId() uint32 { if x != nil { return x.ImporterId } return 0 } func (x *OutboundMessage_FileImportRequest) GetUrl() string { if x != nil { return x.Url } return "" } func (x *OutboundMessage_FileImportRequest) GetFromImport() bool { if x != nil { return x.FromImport } return false } // A request to invoke a custom Sass function and return its result. type OutboundMessage_FunctionCallRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // An identifier that indicates which function to invoke. Mandatory. // // Types that are assignable to Identifier: // // *OutboundMessage_FunctionCallRequest_Name // *OutboundMessage_FunctionCallRequest_FunctionId Identifier isOutboundMessage_FunctionCallRequest_Identifier `protobuf_oneof:"identifier"` // The arguments passed to the function, in the order they appear in the // function signature passed to `CompileRequest.global_functions`. // // The compiler must ensure that a valid number of arguments are passed for // the given signature, that default argument values are instantiated // appropriately, and that variable argument lists (`$args...`) are passed // as `Value.ArgumentList`s. Arguments []*Value `protobuf:"bytes,5,rep,name=arguments,proto3" json:"arguments,omitempty"` } func (x *OutboundMessage_FunctionCallRequest) Reset() { *x = OutboundMessage_FunctionCallRequest{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_FunctionCallRequest) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_FunctionCallRequest) ProtoMessage() {} func (x *OutboundMessage_FunctionCallRequest) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_FunctionCallRequest.ProtoReflect.Descriptor instead. func (*OutboundMessage_FunctionCallRequest) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 6} } func (x *OutboundMessage_FunctionCallRequest) GetId() uint32 { if x != nil { return x.Id } return 0 } func (m *OutboundMessage_FunctionCallRequest) GetIdentifier() isOutboundMessage_FunctionCallRequest_Identifier { if m != nil { return m.Identifier } return nil } func (x *OutboundMessage_FunctionCallRequest) GetName() string { if x, ok := x.GetIdentifier().(*OutboundMessage_FunctionCallRequest_Name); ok { return x.Name } return "" } func (x *OutboundMessage_FunctionCallRequest) GetFunctionId() uint32 { if x, ok := x.GetIdentifier().(*OutboundMessage_FunctionCallRequest_FunctionId); ok { return x.FunctionId } return 0 } func (x *OutboundMessage_FunctionCallRequest) GetArguments() []*Value { if x != nil { return x.Arguments } return nil } type isOutboundMessage_FunctionCallRequest_Identifier interface { isOutboundMessage_FunctionCallRequest_Identifier() } type OutboundMessage_FunctionCallRequest_Name struct { // The name of the function to invoke. // // This must match the name of a function signature the host passed to the // corresponding `CompileRequest.global_functions` call, including hyphens // and underscores. Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"` } type OutboundMessage_FunctionCallRequest_FunctionId struct { // The opaque ID of the function to invoke. // // This must match the ID of a `Value.HostFunction` that the host passed // to the compiler. FunctionId uint32 `protobuf:"varint,4,opt,name=function_id,json=functionId,proto3,oneof"` } func (*OutboundMessage_FunctionCallRequest_Name) isOutboundMessage_FunctionCallRequest_Identifier() {} func (*OutboundMessage_FunctionCallRequest_FunctionId) isOutboundMessage_FunctionCallRequest_Identifier() { } // A message indicating that the Sass file was successfully compiled to CSS. type OutboundMessage_CompileResponse_CompileSuccess struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The compiled CSS. Css string `protobuf:"bytes,1,opt,name=css,proto3" json:"css,omitempty"` // The JSON-encoded source map, or the empty string if // `CompileRequest.source_map` was `false`. // // The compiler must not add a `"file"` key to this source map. It's the // host's (or the host's user's) responsibility to determine how the // generated CSS can be reached from the source map. SourceMap string `protobuf:"bytes,2,opt,name=source_map,json=sourceMap,proto3" json:"source_map,omitempty"` } func (x *OutboundMessage_CompileResponse_CompileSuccess) Reset() { *x = OutboundMessage_CompileResponse_CompileSuccess{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_CompileResponse_CompileSuccess) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_CompileResponse_CompileSuccess) ProtoMessage() {} func (x *OutboundMessage_CompileResponse_CompileSuccess) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_CompileResponse_CompileSuccess.ProtoReflect.Descriptor instead. func (*OutboundMessage_CompileResponse_CompileSuccess) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 1, 0} } func (x *OutboundMessage_CompileResponse_CompileSuccess) GetCss() string { if x != nil { return x.Css } return "" } func (x *OutboundMessage_CompileResponse_CompileSuccess) GetSourceMap() string { if x != nil { return x.SourceMap } return "" } // A message indicating that the Sass file could not be successfully // compiled to CSS. type OutboundMessage_CompileResponse_CompileFailure struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A message describing the reason for the failure. Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // The span associated with the failure. Span *SourceSpan `protobuf:"bytes,2,opt,name=span,proto3" json:"span,omitempty"` // The stack trace associated with the failure. // // The empty string indicates that no stack trace is available. Otherwise, // the format of this stack trace is not specified and is likely to be // inconsistent between implementations. StackTrace string `protobuf:"bytes,3,opt,name=stack_trace,json=stackTrace,proto3" json:"stack_trace,omitempty"` // A formatted, human-readable string that contains the message, span // (if available), and trace (if available). The format of this string is // not specified and is likely to be inconsistent between implementations. Formatted string `protobuf:"bytes,4,opt,name=formatted,proto3" json:"formatted,omitempty"` } func (x *OutboundMessage_CompileResponse_CompileFailure) Reset() { *x = OutboundMessage_CompileResponse_CompileFailure{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OutboundMessage_CompileResponse_CompileFailure) String() string { return protoimpl.X.MessageStringOf(x) } func (*OutboundMessage_CompileResponse_CompileFailure) ProtoMessage() {} func (x *OutboundMessage_CompileResponse_CompileFailure) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OutboundMessage_CompileResponse_CompileFailure.ProtoReflect.Descriptor instead. func (*OutboundMessage_CompileResponse_CompileFailure) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{1, 1, 1} } func (x *OutboundMessage_CompileResponse_CompileFailure) GetMessage() string { if x != nil { return x.Message } return "" } func (x *OutboundMessage_CompileResponse_CompileFailure) GetSpan() *SourceSpan { if x != nil { return x.Span } return nil } func (x *OutboundMessage_CompileResponse_CompileFailure) GetStackTrace() string { if x != nil { return x.StackTrace } return "" } func (x *OutboundMessage_CompileResponse_CompileFailure) GetFormatted() string { if x != nil { return x.Formatted } return "" } // A single point in a source file. type SourceSpan_SourceLocation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The 0-based offset of this location within the source file. Offset uint32 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` // The 0-based line number of this location within the source file. Line uint32 `protobuf:"varint,2,opt,name=line,proto3" json:"line,omitempty"` // The 0-based column number of this location within its line. Column uint32 `protobuf:"varint,3,opt,name=column,proto3" json:"column,omitempty"` } func (x *SourceSpan_SourceLocation) Reset() { *x = SourceSpan_SourceLocation{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *SourceSpan_SourceLocation) String() string { return protoimpl.X.MessageStringOf(x) } func (*SourceSpan_SourceLocation) ProtoMessage() {} func (x *SourceSpan_SourceLocation) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use SourceSpan_SourceLocation.ProtoReflect.Descriptor instead. func (*SourceSpan_SourceLocation) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{3, 0} } func (x *SourceSpan_SourceLocation) GetOffset() uint32 { if x != nil { return x.Offset } return 0 } func (x *SourceSpan_SourceLocation) GetLine() uint32 { if x != nil { return x.Line } return 0 } func (x *SourceSpan_SourceLocation) GetColumn() uint32 { if x != nil { return x.Column } return 0 } // A SassScript string value. type Value_String struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The contents of the string. Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` // Whether the string is quoted or unquoted. Quoted bool `protobuf:"varint,2,opt,name=quoted,proto3" json:"quoted,omitempty"` } func (x *Value_String) Reset() { *x = Value_String{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_String) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_String) ProtoMessage() {} func (x *Value_String) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_String.ProtoReflect.Descriptor instead. func (*Value_String) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 0} } func (x *Value_String) GetText() string { if x != nil { return x.Text } return "" } func (x *Value_String) GetQuoted() bool { if x != nil { return x.Quoted } return false } // A SassScript number value. type Value_Number struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The number's numeric value. Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` // The number's numerator units. // // The endpoint sending the number must ensure that no numerator units are // [compatible][] with any denominator units. Such compatible units must be // simplified away according to the multiplicative factor between them // defined in the CSS Values and Units spec. // // [compatible]: https://www.w3.org/TR/css-values-4/#compat Numerators []string `protobuf:"bytes,2,rep,name=numerators,proto3" json:"numerators,omitempty"` // The number's denominator units. Denominators []string `protobuf:"bytes,3,rep,name=denominators,proto3" json:"denominators,omitempty"` } func (x *Value_Number) Reset() { *x = Value_Number{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_Number) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_Number) ProtoMessage() {} func (x *Value_Number) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_Number.ProtoReflect.Descriptor instead. func (*Value_Number) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 1} } func (x *Value_Number) GetValue() float64 { if x != nil { return x.Value } return 0 } func (x *Value_Number) GetNumerators() []string { if x != nil { return x.Numerators } return nil } func (x *Value_Number) GetDenominators() []string { if x != nil { return x.Denominators } return nil } // A SassScript color value, represented as red, green, and blue channels. // // All Sass color values can be equivalently represented as `RgbColor`, // `HslColor`, and `HwbColor` messages without loss of color information that // can affect CSS rendering. As such, either endpoint may choose to send any // color value as any one of these three messages. type Value_RgbColor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The color's red channel. May not be above 255. Red uint32 `protobuf:"varint,1,opt,name=red,proto3" json:"red,omitempty"` // The color's green channel. May not be above 255. Green uint32 `protobuf:"varint,2,opt,name=green,proto3" json:"green,omitempty"` // The color's blue channel. May not be above 255. Blue uint32 `protobuf:"varint,3,opt,name=blue,proto3" json:"blue,omitempty"` // The color's alpha channel. Must be between 0 and 1, // inclusive. Alpha float64 `protobuf:"fixed64,4,opt,name=alpha,proto3" json:"alpha,omitempty"` } func (x *Value_RgbColor) Reset() { *x = Value_RgbColor{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_RgbColor) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_RgbColor) ProtoMessage() {} func (x *Value_RgbColor) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_RgbColor.ProtoReflect.Descriptor instead. func (*Value_RgbColor) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 2} } func (x *Value_RgbColor) GetRed() uint32 { if x != nil { return x.Red } return 0 } func (x *Value_RgbColor) GetGreen() uint32 { if x != nil { return x.Green } return 0 } func (x *Value_RgbColor) GetBlue() uint32 { if x != nil { return x.Blue } return 0 } func (x *Value_RgbColor) GetAlpha() float64 { if x != nil { return x.Alpha } return 0 } // A SassScript color value, represented as hue, saturation, and lightness channels. type Value_HslColor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The color's hue. Hue float64 `protobuf:"fixed64,1,opt,name=hue,proto3" json:"hue,omitempty"` // The color's percent saturation. Must be between 0 and 100, // inclusive. Saturation float64 `protobuf:"fixed64,2,opt,name=saturation,proto3" json:"saturation,omitempty"` // The color's percent lightness. Must be between 0 and 100, // inclusive. Lightness float64 `protobuf:"fixed64,3,opt,name=lightness,proto3" json:"lightness,omitempty"` // The color's alpha channel. Must be between 0 and 1, // inclusive. Alpha float64 `protobuf:"fixed64,4,opt,name=alpha,proto3" json:"alpha,omitempty"` } func (x *Value_HslColor) Reset() { *x = Value_HslColor{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_HslColor) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_HslColor) ProtoMessage() {} func (x *Value_HslColor) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_HslColor.ProtoReflect.Descriptor instead. func (*Value_HslColor) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 3} } func (x *Value_HslColor) GetHue() float64 { if x != nil { return x.Hue } return 0 } func (x *Value_HslColor) GetSaturation() float64 { if x != nil { return x.Saturation } return 0 } func (x *Value_HslColor) GetLightness() float64 { if x != nil { return x.Lightness } return 0 } func (x *Value_HslColor) GetAlpha() float64 { if x != nil { return x.Alpha } return 0 } // A SassScript color value, represented as hue, whiteness, and blackness // channels. type Value_HwbColor struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The color's hue. Hue float64 `protobuf:"fixed64,1,opt,name=hue,proto3" json:"hue,omitempty"` // The color's percent whiteness. Must be between 0 and 100, // inclusive. The sum of `whiteness` and `blackness` must not exceed 100. Whiteness float64 `protobuf:"fixed64,2,opt,name=whiteness,proto3" json:"whiteness,omitempty"` // The color's percent blackness. Must be between 0 and 100, // inclusive. The sum of `whiteness` and `blackness` must not exceed 100. Blackness float64 `protobuf:"fixed64,3,opt,name=blackness,proto3" json:"blackness,omitempty"` // The color's alpha channel. Mandatory. Must be between 0 and 1, // inclusive. Alpha float64 `protobuf:"fixed64,4,opt,name=alpha,proto3" json:"alpha,omitempty"` } func (x *Value_HwbColor) Reset() { *x = Value_HwbColor{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_HwbColor) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_HwbColor) ProtoMessage() {} func (x *Value_HwbColor) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_HwbColor.ProtoReflect.Descriptor instead. func (*Value_HwbColor) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 4} } func (x *Value_HwbColor) GetHue() float64 { if x != nil { return x.Hue } return 0 } func (x *Value_HwbColor) GetWhiteness() float64 { if x != nil { return x.Whiteness } return 0 } func (x *Value_HwbColor) GetBlackness() float64 { if x != nil { return x.Blackness } return 0 } func (x *Value_HwbColor) GetAlpha() float64 { if x != nil { return x.Alpha } return 0 } // A SassScript list value. type Value_List struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The type of separator for this list. Mandatory. Separator ListSeparator `protobuf:"varint,1,opt,name=separator,proto3,enum=sass.embedded_protocol.ListSeparator" json:"separator,omitempty"` // Whether this list has square brackets. Mandatory. HasBrackets bool `protobuf:"varint,2,opt,name=has_brackets,json=hasBrackets,proto3" json:"has_brackets,omitempty"` // The elements of this list. Contents []*Value `protobuf:"bytes,3,rep,name=contents,proto3" json:"contents,omitempty"` } func (x *Value_List) Reset() { *x = Value_List{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_List) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_List) ProtoMessage() {} func (x *Value_List) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_List.ProtoReflect.Descriptor instead. func (*Value_List) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 5} } func (x *Value_List) GetSeparator() ListSeparator { if x != nil { return x.Separator } return ListSeparator_COMMA } func (x *Value_List) GetHasBrackets() bool { if x != nil { return x.HasBrackets } return false } func (x *Value_List) GetContents() []*Value { if x != nil { return x.Contents } return nil } // A SassScript map value. type Value_Map struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The entries in this map. The sending endpoint must guarantee that no two // entries have the same key. Entries []*Value_Map_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` } func (x *Value_Map) Reset() { *x = Value_Map{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_Map) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_Map) ProtoMessage() {} func (x *Value_Map) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_Map.ProtoReflect.Descriptor instead. func (*Value_Map) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 6} } func (x *Value_Map) GetEntries() []*Value_Map_Entry { if x != nil { return x.Entries } return nil } // A first-class function defined in the compiler. New `CompilerFunction`s may // only be created by the compiler, but the host may pass `CompilerFunction`s // back to the compiler as long as their IDs match IDs of functions received // by the host during that same compilation. type Value_CompilerFunction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A unique ID for this function. The compiler is responsible for generating // this ID and ensuring it's unique across all functions passed to the host // for this compilation. Mandatory. Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } func (x *Value_CompilerFunction) Reset() { *x = Value_CompilerFunction{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_CompilerFunction) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_CompilerFunction) ProtoMessage() {} func (x *Value_CompilerFunction) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_CompilerFunction.ProtoReflect.Descriptor instead. func (*Value_CompilerFunction) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 7} } func (x *Value_CompilerFunction) GetId() uint32 { if x != nil { return x.Id } return 0 } // An anonymous custom function defined in the host. New `HostFunction`s may // only be created by the host, and `HostFunction`s may *never* be passed from // the compiler to the host. The compiler must instead pass a // `CompilerFunction` that wraps the `HostFunction`. type Value_HostFunction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // A unique ID for this function. The compiler must pass this ID as // `OutboundRequest.FunctionCallRequest.id` when invoking this function. The // host is responsible for generating this ID and ensuring it's unique // across all functions for *all* compilations. Mandatory. Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The signature for this function. Mandatory. // // If this isn't a valid Sass function signature that could appear after // `@function` in a Sass stylesheet (such as `mix($color1, $color2, $weight: // 50%)`), the compiler must treat it as though the function that returned // this `HostFunction` threw an error. // // > This ensures that the host doesn't need to be able to correctly parse // > the entire function declaration syntax. // // The compiler may not invoke the function by its name, since it's not // guaranteed to be globally unique. However, it may use the name to // generate the string representation of this function. Signature string `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` } func (x *Value_HostFunction) Reset() { *x = Value_HostFunction{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_HostFunction) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_HostFunction) ProtoMessage() {} func (x *Value_HostFunction) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_HostFunction.ProtoReflect.Descriptor instead. func (*Value_HostFunction) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 8} } func (x *Value_HostFunction) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *Value_HostFunction) GetSignature() string { if x != nil { return x.Signature } return "" } // A SassScript argument list value. This represents rest arguments passed to // a function's `$arg...` parameter. Unlike a normal `List`, an argument list // has an associated keywords map which tracks keyword arguments passed in // alongside positional arguments. // // For each `ArgumentList` in `FunctionCallRequest.arguments` (including those // nested within `List`s and `Map`s), the host must track whether its keyword // arguments were accessed by the user. If they were, it must add its // `ArgumentList.id` to `FunctionCallResponse.accessed_argument_lists`. // // The compiler must treat every `ArgumentList` whose `ArgumentList.id` // appears in `FunctionCallResponse.accessed_argument_lists` as though it had // been passed to `meta.keywords()`. type Value_ArgumentList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // An ID for this argument list that's unique within the scope of a given // `FunctionCallRequest`. // // The special ID `0` is reserved for `ArgumentList`s created by the host, // and may not be used by the compiler. These `ArgumentList`s do not need to // have their IDs added to `FunctionCallResponse.accessed_argument_lists`, // and the compiler should treat them as though their keywords have always // been accessed. Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // The type of separator for this list. The compiler must set this, but // the host may omit it for `ArgumentList`s that were originally created by // the compiler (that is, those with a non-0 ID). Separator ListSeparator `protobuf:"varint,2,opt,name=separator,proto3,enum=sass.embedded_protocol.ListSeparator" json:"separator,omitempty"` // The argument list's positional contents. The compiler must set this, but // the host may omit it for `ArgumentList`s that were originally created by // the compiler (that is, those with a non-0 ID). Contents []*Value `protobuf:"bytes,3,rep,name=contents,proto3" json:"contents,omitempty"` // The argument list's keywords. The compiler must set this, but the host // may omit it for `ArgumentList`s that were originally created by the // compiler (that is, those with a non-0 ID). Keywords map[string]*Value `protobuf:"bytes,4,rep,name=keywords,proto3" json:"keywords,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Value_ArgumentList) Reset() { *x = Value_ArgumentList{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_ArgumentList) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_ArgumentList) ProtoMessage() {} func (x *Value_ArgumentList) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_ArgumentList.ProtoReflect.Descriptor instead. func (*Value_ArgumentList) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 9} } func (x *Value_ArgumentList) GetId() uint32 { if x != nil { return x.Id } return 0 } func (x *Value_ArgumentList) GetSeparator() ListSeparator { if x != nil { return x.Separator } return ListSeparator_COMMA } func (x *Value_ArgumentList) GetContents() []*Value { if x != nil { return x.Contents } return nil } func (x *Value_ArgumentList) GetKeywords() map[string]*Value { if x != nil { return x.Keywords } return nil } // A SassScript calculation value. The compiler must send fully [simplified] // calculations, meaning that simplifying it again will produce the same // calculation. The host is not required to simplify calculations. // // The compiler must simplify any calculations it receives from the host // before returning them from a function. If this simplification produces an // error, it should be treated as though the function call threw that error. // It should *not* be treated as a protocol error. // // [simplified]: https://github.com/sass/sass/tree/main/spec/types/calculation.md#simplifying-a-calculation type Value_Calculation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The calculation's name. Mandatory. The host may only set this to names // that the Sass specification uses to create calculations. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The calculation's arguments. Mandatory. The host must use exactly the // number of arguments used by the Sass specification for calculations with // the given `name`. Arguments []*Value_Calculation_CalculationValue `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty"` } func (x *Value_Calculation) Reset() { *x = Value_Calculation{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_Calculation) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_Calculation) ProtoMessage() {} func (x *Value_Calculation) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_Calculation.ProtoReflect.Descriptor instead. func (*Value_Calculation) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 10} } func (x *Value_Calculation) GetName() string { if x != nil { return x.Name } return "" } func (x *Value_Calculation) GetArguments() []*Value_Calculation_CalculationValue { if x != nil { return x.Arguments } return nil } // A single key/value pair in the map. type Value_Map_Entry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The key this entry is associated with. Mandatory. Key *Value `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // The value associated with this key. Mandatory. Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (x *Value_Map_Entry) Reset() { *x = Value_Map_Entry{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_Map_Entry) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_Map_Entry) ProtoMessage() {} func (x *Value_Map_Entry) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_Map_Entry.ProtoReflect.Descriptor instead. func (*Value_Map_Entry) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 6, 0} } func (x *Value_Map_Entry) GetKey() *Value { if x != nil { return x.Key } return nil } func (x *Value_Map_Entry) GetValue() *Value { if x != nil { return x.Value } return nil } // A single component of a calculation expression. type Value_Calculation_CalculationValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The value of the component. Mandatory. // // Types that are assignable to Value: // // *Value_Calculation_CalculationValue_Number // *Value_Calculation_CalculationValue_String_ // *Value_Calculation_CalculationValue_Interpolation // *Value_Calculation_CalculationValue_Operation // *Value_Calculation_CalculationValue_Calculation Value isValue_Calculation_CalculationValue_Value `protobuf_oneof:"value"` } func (x *Value_Calculation_CalculationValue) Reset() { *x = Value_Calculation_CalculationValue{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_Calculation_CalculationValue) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_Calculation_CalculationValue) ProtoMessage() {} func (x *Value_Calculation_CalculationValue) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_Calculation_CalculationValue.ProtoReflect.Descriptor instead. func (*Value_Calculation_CalculationValue) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 10, 0} } func (m *Value_Calculation_CalculationValue) GetValue() isValue_Calculation_CalculationValue_Value { if m != nil { return m.Value } return nil } func (x *Value_Calculation_CalculationValue) GetNumber() *Value_Number { if x, ok := x.GetValue().(*Value_Calculation_CalculationValue_Number); ok { return x.Number } return nil } func (x *Value_Calculation_CalculationValue) GetString_() string { if x, ok := x.GetValue().(*Value_Calculation_CalculationValue_String_); ok { return x.String_ } return "" } func (x *Value_Calculation_CalculationValue) GetInterpolation() string { if x, ok := x.GetValue().(*Value_Calculation_CalculationValue_Interpolation); ok { return x.Interpolation } return "" } func (x *Value_Calculation_CalculationValue) GetOperation() *Value_Calculation_CalculationOperation { if x, ok := x.GetValue().(*Value_Calculation_CalculationValue_Operation); ok { return x.Operation } return nil } func (x *Value_Calculation_CalculationValue) GetCalculation() *Value_Calculation { if x, ok := x.GetValue().(*Value_Calculation_CalculationValue_Calculation); ok { return x.Calculation } return nil } type isValue_Calculation_CalculationValue_Value interface { isValue_Calculation_CalculationValue_Value() } type Value_Calculation_CalculationValue_Number struct { Number *Value_Number `protobuf:"bytes,1,opt,name=number,proto3,oneof"` } type Value_Calculation_CalculationValue_String_ struct { // An unquoted string, as from a function like `var()` or `env()`. String_ string `protobuf:"bytes,2,opt,name=string,proto3,oneof"` } type Value_Calculation_CalculationValue_Interpolation struct { // An unquoted string as created by interpolation for // backwards-compatibility with older Sass syntax. Interpolation string `protobuf:"bytes,3,opt,name=interpolation,proto3,oneof"` } type Value_Calculation_CalculationValue_Operation struct { Operation *Value_Calculation_CalculationOperation `protobuf:"bytes,4,opt,name=operation,proto3,oneof"` } type Value_Calculation_CalculationValue_Calculation struct { Calculation *Value_Calculation `protobuf:"bytes,5,opt,name=calculation,proto3,oneof"` } func (*Value_Calculation_CalculationValue_Number) isValue_Calculation_CalculationValue_Value() {} func (*Value_Calculation_CalculationValue_String_) isValue_Calculation_CalculationValue_Value() {} func (*Value_Calculation_CalculationValue_Interpolation) isValue_Calculation_CalculationValue_Value() { } func (*Value_Calculation_CalculationValue_Operation) isValue_Calculation_CalculationValue_Value() {} func (*Value_Calculation_CalculationValue_Calculation) isValue_Calculation_CalculationValue_Value() {} // A binary operation that appears in a calculation. type Value_Calculation_CalculationOperation struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The operator to perform. Operator CalculationOperator `protobuf:"varint,1,opt,name=operator,proto3,enum=sass.embedded_protocol.CalculationOperator" json:"operator,omitempty"` // The left-hand side of the operation. Left *Value_Calculation_CalculationValue `protobuf:"bytes,2,opt,name=left,proto3" json:"left,omitempty"` // The right-hand side of the operation. Right *Value_Calculation_CalculationValue `protobuf:"bytes,3,opt,name=right,proto3" json:"right,omitempty"` } func (x *Value_Calculation_CalculationOperation) Reset() { *x = Value_Calculation_CalculationOperation{} if protoimpl.UnsafeEnabled { mi := &file_embedded_sass_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Value_Calculation_CalculationOperation) String() string { return protoimpl.X.MessageStringOf(x) } func (*Value_Calculation_CalculationOperation) ProtoMessage() {} func (x *Value_Calculation_CalculationOperation) ProtoReflect() protoreflect.Message { mi := &file_embedded_sass_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Value_Calculation_CalculationOperation.ProtoReflect.Descriptor instead. func (*Value_Calculation_CalculationOperation) Descriptor() ([]byte, []int) { return file_embedded_sass_proto_rawDescGZIP(), []int{4, 10, 1} } func (x *Value_Calculation_CalculationOperation) GetOperator() CalculationOperator { if x != nil { return x.Operator } return CalculationOperator_PLUS } func (x *Value_Calculation_CalculationOperation) GetLeft() *Value_Calculation_CalculationValue { if x != nil { return x.Left } return nil } func (x *Value_Calculation_CalculationOperation) GetRight() *Value_Calculation_CalculationValue { if x != nil { return x.Right } return nil } var File_embedded_sass_proto protoreflect.FileDescriptor var file_embedded_sass_proto_rawDesc = []byte{ 0x0a, 0x13, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x9b, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x60, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x72, 0x0a, 0x15, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x14, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x12, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x73, 0x0a, 0x16, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x14, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x92, 0x07, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x12, 0x5c, 0x0a, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x5f, 0x61, 0x73, 0x63, 0x69, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x6c, 0x65, 0x72, 0x74, 0x41, 0x73, 0x63, 0x69, 0x69, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x71, 0x75, 0x69, 0x65, 0x74, 0x5f, 0x64, 0x65, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x71, 0x75, 0x69, 0x65, 0x74, 0x44, 0x65, 0x70, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x1a, 0xcb, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x5a, 0x0a, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x52, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x1a, 0x7b, 0x0a, 0x08, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x49, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x1a, 0x5c, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0xc7, 0x02, 0x0a, 0x0e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x5f, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0xa1, 0x01, 0x0a, 0x0d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x29, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x63, 0x0a, 0x12, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0xbb, 0x01, 0x0a, 0x14, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x15, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xfe, 0x11, 0x0a, 0x0f, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x64, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x70, 0x0a, 0x14, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x13, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x0e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x13, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x11, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x71, 0x0a, 0x15, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x13, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x64, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0xdf, 0x01, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x16, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x13, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0xf7, 0x03, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x62, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x46, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x55, 0x72, 0x6c, 0x73, 0x1a, 0x47, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x61, 0x70, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x1a, 0xa1, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x1a, 0xe9, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x48, 0x00, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x1a, 0x7f, 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x1a, 0x58, 0x0a, 0x0d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x1a, 0x7d, 0x0a, 0x11, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x66, 0x72, 0x6f, 0x6d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x1a, 0xaf, 0x01, 0x0a, 0x13, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x78, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbd, 0x02, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x47, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x48, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x1a, 0x54, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x65, 0x6e, 0x64, 0x22, 0xb8, 0x16, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x09, 0x72, 0x67, 0x62, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x52, 0x67, 0x62, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x08, 0x72, 0x67, 0x62, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x45, 0x0a, 0x09, 0x68, 0x73, 0x6c, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x48, 0x73, 0x6c, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x08, 0x68, 0x73, 0x6c, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x38, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x46, 0x0a, 0x09, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0d, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x68, 0x6f, 0x73, 0x74, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x09, 0x68, 0x77, 0x62, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x48, 0x77, 0x62, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x08, 0x68, 0x77, 0x62, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x4d, 0x0a, 0x0b, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x34, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x1a, 0x62, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x1a, 0x5c, 0x0a, 0x08, 0x52, 0x67, 0x62, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x70, 0x0a, 0x08, 0x48, 0x73, 0x6c, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x68, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x61, 0x74, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x73, 0x61, 0x74, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x6e, 0x0a, 0x08, 0x48, 0x77, 0x62, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x68, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0xa9, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x61, 0x73, 0x42, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x39, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0xb7, 0x01, 0x0a, 0x03, 0x4d, 0x61, 0x70, 0x12, 0x41, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x2e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x6d, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x22, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x1a, 0x3c, 0x0a, 0x0c, 0x48, 0x6f, 0x73, 0x74, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xd0, 0x02, 0x0a, 0x0c, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x54, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x5a, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0xce, 0x05, 0x0a, 0x0b, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0xcc, 0x02, 0x0a, 0x10, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5e, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x0b, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x81, 0x02, 0x0a, 0x14, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6c, 0x65, 0x66, 0x74, 0x12, 0x50, 0x0a, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x61, 0x73, 0x73, 0x2e, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x72, 0x69, 0x67, 0x68, 0x74, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x2b, 0x0a, 0x0b, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x4d, 0x50, 0x52, 0x45, 0x53, 0x53, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x29, 0x0a, 0x06, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x43, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x44, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x43, 0x53, 0x53, 0x10, 0x02, 0x2a, 0x3f, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x02, 0x2a, 0x38, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x41, 0x52, 0x53, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x52, 0x41, 0x4d, 0x53, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x3f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x43, 0x49, 0x44, 0x45, 0x44, 0x10, 0x03, 0x2a, 0x2f, 0x0a, 0x0e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x52, 0x55, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, 0x4c, 0x53, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x02, 0x2a, 0x41, 0x0a, 0x13, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x4c, 0x55, 0x53, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x49, 0x4e, 0x55, 0x53, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x49, 0x56, 0x49, 0x44, 0x45, 0x10, 0x03, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_embedded_sass_proto_rawDescOnce sync.Once file_embedded_sass_proto_rawDescData = file_embedded_sass_proto_rawDesc ) func file_embedded_sass_proto_rawDescGZIP() []byte { file_embedded_sass_proto_rawDescOnce.Do(func() { file_embedded_sass_proto_rawDescData = protoimpl.X.CompressGZIP(file_embedded_sass_proto_rawDescData) }) return file_embedded_sass_proto_rawDescData } var file_embedded_sass_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_embedded_sass_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_embedded_sass_proto_goTypes = []interface{}{ (OutputStyle)(0), // 0: sass.embedded_protocol.OutputStyle (Syntax)(0), // 1: sass.embedded_protocol.Syntax (LogEventType)(0), // 2: sass.embedded_protocol.LogEventType (ProtocolErrorType)(0), // 3: sass.embedded_protocol.ProtocolErrorType (ListSeparator)(0), // 4: sass.embedded_protocol.ListSeparator (SingletonValue)(0), // 5: sass.embedded_protocol.SingletonValue (CalculationOperator)(0), // 6: sass.embedded_protocol.CalculationOperator (*InboundMessage)(nil), // 7: sass.embedded_protocol.InboundMessage (*OutboundMessage)(nil), // 8: sass.embedded_protocol.OutboundMessage (*ProtocolError)(nil), // 9: sass.embedded_protocol.ProtocolError (*SourceSpan)(nil), // 10: sass.embedded_protocol.SourceSpan (*Value)(nil), // 11: sass.embedded_protocol.Value (*InboundMessage_VersionRequest)(nil), // 12: sass.embedded_protocol.InboundMessage.VersionRequest (*InboundMessage_CompileRequest)(nil), // 13: sass.embedded_protocol.InboundMessage.CompileRequest (*InboundMessage_CanonicalizeResponse)(nil), // 14: sass.embedded_protocol.InboundMessage.CanonicalizeResponse (*InboundMessage_ImportResponse)(nil), // 15: sass.embedded_protocol.InboundMessage.ImportResponse (*InboundMessage_FileImportResponse)(nil), // 16: sass.embedded_protocol.InboundMessage.FileImportResponse (*InboundMessage_FunctionCallResponse)(nil), // 17: sass.embedded_protocol.InboundMessage.FunctionCallResponse (*InboundMessage_CompileRequest_StringInput)(nil), // 18: sass.embedded_protocol.InboundMessage.CompileRequest.StringInput (*InboundMessage_CompileRequest_Importer)(nil), // 19: sass.embedded_protocol.InboundMessage.CompileRequest.Importer (*InboundMessage_ImportResponse_ImportSuccess)(nil), // 20: sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccess (*OutboundMessage_VersionResponse)(nil), // 21: sass.embedded_protocol.OutboundMessage.VersionResponse (*OutboundMessage_CompileResponse)(nil), // 22: sass.embedded_protocol.OutboundMessage.CompileResponse (*OutboundMessage_LogEvent)(nil), // 23: sass.embedded_protocol.OutboundMessage.LogEvent (*OutboundMessage_CanonicalizeRequest)(nil), // 24: sass.embedded_protocol.OutboundMessage.CanonicalizeRequest (*OutboundMessage_ImportRequest)(nil), // 25: sass.embedded_protocol.OutboundMessage.ImportRequest (*OutboundMessage_FileImportRequest)(nil), // 26: sass.embedded_protocol.OutboundMessage.FileImportRequest (*OutboundMessage_FunctionCallRequest)(nil), // 27: sass.embedded_protocol.OutboundMessage.FunctionCallRequest (*OutboundMessage_CompileResponse_CompileSuccess)(nil), // 28: sass.embedded_protocol.OutboundMessage.CompileResponse.CompileSuccess (*OutboundMessage_CompileResponse_CompileFailure)(nil), // 29: sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailure (*SourceSpan_SourceLocation)(nil), // 30: sass.embedded_protocol.SourceSpan.SourceLocation (*Value_String)(nil), // 31: sass.embedded_protocol.Value.String (*Value_Number)(nil), // 32: sass.embedded_protocol.Value.Number (*Value_RgbColor)(nil), // 33: sass.embedded_protocol.Value.RgbColor (*Value_HslColor)(nil), // 34: sass.embedded_protocol.Value.HslColor (*Value_HwbColor)(nil), // 35: sass.embedded_protocol.Value.HwbColor (*Value_List)(nil), // 36: sass.embedded_protocol.Value.List (*Value_Map)(nil), // 37: sass.embedded_protocol.Value.Map (*Value_CompilerFunction)(nil), // 38: sass.embedded_protocol.Value.CompilerFunction (*Value_HostFunction)(nil), // 39: sass.embedded_protocol.Value.HostFunction (*Value_ArgumentList)(nil), // 40: sass.embedded_protocol.Value.ArgumentList (*Value_Calculation)(nil), // 41: sass.embedded_protocol.Value.Calculation (*Value_Map_Entry)(nil), // 42: sass.embedded_protocol.Value.Map.Entry nil, // 43: sass.embedded_protocol.Value.ArgumentList.KeywordsEntry (*Value_Calculation_CalculationValue)(nil), // 44: sass.embedded_protocol.Value.Calculation.CalculationValue (*Value_Calculation_CalculationOperation)(nil), // 45: sass.embedded_protocol.Value.Calculation.CalculationOperation } var file_embedded_sass_proto_depIdxs = []int32{ 13, // 0: sass.embedded_protocol.InboundMessage.compile_request:type_name -> sass.embedded_protocol.InboundMessage.CompileRequest 14, // 1: sass.embedded_protocol.InboundMessage.canonicalize_response:type_name -> sass.embedded_protocol.InboundMessage.CanonicalizeResponse 15, // 2: sass.embedded_protocol.InboundMessage.import_response:type_name -> sass.embedded_protocol.InboundMessage.ImportResponse 16, // 3: sass.embedded_protocol.InboundMessage.file_import_response:type_name -> sass.embedded_protocol.InboundMessage.FileImportResponse 17, // 4: sass.embedded_protocol.InboundMessage.function_call_response:type_name -> sass.embedded_protocol.InboundMessage.FunctionCallResponse 12, // 5: sass.embedded_protocol.InboundMessage.version_request:type_name -> sass.embedded_protocol.InboundMessage.VersionRequest 9, // 6: sass.embedded_protocol.OutboundMessage.error:type_name -> sass.embedded_protocol.ProtocolError 22, // 7: sass.embedded_protocol.OutboundMessage.compile_response:type_name -> sass.embedded_protocol.OutboundMessage.CompileResponse 23, // 8: sass.embedded_protocol.OutboundMessage.log_event:type_name -> sass.embedded_protocol.OutboundMessage.LogEvent 24, // 9: sass.embedded_protocol.OutboundMessage.canonicalize_request:type_name -> sass.embedded_protocol.OutboundMessage.CanonicalizeRequest 25, // 10: sass.embedded_protocol.OutboundMessage.import_request:type_name -> sass.embedded_protocol.OutboundMessage.ImportRequest 26, // 11: sass.embedded_protocol.OutboundMessage.file_import_request:type_name -> sass.embedded_protocol.OutboundMessage.FileImportRequest 27, // 12: sass.embedded_protocol.OutboundMessage.function_call_request:type_name -> sass.embedded_protocol.OutboundMessage.FunctionCallRequest 21, // 13: sass.embedded_protocol.OutboundMessage.version_response:type_name -> sass.embedded_protocol.OutboundMessage.VersionResponse 3, // 14: sass.embedded_protocol.ProtocolError.type:type_name -> sass.embedded_protocol.ProtocolErrorType 30, // 15: sass.embedded_protocol.SourceSpan.start:type_name -> sass.embedded_protocol.SourceSpan.SourceLocation 30, // 16: sass.embedded_protocol.SourceSpan.end:type_name -> sass.embedded_protocol.SourceSpan.SourceLocation 31, // 17: sass.embedded_protocol.Value.string:type_name -> sass.embedded_protocol.Value.String 32, // 18: sass.embedded_protocol.Value.number:type_name -> sass.embedded_protocol.Value.Number 33, // 19: sass.embedded_protocol.Value.rgb_color:type_name -> sass.embedded_protocol.Value.RgbColor 34, // 20: sass.embedded_protocol.Value.hsl_color:type_name -> sass.embedded_protocol.Value.HslColor 36, // 21: sass.embedded_protocol.Value.list:type_name -> sass.embedded_protocol.Value.List 37, // 22: sass.embedded_protocol.Value.map:type_name -> sass.embedded_protocol.Value.Map 5, // 23: sass.embedded_protocol.Value.singleton:type_name -> sass.embedded_protocol.SingletonValue 38, // 24: sass.embedded_protocol.Value.compiler_function:type_name -> sass.embedded_protocol.Value.CompilerFunction 39, // 25: sass.embedded_protocol.Value.host_function:type_name -> sass.embedded_protocol.Value.HostFunction 40, // 26: sass.embedded_protocol.Value.argument_list:type_name -> sass.embedded_protocol.Value.ArgumentList 35, // 27: sass.embedded_protocol.Value.hwb_color:type_name -> sass.embedded_protocol.Value.HwbColor 41, // 28: sass.embedded_protocol.Value.calculation:type_name -> sass.embedded_protocol.Value.Calculation 18, // 29: sass.embedded_protocol.InboundMessage.CompileRequest.string:type_name -> sass.embedded_protocol.InboundMessage.CompileRequest.StringInput 0, // 30: sass.embedded_protocol.InboundMessage.CompileRequest.style:type_name -> sass.embedded_protocol.OutputStyle 19, // 31: sass.embedded_protocol.InboundMessage.CompileRequest.importers:type_name -> sass.embedded_protocol.InboundMessage.CompileRequest.Importer 20, // 32: sass.embedded_protocol.InboundMessage.ImportResponse.success:type_name -> sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccess 11, // 33: sass.embedded_protocol.InboundMessage.FunctionCallResponse.success:type_name -> sass.embedded_protocol.Value 1, // 34: sass.embedded_protocol.InboundMessage.CompileRequest.StringInput.syntax:type_name -> sass.embedded_protocol.Syntax 19, // 35: sass.embedded_protocol.InboundMessage.CompileRequest.StringInput.importer:type_name -> sass.embedded_protocol.InboundMessage.CompileRequest.Importer 1, // 36: sass.embedded_protocol.InboundMessage.ImportResponse.ImportSuccess.syntax:type_name -> sass.embedded_protocol.Syntax 28, // 37: sass.embedded_protocol.OutboundMessage.CompileResponse.success:type_name -> sass.embedded_protocol.OutboundMessage.CompileResponse.CompileSuccess 29, // 38: sass.embedded_protocol.OutboundMessage.CompileResponse.failure:type_name -> sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailure 2, // 39: sass.embedded_protocol.OutboundMessage.LogEvent.type:type_name -> sass.embedded_protocol.LogEventType 10, // 40: sass.embedded_protocol.OutboundMessage.LogEvent.span:type_name -> sass.embedded_protocol.SourceSpan 11, // 41: sass.embedded_protocol.OutboundMessage.FunctionCallRequest.arguments:type_name -> sass.embedded_protocol.Value 10, // 42: sass.embedded_protocol.OutboundMessage.CompileResponse.CompileFailure.span:type_name -> sass.embedded_protocol.SourceSpan 4, // 43: sass.embedded_protocol.Value.List.separator:type_name -> sass.embedded_protocol.ListSeparator 11, // 44: sass.embedded_protocol.Value.List.contents:type_name -> sass.embedded_protocol.Value 42, // 45: sass.embedded_protocol.Value.Map.entries:type_name -> sass.embedded_protocol.Value.Map.Entry 4, // 46: sass.embedded_protocol.Value.ArgumentList.separator:type_name -> sass.embedded_protocol.ListSeparator 11, // 47: sass.embedded_protocol.Value.ArgumentList.contents:type_name -> sass.embedded_protocol.Value 43, // 48: sass.embedded_protocol.Value.ArgumentList.keywords:type_name -> sass.embedded_protocol.Value.ArgumentList.KeywordsEntry 44, // 49: sass.embedded_protocol.Value.Calculation.arguments:type_name -> sass.embedded_protocol.Value.Calculation.CalculationValue 11, // 50: sass.embedded_protocol.Value.Map.Entry.key:type_name -> sass.embedded_protocol.Value 11, // 51: sass.embedded_protocol.Value.Map.Entry.value:type_name -> sass.embedded_protocol.Value 11, // 52: sass.embedded_protocol.Value.ArgumentList.KeywordsEntry.value:type_name -> sass.embedded_protocol.Value 32, // 53: sass.embedded_protocol.Value.Calculation.CalculationValue.number:type_name -> sass.embedded_protocol.Value.Number 45, // 54: sass.embedded_protocol.Value.Calculation.CalculationValue.operation:type_name -> sass.embedded_protocol.Value.Calculation.CalculationOperation 41, // 55: sass.embedded_protocol.Value.Calculation.CalculationValue.calculation:type_name -> sass.embedded_protocol.Value.Calculation 6, // 56: sass.embedded_protocol.Value.Calculation.CalculationOperation.operator:type_name -> sass.embedded_protocol.CalculationOperator 44, // 57: sass.embedded_protocol.Value.Calculation.CalculationOperation.left:type_name -> sass.embedded_protocol.Value.Calculation.CalculationValue 44, // 58: sass.embedded_protocol.Value.Calculation.CalculationOperation.right:type_name -> sass.embedded_protocol.Value.Calculation.CalculationValue 59, // [59:59] is the sub-list for method output_type 59, // [59:59] is the sub-list for method input_type 59, // [59:59] is the sub-list for extension type_name 59, // [59:59] is the sub-list for extension extendee 0, // [0:59] is the sub-list for field type_name } func init() { file_embedded_sass_proto_init() } func file_embedded_sass_proto_init() { if File_embedded_sass_proto != nil { return } if !protoimpl.UnsafeEnabled { file_embedded_sass_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProtocolError); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SourceSpan); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_VersionRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_CompileRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_CanonicalizeResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_ImportResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_FileImportResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_FunctionCallResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_CompileRequest_StringInput); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_CompileRequest_Importer); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundMessage_ImportResponse_ImportSuccess); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_VersionResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_CompileResponse); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_LogEvent); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_CanonicalizeRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_ImportRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_FileImportRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_FunctionCallRequest); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_CompileResponse_CompileSuccess); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundMessage_CompileResponse_CompileFailure); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SourceSpan_SourceLocation); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_String); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_Number); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_RgbColor); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_HslColor); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_HwbColor); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_List); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_Map); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_CompilerFunction); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_HostFunction); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_ArgumentList); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_Calculation); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_Map_Entry); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_Calculation_CalculationValue); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_embedded_sass_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Value_Calculation_CalculationOperation); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } file_embedded_sass_proto_msgTypes[0].OneofWrappers = []interface{}{ (*InboundMessage_CompileRequest_)(nil), (*InboundMessage_CanonicalizeResponse_)(nil), (*InboundMessage_ImportResponse_)(nil), (*InboundMessage_FileImportResponse_)(nil), (*InboundMessage_FunctionCallResponse_)(nil), (*InboundMessage_VersionRequest_)(nil), } file_embedded_sass_proto_msgTypes[1].OneofWrappers = []interface{}{ (*OutboundMessage_Error)(nil), (*OutboundMessage_CompileResponse_)(nil), (*OutboundMessage_LogEvent_)(nil), (*OutboundMessage_CanonicalizeRequest_)(nil), (*OutboundMessage_ImportRequest_)(nil), (*OutboundMessage_FileImportRequest_)(nil), (*OutboundMessage_FunctionCallRequest_)(nil), (*OutboundMessage_VersionResponse_)(nil), } file_embedded_sass_proto_msgTypes[3].OneofWrappers = []interface{}{} file_embedded_sass_proto_msgTypes[4].OneofWrappers = []interface{}{ (*Value_String_)(nil), (*Value_Number_)(nil), (*Value_RgbColor_)(nil), (*Value_HslColor_)(nil), (*Value_List_)(nil), (*Value_Map_)(nil), (*Value_Singleton)(nil), (*Value_CompilerFunction_)(nil), (*Value_HostFunction_)(nil), (*Value_ArgumentList_)(nil), (*Value_HwbColor_)(nil), (*Value_Calculation_)(nil), } file_embedded_sass_proto_msgTypes[6].OneofWrappers = []interface{}{ (*InboundMessage_CompileRequest_String_)(nil), (*InboundMessage_CompileRequest_Path)(nil), } file_embedded_sass_proto_msgTypes[7].OneofWrappers = []interface{}{ (*InboundMessage_CanonicalizeResponse_Url)(nil), (*InboundMessage_CanonicalizeResponse_Error)(nil), } file_embedded_sass_proto_msgTypes[8].OneofWrappers = []interface{}{ (*InboundMessage_ImportResponse_Success)(nil), (*InboundMessage_ImportResponse_Error)(nil), } file_embedded_sass_proto_msgTypes[9].OneofWrappers = []interface{}{ (*InboundMessage_FileImportResponse_FileUrl)(nil), (*InboundMessage_FileImportResponse_Error)(nil), } file_embedded_sass_proto_msgTypes[10].OneofWrappers = []interface{}{ (*InboundMessage_FunctionCallResponse_Success)(nil), (*InboundMessage_FunctionCallResponse_Error)(nil), } file_embedded_sass_proto_msgTypes[12].OneofWrappers = []interface{}{ (*InboundMessage_CompileRequest_Importer_Path)(nil), (*InboundMessage_CompileRequest_Importer_ImporterId)(nil), (*InboundMessage_CompileRequest_Importer_FileImporterId)(nil), } file_embedded_sass_proto_msgTypes[13].OneofWrappers = []interface{}{} file_embedded_sass_proto_msgTypes[15].OneofWrappers = []interface{}{ (*OutboundMessage_CompileResponse_Success)(nil), (*OutboundMessage_CompileResponse_Failure)(nil), } file_embedded_sass_proto_msgTypes[16].OneofWrappers = []interface{}{} file_embedded_sass_proto_msgTypes[20].OneofWrappers = []interface{}{ (*OutboundMessage_FunctionCallRequest_Name)(nil), (*OutboundMessage_FunctionCallRequest_FunctionId)(nil), } file_embedded_sass_proto_msgTypes[37].OneofWrappers = []interface{}{ (*Value_Calculation_CalculationValue_Number)(nil), (*Value_Calculation_CalculationValue_String_)(nil), (*Value_Calculation_CalculationValue_Interpolation)(nil), (*Value_Calculation_CalculationValue_Operation)(nil), (*Value_Calculation_CalculationValue_Calculation)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_embedded_sass_proto_rawDesc, NumEnums: 7, NumMessages: 39, NumExtensions: 0, NumServices: 0, }, GoTypes: file_embedded_sass_proto_goTypes, DependencyIndexes: file_embedded_sass_proto_depIdxs, EnumInfos: file_embedded_sass_proto_enumTypes, MessageInfos: file_embedded_sass_proto_msgTypes, }.Build() File_embedded_sass_proto = out.File file_embedded_sass_proto_rawDesc = nil file_embedded_sass_proto_goTypes = nil file_embedded_sass_proto_depIdxs = nil } godartsass-2.0.0/internal/embeddedsass/embedded_sass.proto000066400000000000000000001072331444035720200240000ustar00rootroot00000000000000// Copyright 2019 Google Inc. Use of this source code is governed by an // MIT-style license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. syntax = "proto3"; package sass.embedded_protocol; // The wrapper type for all messages sent from the host to the compiler. This // provides a `oneof` that makes it possible to determine the type of each // inbound message. message InboundMessage { // A request for information about the version of the embedded compiler. The // host can use this to provide diagnostic information to the user, to check // which features the compiler supports, or to ensure that it's compatible // with the same protocol version the compiler supports. message VersionRequest { // This version request's id. uint32 id = 1; // This message's contents are intentionally empty. It just acts as a signal // to the compiler to send a VersionResponse. More fields may be added in // the future. } // A request that compiles an entrypoint to CSS. message CompileRequest { reserved 1; // An input stylesheet provided as plain text, rather than loaded from the // filesystem. message StringInput { // The contents of the stylesheet. string source = 1; // The location from which `source` was loaded. If this is empty, it // indicates that the URL is unknown. // // This must be a canonical URL recognized by `importer`, if it's passed. string url = 2; // The syntax to use to parse `source`. Syntax syntax = 3; // The importer to use to resolve imports relative to `url`. Importer importer = 4; } // The input stylesheet to parse. Mandatory. oneof input { // A stylesheet loaded from its contents. StringInput string = 2; // A stylesheet loaded from the given path on the filesystem. string path = 3; } // How to format the CSS output. OutputStyle style = 4; // Whether to generate a source map. Note that this will *not* add a source // map comment to the stylesheet; that's up to the host or its users. bool source_map = 5; // A wrapper message that represents either a user-defined importer or a // load path on disk. This must be a wrapper because `oneof` types can't be // `repeated`. message Importer { // The possible types of importer. Mandatory. oneof importer { // A built-in importer that loads Sass files within the given directory // on disk. string path = 1; // A unique ID for a user-defined importer. This ID will be included in // outbound `CanonicalizeRequest` and `ImportRequest` messages to // indicate which importer is being called. The host is responsible for // generating this ID and ensuring that it's unique across all // importers registered for this compilation. uint32 importer_id = 2; // A unique ID for a special kind of user-defined importer that tells // the compiler where to look for files on the physical filesystem, but // leaves the details of resolving partials and extensions and loading // the file from disk up to the compiler itself. // // This ID will be included in outbound `FileImportRequest` messages to // indicate which importer is being called. The host is responsible for // generating this ID and ensuring that it's unique across all importers // registered for this compilation. uint32 file_importer_id = 3; } } // Importers (including load paths on the filesystem) to use when resolving // imports that can't be resolved relative to the file that contains it. Each // importer is checked in order until one recognizes the imported URL. repeated Importer importers = 6; // Signatures for custom global functions whose behavior is defined by the // host. // // If this is not a valid Sass function signature that could appear after // `@function` in a Sass stylesheet (such as `mix($color1, $color2, $weight: // 50%)`), or if it conflicts with a function name that's built into the // Sass language, the compiler must treat the compilation as failed. // // Compilers must ensure that pure-Sass functions take precedence over // custom global functions. repeated string global_functions = 7; // Whether to use terminal colors in the formatted message of errors and // logs. bool alert_color = 8; // Whether to encode the formatted message of errors and logs in ASCII. bool alert_ascii = 9; // Whether to report all deprecation warnings or only the first few ones. // If this is `false`, the compiler may choose not to send events for // repeated deprecation warnings. If this is `true`, the compiler must emit // an event for every deprecation warning it encounters. bool verbose = 10; // Whether to omit events for deprecation warnings coming from dependencies // (files loaded from a different importer than the input). bool quiet_deps = 11; // Whether to include sources in the generated sourcemap bool source_map_include_sources = 12; // Whether to emit a `@charset`/BOM for non-ASCII stylesheets. bool charset = 13; } // A response indicating the result of canonicalizing an imported URL. message CanonicalizeResponse { uint32 id = 1; // The result of canonicalization. If this is unset, it indicates that the // importer either did not recognize the URL, or could not find a stylesheet // at the location it referred to. Optional. oneof result { // The successfully canonicalized URL. // // If this is not an absolute URL (including scheme), the compiler must // treat that as an error thrown by the importer. string url = 2; // An error message explaining why canonicalization failed. // // This indicates that a stylesheet was found, but a canonical URL for it // could not be determined. If no stylesheet was found, `result` should be // `null` instead. string error = 3; } } // A response indicating the result of importing a canonical URL. message ImportResponse { uint32 id = 1; // The stylesheet's contents were loaded successfully. message ImportSuccess { // The text of the stylesheet. string contents = 1; // The syntax of `contents`. Syntax syntax = 2; // An absolute, browser-accessible URL indicating the resolved location of // the imported stylesheet. // // This should be a `file:` URL if one is available, but an `http:` URL is // acceptable as well. If no URL is supplied, a `data:` URL is generated // automatically from `contents`. // // If this is provided and is not an absolute URL (including scheme) the // compiler must treat that as an error thrown by the importer. optional string source_map_url = 3; } // The result of loading the URL. If this is unset, it indicates that the // importer either did not recognize the URL, or could not find a stylesheet // at the location it referred to. Optional. oneof result { // The contents of the loaded stylesheet. ImportSuccess success = 2; // An error message explaining why the URL could not be loaded. string error = 3; } } // A response indicating the result of redirecting a URL to the filesystem. message FileImportResponse { uint32 id = 1; // The result of loading the URL. An unset result indicates that the // importer did not recognize the URL and other importers or load paths // should be tried. Optional. oneof result { // The absolute `file:` URL to look for the file on the physical // filesystem. // // The compiler must verify to the best of its ability that this URL // follows the format for an absolute `file:` URL on the current operating // system without a hostname. If it doesn't, the compiler must treat that // as an error thrown by the importer. See // https://en.wikipedia.org/wiki/File_URI_scheme for details on the // format. // // The compiler must handle turning this into a canonical URL by resolving // it for partials, file extensions, and index files. The compiler must // then loading the contents of the resulting canonical URL from the // filesystem. string file_url = 2; // An error message explaining why the URL could not be loaded. string error = 3; } } // A response indicating the result of calling a custom Sass function defined // in the host. message FunctionCallResponse { uint32 id = 1; // The result of calling the function. Mandatory. oneof result { // The return value of a successful function call. Value success = 2; // An error message explaining why the function call failed. string error = 3; } // The IDs of all `Value.ArgumentList`s in `FunctionCallRequest.arguments` // whose keywords were accessed. See `Value.ArgumentList` for details. This // may not include the special value `0` and it may not include multiple // instances of the same ID. repeated uint32 accessed_argument_lists = 4; } // The wrapped message. Mandatory. oneof message { CompileRequest compile_request = 2; CanonicalizeResponse canonicalize_response = 3; ImportResponse import_response = 4; FileImportResponse file_import_response = 5; FunctionCallResponse function_call_response = 6; VersionRequest version_request = 7; } } // The wrapper type for all messages sent from the compiler to the host. This // provides a `oneof` that makes it possible to determine the type of each // outbound message. message OutboundMessage { // A response that contains the version of the embedded compiler. message VersionResponse { // This version request's id. uint32 id = 5; // The version of the embedded protocol, in semver format. string protocol_version = 1; // The version of the embedded compiler package. This has no guaranteed // format, although compilers are encouraged to use semver. string compiler_version = 2; // The version of the Sass implementation that the embedded compiler wraps. // This has no guaranteed format, although Sass implementations are // encouraged to use semver. string implementation_version = 3; // The name of the Sass implementation that the embedded compiler wraps. string implementation_name = 4; } // A response that contains the result of a compilation. message CompileResponse { reserved 1; // A message indicating that the Sass file was successfully compiled to CSS. message CompileSuccess { reserved 3; // The compiled CSS. string css = 1; // The JSON-encoded source map, or the empty string if // `CompileRequest.source_map` was `false`. // // The compiler must not add a `"file"` key to this source map. It's the // host's (or the host's user's) responsibility to determine how the // generated CSS can be reached from the source map. string source_map = 2; } // A message indicating that the Sass file could not be successfully // compiled to CSS. message CompileFailure { // A message describing the reason for the failure. string message = 1; // The span associated with the failure. SourceSpan span = 2; // The stack trace associated with the failure. // // The empty string indicates that no stack trace is available. Otherwise, // the format of this stack trace is not specified and is likely to be // inconsistent between implementations. string stack_trace = 3; // A formatted, human-readable string that contains the message, span // (if available), and trace (if available). The format of this string is // not specified and is likely to be inconsistent between implementations. string formatted = 4; } // The success or failure result of the compilation. Mandatory. oneof result { // The result of a successful compilation. CompileSuccess success = 2; // The result of a failed compilation. CompileFailure failure = 3; } // The canonical URLs of all source files loaded during the compilation. // // The compiler must ensure that each canonical URL appears only once in // this list. This must include the entrypoint file's URL if either // `CompileRequest.input.path` or `CompileRequest.StringInput.url` was // passed. repeated string loaded_urls = 4; } // An event indicating that a message should be displayed to the user. message LogEvent { reserved 1; LogEventType type = 2; // The text of the message. string message = 3; // The span associated with this message. optional SourceSpan span = 4; // The stack trace associated with this message. // // The empty string indicates that no stack trace is available. Otherwise, // the format of this stack trace is not specified and is likely to be // inconsistent between implementations. string stack_trace = 5; // A formatted, human-readable string that contains the message, span (if // available), and trace (if available). The format of this string is not // specified and is likely to be inconsistent between implementations. string formatted = 6; } // A request for a custom importer to convert an imported URL to its canonical // format. // // If the URL is not recognized by this importer, or if no stylesheet is found // at that URL, `CanonicalizeResponse.result` must be `null`. Otherwise, the // importer must return an absolute URL, including a scheme. // // > The host's documentation should encourage the use of file importers (via // > `CompileRequest.Importer.file_importer_id`, `FileImportRequest`, and // > `FileImportResponse`) for any importers that simply refer to files on // > disk. This will allow Sass to handle the logic of resolving partials, // > file extensions, and index files. // // If Sass has already loaded a stylesheet with the returned canonical URL, it // re-uses the existing parse tree. This means that importers must ensure that // the same canonical URL always refers to the same stylesheet, *even across // different importers*. Importers must also ensure that any canonicalized // URLs they return can be passed back to `CanonicalizeRequest` and will be // returned unchanged. // // If this importer's URL format supports file extensions, it should // canonicalize them the same way as the default filesystem importer: // // * The importer should look for stylesheets by adding the prefix `_` to the // URL's basename, and by adding the extensions `.sass` and `.scss` if the // URL doesn't already have one of those extensions. For example, if the URL // was `foo/bar/baz`, the importer would look for: // // * `foo/bar/baz.sass` // * `foo/bar/baz.scss` // * `foo/bar/_baz.sass` // * `foo/bar/_baz.scss` // // If the URL was foo/bar/baz.scss, the importer would just look for: // // * `foo/bar/baz.scss` // * `foo/bar/_baz.scss` // // If the importer finds a stylesheet at more than one of these URLs, it // should respond with a `CanonicalizeResponse.result.error` indicating that // the import is ambiguous. Note that if the extension is explicitly // specified, a stylesheet with another extension may exist without error. // // * If none of the possible paths is valid, the importer should perform the // same resolution on the URL followed by `/index`. In the example above, it // would look for: // // * `foo/bar/baz/_index.sass` // * `foo/bar/baz/index.sass` // * `foo/bar/baz/_index.scss` // * `foo/bar/baz/index.scss` // // As above, if the importer finds a stylesheet at more than one of these // URLs, it should respond with a `CanonicalizeResponse.result.error` // indicating that the import is ambiguous. message CanonicalizeRequest { reserved 2; uint32 id = 1; // The unique ID of the importer being invoked. This must match an importer // ID passed to this compilation in `CompileRequest.importers` or // `CompileRequest.input.string.importer`. uint32 importer_id = 3; // The URL of the import to be canonicalized. This may be either absolute or // relative. // // When loading a URL, the compiler must first try resolving that URL // relative to the canonical URL of the current file, and canonicalizing the // result using the importer that loaded the current file. If this returns // `null`, the compiler must then try canonicalizing the original URL with // each importer in order until one returns something other than `null`. // That is the result of the import. string url = 4; /// Whether this request comes from an `@import` rule. /// /// When evaluating `@import` rules, URLs should canonicalize to an /// [import-only file] if one exists for the URL being canonicalized. /// Otherwise, canonicalization should be identical for `@import` and `@use` /// rules. /// /// [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files bool from_import = 5; } // A request for a custom importer to load the contents of a stylesheet. message ImportRequest { reserved 2; uint32 id = 1; // The unique ID of the importer being invoked. This must match an // `Importer.importer_id` passed to this compilation in // `CompileRequest.importers` or `CompileRequest.input.string.importer`. uint32 importer_id = 3; // The canonical URL of the import. This is guaranteed to be a URL returned // by a `CanonicalizeRequest` to this importer. string url = 4; } // A request for a custom filesystem importer to load the contents of a // stylesheet. // // A filesystem importer is represented in the compiler as an [importer]. When // the importer is invoked with a string `string`: // // [importer]: https://github.com/sass/sass/tree/main/spec/modules.md#importer // // * If `string` is an absolute URL whose scheme is `file`: // // * Let `url` be string. // // * Otherwise: // // * Let `fromImport` be `true` if the importer is being run for an // `@import` and `false` otherwise. // // * Let `response` be the result of sending a `FileImportRequest` with // `string` as its `url` and `fromImport` as `from_import`. // // * If `response.result` is null, return null. // // * Otherwise, if `response.result.error` is set, throw an error. // // * Otherwise, let `url` be `response.result.file_url`. // // * Let `resolved` be the result of [resolving `url`]. // // * If `resolved` is null, return null. // // * Let `text` be the contents of the file at `resolved`. // // * Let `syntax` be: // * "scss" if `url` ends in `.scss`. // * "indented" if `url` ends in `.sass`. // * "css" if `url` ends in `.css`. // // > The algorithm for resolving a `file:` URL guarantees that `url` will have // > one of these extensions. // // * Return `text`, `syntax`, and `resolved`. // // [resolving `url`]: https://github.com/sass/sass/tree/main/spec/modules.md#resolving-a-file-url message FileImportRequest { reserved 2; uint32 id = 1; // The unique ID of the importer being invoked. This must match an // `Importer.file_importer_id` passed to this compilation in // `CompileRequest.importers` or `CompileRequest.input.string.importer`. uint32 importer_id = 3; // The (non-canonicalized) URL of the import. string url = 4; /// Whether this request comes from an `@import` rule. /// /// When evaluating `@import` rules, filesystem importers should load an /// [import-only file] if one exists for the URL being canonicalized. /// Otherwise, canonicalization should be identical for `@import` and `@use` /// rules. /// /// [import-only file]: https://sass-lang.com/documentation/at-rules/import#import-only-files bool from_import = 5; } // A request to invoke a custom Sass function and return its result. message FunctionCallRequest { reserved 2; uint32 id = 1; // An identifier that indicates which function to invoke. Mandatory. oneof identifier { // The name of the function to invoke. // // This must match the name of a function signature the host passed to the // corresponding `CompileRequest.global_functions` call, including hyphens // and underscores. string name = 3; // The opaque ID of the function to invoke. // // This must match the ID of a `Value.HostFunction` that the host passed // to the compiler. uint32 function_id = 4; } // The arguments passed to the function, in the order they appear in the // function signature passed to `CompileRequest.global_functions`. // // The compiler must ensure that a valid number of arguments are passed for // the given signature, that default argument values are instantiated // appropriately, and that variable argument lists (`$args...`) are passed // as `Value.ArgumentList`s. repeated Value arguments = 5; } // The wrapped message. Mandatory. oneof message { ProtocolError error = 1; CompileResponse compile_response = 2; LogEvent log_event = 3; CanonicalizeRequest canonicalize_request = 4; ImportRequest import_request = 5; FileImportRequest file_import_request = 6; FunctionCallRequest function_call_request = 7; VersionResponse version_response = 8; } } // Possible ways to format the CSS output. The compiler is not required to // support all possible options; if the host requests an unsupported style, the // compiler should choose the closest supported style. enum OutputStyle { // Each selector and declaration is written on its own line. EXPANDED = 0; // The entire stylesheet is written on a single line, with as few characters // as possible. COMPRESSED = 1; } // Possible syntaxes for a Sass stylesheet. enum Syntax { // The CSS-superset `.scss` syntax. SCSS = 0; // The indented `.sass` syntax. INDENTED = 1; // Plain CSS syntax that doesn't support any special Sass features. CSS = 2; } // The possible types of [LogEvent]. enum LogEventType { // A warning for something other than a deprecated Sass feature. Often emitted // due to a stylesheet using the `@warn` rule. WARNING = 0; // A warning indicating that the stylesheet is using a deprecated Sass // feature. Compilers should not add text like "deprecation warning" to // deprecation warnings; it's up to the host to determine how to signal that // to the user. DEPRECATION_WARNING = 1; // A message generated by the user for their own debugging purposes. DEBUG = 2; } // An error reported when an endpoint violates the embedded Sass protocol. message ProtocolError { ProtocolErrorType type = 1; // The ID of the request that had an error. This MUST be `4294967295` if the // request ID couldn't be determined, or if the error is being reported for a // response or an event. uint32 id = 2; // A human-readable message providing more detail about the error. string message = 3; } // Potential types of protocol errors. enum ProtocolErrorType { // A message was received that couldn't be decoded as an `InboundMessage` (for // the compiler) or `OutboundMessage` (for the host). PARSE = 0; // A message was received that violated a documented restriction, such as not // providing a mandatory field. PARAMS = 1; // Something unexpected went wrong within the endpoint. INTERNAL = 2; } // A chunk of a source file. message SourceSpan { // The text covered by the source span. Compilers must guarantee that this is // the text between `start.offset` and `end.offset` in the source file // referred to by `url`. string text = 1; // A single point in a source file. message SourceLocation { // The 0-based offset of this location within the source file. uint32 offset = 1; // The 0-based line number of this location within the source file. uint32 line = 2; // The 0-based column number of this location within its line. uint32 column = 3; } // The location of the first character in this span. SourceLocation start = 2; // The location of the first character after this span. // // If this is omitted, it indicates that the span is empty and points // immediately before `start`. In that case, `text` must be empty. // // This must not point to a location before `start`. optional SourceLocation end = 3; // The URL of the file to which this span refers. // // This may be empty, indicating that the span refers to a // `CompileRequest.StringInput` file that doesn't specify a URL. string url = 4; // Additional source text surrounding this span. // // If this isn't empty, it must contain `text`. Furthermore, `text` must begin // at column `start.column` of a line in `context`. // // This usually contains the full lines the span begins and ends on if the // span itself doesn't cover the full lines. string context = 5; } // A SassScript value, passed to and returned by functions. message Value { // A SassScript string value. message String { // The contents of the string. string text = 1; // Whether the string is quoted or unquoted. bool quoted = 2; } // A SassScript number value. message Number { // The number's numeric value. double value = 1; // The number's numerator units. // // The endpoint sending the number must ensure that no numerator units are // [compatible][] with any denominator units. Such compatible units must be // simplified away according to the multiplicative factor between them // defined in the CSS Values and Units spec. // // [compatible]: https://www.w3.org/TR/css-values-4/#compat repeated string numerators = 2; // The number's denominator units. repeated string denominators = 3; } // A SassScript color value, represented as red, green, and blue channels. // // All Sass color values can be equivalently represented as `RgbColor`, // `HslColor`, and `HwbColor` messages without loss of color information that // can affect CSS rendering. As such, either endpoint may choose to send any // color value as any one of these three messages. message RgbColor { // The color's red channel. May not be above 255. uint32 red = 1; // The color's green channel. May not be above 255. uint32 green = 2; // The color's blue channel. May not be above 255. uint32 blue = 3; // The color's alpha channel. Must be between 0 and 1, // inclusive. double alpha = 4; } // A SassScript color value, represented as hue, saturation, and lightness channels. message HslColor { // The color's hue. double hue = 1; // The color's percent saturation. Must be between 0 and 100, // inclusive. double saturation = 2; // The color's percent lightness. Must be between 0 and 100, // inclusive. double lightness = 3; // The color's alpha channel. Must be between 0 and 1, // inclusive. double alpha = 4; } // A SassScript color value, represented as hue, whiteness, and blackness // channels. message HwbColor { // The color's hue. double hue = 1; // The color's percent whiteness. Must be between 0 and 100, // inclusive. The sum of `whiteness` and `blackness` must not exceed 100. double whiteness = 2; // The color's percent blackness. Must be between 0 and 100, // inclusive. The sum of `whiteness` and `blackness` must not exceed 100. double blackness = 3; // The color's alpha channel. Mandatory. Must be between 0 and 1, // inclusive. double alpha = 4; } // A SassScript list value. message List { // The type of separator for this list. Mandatory. ListSeparator separator = 1; // Whether this list has square brackets. Mandatory. bool has_brackets = 2; // The elements of this list. repeated Value contents = 3; } // A SassScript map value. message Map { // A single key/value pair in the map. message Entry { // The key this entry is associated with. Mandatory. Value key = 1; // The value associated with this key. Mandatory. Value value = 2; } // The entries in this map. The sending endpoint must guarantee that no two // entries have the same key. repeated Entry entries = 1; } // A first-class function defined in the compiler. New `CompilerFunction`s may // only be created by the compiler, but the host may pass `CompilerFunction`s // back to the compiler as long as their IDs match IDs of functions received // by the host during that same compilation. message CompilerFunction { // A unique ID for this function. The compiler is responsible for generating // this ID and ensuring it's unique across all functions passed to the host // for this compilation. Mandatory. uint32 id = 1; } // An anonymous custom function defined in the host. New `HostFunction`s may // only be created by the host, and `HostFunction`s may *never* be passed from // the compiler to the host. The compiler must instead pass a // `CompilerFunction` that wraps the `HostFunction`. message HostFunction { // A unique ID for this function. The compiler must pass this ID as // `OutboundRequest.FunctionCallRequest.id` when invoking this function. The // host is responsible for generating this ID and ensuring it's unique // across all functions for *all* compilations. Mandatory. uint32 id = 1; // The signature for this function. Mandatory. // // If this isn't a valid Sass function signature that could appear after // `@function` in a Sass stylesheet (such as `mix($color1, $color2, $weight: // 50%)`), the compiler must treat it as though the function that returned // this `HostFunction` threw an error. // // > This ensures that the host doesn't need to be able to correctly parse // > the entire function declaration syntax. // // The compiler may not invoke the function by its name, since it's not // guaranteed to be globally unique. However, it may use the name to // generate the string representation of this function. string signature = 2; } // A SassScript argument list value. This represents rest arguments passed to // a function's `$arg...` parameter. Unlike a normal `List`, an argument list // has an associated keywords map which tracks keyword arguments passed in // alongside positional arguments. // // For each `ArgumentList` in `FunctionCallRequest.arguments` (including those // nested within `List`s and `Map`s), the host must track whether its keyword // arguments were accessed by the user. If they were, it must add its // `ArgumentList.id` to `FunctionCallResponse.accessed_argument_lists`. // // The compiler must treat every `ArgumentList` whose `ArgumentList.id` // appears in `FunctionCallResponse.accessed_argument_lists` as though it had // been passed to `meta.keywords()`. message ArgumentList { // An ID for this argument list that's unique within the scope of a given // `FunctionCallRequest`. // // The special ID `0` is reserved for `ArgumentList`s created by the host, // and may not be used by the compiler. These `ArgumentList`s do not need to // have their IDs added to `FunctionCallResponse.accessed_argument_lists`, // and the compiler should treat them as though their keywords have always // been accessed. uint32 id = 1; // The type of separator for this list. The compiler must set this, but // the host may omit it for `ArgumentList`s that were originally created by // the compiler (that is, those with a non-0 ID). ListSeparator separator = 2; // The argument list's positional contents. The compiler must set this, but // the host may omit it for `ArgumentList`s that were originally created by // the compiler (that is, those with a non-0 ID). repeated Value contents = 3; // The argument list's keywords. The compiler must set this, but the host // may omit it for `ArgumentList`s that were originally created by the // compiler (that is, those with a non-0 ID). map keywords = 4; } // A SassScript calculation value. The compiler must send fully [simplified] // calculations, meaning that simplifying it again will produce the same // calculation. The host is not required to simplify calculations. // // [simplified]: https://github.com/sass/sass/tree/main/spec/types/calculation.md#simplifying-a-calculation // // The compiler must simplify any calculations it receives from the host // before returning them from a function. If this simplification produces an // error, it should be treated as though the function call threw that error. // It should *not* be treated as a protocol error. message Calculation { // The calculation's name. Mandatory. The host may only set this to names // that the Sass specification uses to create calculations. string name = 1; // The calculation's arguments. Mandatory. The host must use exactly the // number of arguments used by the Sass specification for calculations with // the given `name`. repeated CalculationValue arguments = 2; // A single component of a calculation expression. message CalculationValue { // The value of the component. Mandatory. oneof value { Number number = 1; // An unquoted string, as from a function like `var()` or `env()`. string string = 2; // An unquoted string as created by interpolation for // backwards-compatibility with older Sass syntax. string interpolation = 3; CalculationOperation operation = 4; Calculation calculation = 5; } } // A binary operation that appears in a calculation. message CalculationOperation { // The operator to perform. CalculationOperator operator = 1; // The left-hand side of the operation. CalculationValue left = 2; // The right-hand side of the operation. CalculationValue right = 3; } } // The value itself. Mandatory. // // This is wrapped in a message type rather than used directly to reduce // repetition, and because oneofs can't be repeated. oneof value { String string = 1; Number number = 2; RgbColor rgb_color = 3; HslColor hsl_color = 4; List list = 5; Map map = 6; SingletonValue singleton = 7; CompilerFunction compiler_function = 8; HostFunction host_function = 9; ArgumentList argument_list = 10; HwbColor hwb_color = 11; Calculation calculation = 12; } } // Different types of separators a list can have. enum ListSeparator { // List elements are separated by a comma. COMMA = 0; // List elements are separated by whitespace. SPACE = 1; // List elements are separated by a forward slash. SLASH = 2; // The list's separator hasn't yet been determined. This is only allowed for // singleton and empty lists. // // Singleton lists and empty lists don't have separators defined. This means // that list functions will prefer other lists' separators if possible. UNDECIDED = 3; } // Singleton SassScript values that have no internal state. enum SingletonValue { // The SassScript boolean true value. TRUE = 0; // The SassScript boolean false value. FALSE = 1; // The SassScript null value. NULL = 2; } // An operator used in a calculation value's operation. enum CalculationOperator { // The addition operator. PLUS = 0; // The subtraction operator. MINUS = 1; // The multiplication operator. TIMES = 2; // The division operator. DIVIDE = 3; } godartsass-2.0.0/misc_test.go000066400000000000000000000005761444035720200162150ustar00rootroot00000000000000package godartsass import ( "testing" qt "github.com/frankban/quicktest" ) func TestHasScheme(t *testing.T) { c := qt.New(t) c.Assert(hasScheme("file:foo"), qt.Equals, true) c.Assert(hasScheme("http:foo"), qt.Equals, true) c.Assert(hasScheme("http://foo"), qt.Equals, true) c.Assert(hasScheme("123:foo"), qt.Equals, false) c.Assert(hasScheme("foo"), qt.Equals, false) } godartsass-2.0.0/options.go000066400000000000000000000137531444035720200157170ustar00rootroot00000000000000package godartsass import ( "fmt" "path/filepath" "strings" "time" "github.com/bep/godartsass/v2/internal/embeddedsass" ) // Options configures a Transpiler. type Options struct { // The path to the Dart Sass wrapper binary, an absolute filename // if not in $PATH. // If this is not set, we will try 'dart-sass' // (or 'dart-sass.bat' on Windows) in the OS $PATH. // There may be several ways to install this, one would be to // download it from here: https://github.com/sass/dart-sass/releases DartSassEmbeddedFilename string // Timeout is the duration allowed for dart sass to transpile. // This was added for the beta6 version of Dart Sass Protocol, // as running this code against the beta5 binary would hang // on Execute. Timeout time.Duration // LogEventHandler will, if set, receive log events from Dart Sass, // e.g. @debug and @warn log statements. LogEventHandler func(LogEvent) } // LogEvent is a type of log event from Dart Sass. type LogEventType int const ( // Usually triggered by the @warn directive. LogEventTypeWarning LogEventType = iota // Events trigered for usage of deprecated Sass features. LogEventTypeDeprecated // Triggered by the @debug directive. LogEventTypeDebug ) type LogEvent struct { // Type is the type of log event. Type LogEventType // Message on the form url:line:col message. Message string } func (opts *Options) init() error { if opts.DartSassEmbeddedFilename == "" { opts.DartSassEmbeddedFilename = defaultDartSassBinaryFilename } if opts.Timeout == 0 { opts.Timeout = 30 * time.Second } return nil } // ImportResolver allows custom import resolution. // // CanonicalizeURL should create a canonical version of the given URL if it's // able to resolve it, else return an empty string. // // A canonicalized URL should include a scheme, e.g. 'file:///foo/bar.scss', // if applicable, see: // // https://en.wikipedia.org/wiki/File_URI_scheme // // Importers must ensure that the same canonical URL // always refers to the same stylesheet. // // Load loads the canonicalized URL's content. type ImportResolver interface { CanonicalizeURL(url string) (string, error) Load(canonicalizedURL string) (Import, error) } type Import struct { // The content of the imported file. Content string // The syntax of the imported file. SourceSyntax SourceSyntax } // Args holds the arguments to Execute. type Args struct { // The input source. Source string // The URL of the Source. // Leave empty if it's unknown. // Must include a scheme, e.g. 'file:///myproject/main.scss' // See https://en.wikipedia.org/wiki/File_URI_scheme // // Note: There is an open issue for this value when combined with custom // importers, see https://github.com/sass/dart-sass/issues/24 URL string // Defaults is SCSS. SourceSyntax SourceSyntax // Default is EXPANDED. OutputStyle OutputStyle // If enabled, a sourcemap will be generated and returned in Result. EnableSourceMap bool // If enabled, sources will be embedded in the generated source map. SourceMapIncludeSources bool // Custom resolver to use to resolve imports. // If set, this will be the first in the resolver chain. ImportResolver ImportResolver // Additional file paths to uses to resolve imports. IncludePaths []string sassOutputStyle embeddedsass.OutputStyle sassSourceSyntax embeddedsass.Syntax // Ordered list starting with options.ImportResolver, then IncludePaths. sassImporters []*embeddedsass.InboundMessage_CompileRequest_Importer } func (args *Args) init(seq uint32, opts Options) error { if args.OutputStyle == "" { args.OutputStyle = OutputStyleExpanded } if args.SourceSyntax == "" { args.SourceSyntax = SourceSyntaxSCSS } v, ok := embeddedsass.OutputStyle_value[string(args.OutputStyle)] if !ok { return fmt.Errorf("invalid OutputStyle %q", args.OutputStyle) } args.sassOutputStyle = embeddedsass.OutputStyle(v) v, ok = embeddedsass.Syntax_value[string(args.SourceSyntax)] if !ok { return fmt.Errorf("invalid SourceSyntax %q", args.SourceSyntax) } args.sassSourceSyntax = embeddedsass.Syntax(v) if args.ImportResolver != nil { args.sassImporters = []*embeddedsass.InboundMessage_CompileRequest_Importer{ { Importer: &embeddedsass.InboundMessage_CompileRequest_Importer_ImporterId{ ImporterId: seq, }, }, } } if args.IncludePaths != nil { for _, p := range args.IncludePaths { args.sassImporters = append(args.sassImporters, &embeddedsass.InboundMessage_CompileRequest_Importer{Importer: &embeddedsass.InboundMessage_CompileRequest_Importer_Path{ Path: filepath.Clean(p), }}) } } return nil } type ( // OutputStyle defines the style of the generated CSS. OutputStyle string // SourceSyntax defines the syntax of the source passed in Execute. SourceSyntax string ) const ( // Expanded (default) output. // Note that LibSASS and Ruby SASS have more output styles, and their // default is NESTED. OutputStyleExpanded OutputStyle = "EXPANDED" // Compressed/minified output. OutputStyleCompressed OutputStyle = "COMPRESSED" ) const ( // SCSS style source syntax (default). SourceSyntaxSCSS SourceSyntax = "SCSS" // Indented or SASS style source syntax. SourceSyntaxSASS SourceSyntax = "INDENTED" // Regular CSS source syntax. SourceSyntaxCSS SourceSyntax = "CSS" ) // ParseOutputStyle will convert s into OutputStyle. // Case insensitive, returns OutputStyleNested for unknown value. func ParseOutputStyle(s string) OutputStyle { switch OutputStyle(strings.ToUpper(s)) { case OutputStyleCompressed: return OutputStyleCompressed case OutputStyleExpanded: return OutputStyleExpanded default: return OutputStyleExpanded } } // ParseSourceSyntax will convert s into SourceSyntax. // Case insensitive, returns SourceSyntaxSCSS for unknown value. func ParseSourceSyntax(s string) SourceSyntax { switch SourceSyntax(strings.ToUpper(s)) { case SourceSyntaxSCSS: return SourceSyntaxSCSS case SourceSyntaxSASS, "SASS": return SourceSyntaxSASS case SourceSyntaxCSS: return SourceSyntaxCSS default: return SourceSyntaxSCSS } } godartsass-2.0.0/options_test.go000066400000000000000000000015721444035720200167520ustar00rootroot00000000000000package godartsass import ( "testing" qt "github.com/frankban/quicktest" ) func TestParseOutputStyle(t *testing.T) { c := qt.New(t) c.Assert(ParseOutputStyle("compressed"), qt.Equals, OutputStyleCompressed) c.Assert(ParseOutputStyle("ComPressed"), qt.Equals, OutputStyleCompressed) c.Assert(ParseOutputStyle("expanded"), qt.Equals, OutputStyleExpanded) c.Assert(ParseOutputStyle("foo"), qt.Equals, OutputStyleExpanded) } func TestParseSourceSyntax(t *testing.T) { c := qt.New(t) c.Assert(ParseSourceSyntax("scss"), qt.Equals, SourceSyntaxSCSS) c.Assert(ParseSourceSyntax("css"), qt.Equals, SourceSyntaxCSS) c.Assert(ParseSourceSyntax("cSS"), qt.Equals, SourceSyntaxCSS) c.Assert(ParseSourceSyntax("sass"), qt.Equals, SourceSyntaxSASS) c.Assert(ParseSourceSyntax("indented"), qt.Equals, SourceSyntaxSASS) c.Assert(ParseSourceSyntax("foo"), qt.Equals, SourceSyntaxSCSS) } godartsass-2.0.0/transpiler.go000066400000000000000000000327241444035720200164060ustar00rootroot00000000000000// Package godartsass provides a Go API for the Dass Sass Embedded protocol. // // Use the Start function to create and start a new thread safe transpiler. // Close it when done. package godartsass import ( "encoding/binary" "encoding/json" "errors" "fmt" "io" "net/url" "os" "os/exec" "path" "strings" "sync" "time" "github.com/cli/safeexec" "github.com/bep/godartsass/v2/internal/embeddedsass" "google.golang.org/protobuf/proto" ) const defaultDartSassBinaryFilename = "sass" // ErrShutdown will be returned from Execute and Close if the transpiler is or // is about to be shut down. var ErrShutdown = errors.New("connection is shut down") // Start creates and starts a new SCSS transpiler that communicates with the // Dass Sass Embedded protocol via Stdin and Stdout. // // Closing the transpiler will shut down the process. // // Note that the Transpiler is thread safe, and the recommended way of using // this is to create one and use that for all the SCSS processing needed. func Start(opts Options) (*Transpiler, error) { if err := opts.init(); err != nil { return nil, err } // See https://github.com/golang/go/issues/38736 bin, err := safeexec.LookPath(opts.DartSassEmbeddedFilename) if err != nil { return nil, err } cmd := exec.Command(bin) cmd.Args = append(cmd.Args, "--embedded") cmd.Stderr = os.Stderr conn, err := newConn(cmd) if err != nil { return nil, err } if err := conn.Start(); err != nil { return nil, err } t := &Transpiler{ opts: opts, conn: conn, lenBuf: make([]byte, binary.MaxVarintLen64), idBuf: make([]byte, binary.MaxVarintLen64), pending: make(map[uint32]*call), } go t.input() return t, nil } // Version returns version information about the Dart Sass frameworks used // in dartSassEmbeddedFilename. func Version(dartSassEmbeddedFilename string) (DartSassVersion, error) { var v DartSassVersion bin, err := safeexec.LookPath(dartSassEmbeddedFilename) if err != nil { return v, err } cmd := exec.Command(bin, "--embedded", "--version") cmd.Stderr = os.Stderr out, err := cmd.Output() if err != nil { return v, err } if err := json.Unmarshal(out, &v); err != nil { return v, err } return v, nil } type DartSassVersion struct { ProtocolVersion string `json:"protocolVersion"` CompilerVersion string `json:"compilerVersion"` ImplementationVersion string `json:"implementationVersion"` ImplementationName string `json:"implementationName"` ID int `json:"id"` } // Transpiler controls transpiling of SCSS into CSS. type Transpiler struct { opts Options // stdin/stdout of the Dart Sass protocol conn byteReadWriteCloser lenBuf []byte idBuf []byte msgBuf []byte closing bool shutdown bool // Protects the sending of messages to Dart Sass. sendMu sync.Mutex mu sync.Mutex // Protects all below. seq uint32 pending map[uint32]*call } // IsShutDown checks if all pending calls have been shut down. // Used in tests. func (t *Transpiler) IsShutDown() bool { for _, p := range t.pending { if p.Error != ErrShutdown { return false } } return true } // Result holds the result returned from Execute. type Result struct { CSS string SourceMap string } // SassError is the error returned from Execute on compile errors. type SassError struct { Message string `json:"message"` Span struct { Text string `json:"text"` Start struct { Offset int `json:"offset"` Column int `json:"column"` } `json:"start"` End struct { Offset int `json:"offset"` Column int `json:"column"` } `json:"end"` Url string `json:"url"` Context string `json:"context"` } `json:"span"` } func (e SassError) Error() string { span := e.Span file := path.Clean(strings.TrimPrefix(span.Url, "file:")) return fmt.Sprintf("file: %q, context: %q: %s", file, span.Context, e.Message) } // Close closes the stream to the embedded Dart Sass Protocol, shutting it down. // If it is already shutting down, ErrShutdown is returned. func (t *Transpiler) Close() error { t.sendMu.Lock() defer t.sendMu.Unlock() t.mu.Lock() defer t.mu.Unlock() if t.closing { return ErrShutdown } t.closing = true err := t.conn.Close() if eerr, ok := err.(*exec.ExitError); ok { if eerr.ExitCode() == 1 { // This is the expected exit code when shutting down. return ErrShutdown } } return err } // Execute transpiles the string Source given in Args into CSS. // If Dart Sass resturns a "compile failure", the error returned will be // of type SassError. func (t *Transpiler) Execute(args Args) (Result, error) { var result Result createInboundMessage := func(seq uint32) (*embeddedsass.InboundMessage, error) { if err := args.init(seq, t.opts); err != nil { return nil, err } message := &embeddedsass.InboundMessage_CompileRequest_{ CompileRequest: &embeddedsass.InboundMessage_CompileRequest{ Importers: args.sassImporters, Style: args.sassOutputStyle, Input: &embeddedsass.InboundMessage_CompileRequest_String_{ String_: &embeddedsass.InboundMessage_CompileRequest_StringInput{ Syntax: args.sassSourceSyntax, Source: args.Source, Url: args.URL, }, }, SourceMap: args.EnableSourceMap, SourceMapIncludeSources: args.SourceMapIncludeSources, }, } return &embeddedsass.InboundMessage{ Message: message, }, nil } call, err := t.newCall(createInboundMessage, args) if err != nil { return result, err } select { case call = <-call.Done: case <-time.After(t.opts.Timeout): return result, errors.New("timeout waiting for Dart Sass to respond; note that this project is only compatible with the Dart Sass Binary found here: https://github.com/sass/dart-sass/releases/") } if call.Error != nil { return result, call.Error } response := call.Response csp := response.Message.(*embeddedsass.OutboundMessage_CompileResponse_) switch resp := csp.CompileResponse.Result.(type) { case *embeddedsass.OutboundMessage_CompileResponse_Success: result.CSS = resp.Success.Css result.SourceMap = resp.Success.SourceMap case *embeddedsass.OutboundMessage_CompileResponse_Failure: asJson, err := json.Marshal(resp.Failure) if err != nil { return result, err } var sassErr SassError err = json.Unmarshal(asJson, &sassErr) if err != nil { return result, err } return result, sassErr default: return result, fmt.Errorf("unsupported response type: %T", resp) } return result, nil } func (t *Transpiler) getCall(id uint32) *call { t.mu.Lock() defer t.mu.Unlock() call, found := t.pending[id] if !found { panic(fmt.Sprintf("call with ID %d not found", id)) } return call } func (t *Transpiler) input() { var err error for err == nil { // The header is the length in bytes of the remaining message including the compilation ID. var l uint64 l, err = binary.ReadUvarint(t.conn) if err != nil { break } plen := int(l) if len(t.msgBuf) < plen { t.msgBuf = make([]byte, plen) } buf := t.msgBuf[:plen] _, err = io.ReadFull(t.conn, buf) if err != nil { break } v, n := binary.Uvarint(buf) if n <= 0 { break } compilationID := uint32(v) buf = buf[n:] var msg embeddedsass.OutboundMessage if err = proto.Unmarshal(buf, &msg); err != nil { break } switch c := msg.Message.(type) { case *embeddedsass.OutboundMessage_CompileResponse_: // Attach it to the correct pending call. t.mu.Lock() call := t.pending[compilationID] delete(t.pending, compilationID) t.mu.Unlock() if call == nil { err = fmt.Errorf("call with ID %d not found", compilationID) break } call.Response = &msg call.done() case *embeddedsass.OutboundMessage_CanonicalizeRequest_: call := t.getCall(compilationID) resolved, resolveErr := call.importResolver.CanonicalizeURL(c.CanonicalizeRequest.GetUrl()) var response *embeddedsass.InboundMessage_CanonicalizeResponse if resolveErr != nil { response = &embeddedsass.InboundMessage_CanonicalizeResponse{ Id: c.CanonicalizeRequest.GetId(), Result: &embeddedsass.InboundMessage_CanonicalizeResponse_Error{ Error: resolveErr.Error(), }, } } else { var url *embeddedsass.InboundMessage_CanonicalizeResponse_Url if resolved != "" { url = &embeddedsass.InboundMessage_CanonicalizeResponse_Url{ Url: resolved, } } response = &embeddedsass.InboundMessage_CanonicalizeResponse{ Id: c.CanonicalizeRequest.GetId(), Result: url, } } err = t.sendInboundMessage( compilationID, &embeddedsass.InboundMessage{ Message: &embeddedsass.InboundMessage_CanonicalizeResponse_{ CanonicalizeResponse: response, }, }, ) case *embeddedsass.OutboundMessage_ImportRequest_: call := t.getCall(compilationID) url := c.ImportRequest.GetUrl() imp, loadErr := call.importResolver.Load(url) sourceSyntax := embeddedsass.Syntax_value[string(imp.SourceSyntax)] var response *embeddedsass.InboundMessage_ImportResponse var sourceMapURL string // Dart Sass expect a browser-accessible URL or an empty string. // If no URL is supplied, a `data:` URL wil be generated // automatically from `contents` if hasScheme(url) { sourceMapURL = url } if loadErr != nil { response = &embeddedsass.InboundMessage_ImportResponse{ Id: c.ImportRequest.GetId(), Result: &embeddedsass.InboundMessage_ImportResponse_Error{ Error: loadErr.Error(), }, } } else { response = &embeddedsass.InboundMessage_ImportResponse{ Id: c.ImportRequest.GetId(), Result: &embeddedsass.InboundMessage_ImportResponse_Success{ Success: &embeddedsass.InboundMessage_ImportResponse_ImportSuccess{ Contents: imp.Content, SourceMapUrl: &sourceMapURL, Syntax: embeddedsass.Syntax(sourceSyntax), }, }, } } err = t.sendInboundMessage( compilationID, &embeddedsass.InboundMessage{ Message: &embeddedsass.InboundMessage_ImportResponse_{ ImportResponse: response, }, }, ) case *embeddedsass.OutboundMessage_LogEvent_: if t.opts.LogEventHandler != nil { var logEvent LogEvent e := c.LogEvent if e.Span != nil { u := e.Span.Url if u == "" { u = "stdin" } u, _ = url.QueryUnescape(u) logEvent = LogEvent{ Type: LogEventType(e.Type), Message: fmt.Sprintf("%s:%d:%d: %s", u, e.Span.Start.Line, e.Span.Start.Column, c.LogEvent.GetMessage()), } } else { logEvent = LogEvent{ Type: LogEventType(e.Type), Message: e.GetMessage(), } } t.opts.LogEventHandler(logEvent) } case *embeddedsass.OutboundMessage_Error: err = fmt.Errorf("SASS error: %s", c.Error.GetMessage()) default: err = fmt.Errorf("unsupported response message type. %T", msg.Message) } } // Terminate pending calls. t.sendMu.Lock() defer t.sendMu.Unlock() t.mu.Lock() defer t.mu.Unlock() t.shutdown = true isEOF := err == io.EOF || strings.Contains(err.Error(), "already closed") if isEOF { if t.closing { err = ErrShutdown } else { err = io.ErrUnexpectedEOF } } for _, call := range t.pending { call.Error = err call.done() } } func (t *Transpiler) nextSeq() uint32 { t.seq++ // The compilation ID 0 is reserved for `VersionRequest` and `VersionResponse`, // 4294967295 is reserved for error handling. This is the maximum number representable by a `uint32` so it should be safe to start over. if t.seq == 0 || t.seq == 4294967295 { t.seq = 1 } return t.seq } func (t *Transpiler) newCall(createInbound func(seq uint32) (*embeddedsass.InboundMessage, error), args Args) (*call, error) { t.mu.Lock() id := t.nextSeq() req, err := createInbound(id) if err != nil { t.mu.Unlock() return nil, err } call := &call{ Request: req, Done: make(chan *call, 1), importResolver: args.ImportResolver, } if t.shutdown || t.closing { t.mu.Unlock() call.Error = ErrShutdown call.done() return call, nil } t.pending[id] = call t.mu.Unlock() switch call.Request.Message.(type) { case *embeddedsass.InboundMessage_CompileRequest_: default: return nil, fmt.Errorf("unsupported request message type. %T", call.Request.Message) } return call, t.sendInboundMessage(id, call.Request) } func (t *Transpiler) sendInboundMessage(compilationID uint32, message *embeddedsass.InboundMessage) error { t.sendMu.Lock() defer t.sendMu.Unlock() t.mu.Lock() if t.closing || t.shutdown { t.mu.Unlock() return ErrShutdown } t.mu.Unlock() out, err := proto.Marshal(message) if err != nil { return fmt.Errorf("failed to marshal request: %s", err) } // Every message must begin with a varint indicating the length in bytes of // the remaining message including the compilation ID reqLen := uint64(len(out)) compilationIDLen := binary.PutUvarint(t.idBuf, uint64(compilationID)) headerLen := binary.PutUvarint(t.lenBuf, reqLen+uint64(compilationIDLen)) _, err = t.conn.Write(t.lenBuf[:headerLen]) if err != nil { return err } _, err = t.conn.Write(t.idBuf[:compilationIDLen]) if err != nil { return err } headerLen, err = t.conn.Write(out) if headerLen != len(out) { return errors.New("failed to write payload") } return err } type call struct { Request *embeddedsass.InboundMessage Response *embeddedsass.OutboundMessage importResolver ImportResolver Error error Done chan *call } func (call *call) done() { select { case call.Done <- call: default: } } func hasScheme(s string) bool { u, err := url.ParseRequestURI(s) if err != nil { return false } return u.Scheme != "" } godartsass-2.0.0/transpiler_test.go000066400000000000000000000277701444035720200174520ustar00rootroot00000000000000package godartsass_test import ( "encoding/json" "errors" "fmt" "io/ioutil" "os" "path/filepath" "strings" "sync" "testing" "github.com/bep/godartsass/v2" qt "github.com/frankban/quicktest" ) const ( sassSample = `nav { ul { margin: 0; padding: 0; list-style: none; } li { display: inline-block; } a { display: block; padding: 6px 12px; text-decoration: none; } }` sassSampleTranspiled = "nav ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\nnav li {\n display: inline-block;\n}\nnav a {\n display: block;\n padding: 6px 12px;\n text-decoration: none;\n}" ) type testImportResolver struct { name string content string sourceSyntax godartsass.SourceSyntax failOnCanonicalizeURL bool failOnLoad bool } func (t testImportResolver) CanonicalizeURL(url string) (string, error) { if t.failOnCanonicalizeURL { return "", errors.New("failed") } if url != t.name { return "", nil } return "file:/my" + t.name + "/scss/" + url + "_myfile.scss", nil } func (t testImportResolver) Load(url string) (godartsass.Import, error) { if t.failOnLoad { return godartsass.Import{}, errors.New("failed") } if !strings.Contains(url, t.name) { panic("protocol error") } return godartsass.Import{Content: t.content, SourceSyntax: t.sourceSyntax}, nil } func TestTranspilerVariants(t *testing.T) { c := qt.New(t) colorsResolver := testImportResolver{ name: "colors", content: `$white: #ffff`, } resolverIndented := testImportResolver{ name: "main", content: ` #main color: blue `, sourceSyntax: godartsass.SourceSyntaxSASS, } for _, test := range []struct { name string opts godartsass.Options args godartsass.Args expect interface{} }{ {"Output style compressed", godartsass.Options{}, godartsass.Args{Source: "div { color: #ccc; }", OutputStyle: godartsass.OutputStyleCompressed}, godartsass.Result{CSS: "div{color:#ccc}"}}, {"Enable Source Map", godartsass.Options{}, godartsass.Args{Source: "div{color:blue;}", URL: "file://myproject/main.scss", OutputStyle: godartsass.OutputStyleCompressed, EnableSourceMap: true}, godartsass.Result{CSS: "div{color:blue}", SourceMap: "{\"version\":3,\"sourceRoot\":\"\",\"sources\":[\"file://myproject/main.scss\"],\"names\":[],\"mappings\":\"AAAA\"}"}}, {"Enable Source Map with sources", godartsass.Options{}, godartsass.Args{Source: "div{color:blue;}", URL: "file://myproject/main.scss", OutputStyle: godartsass.OutputStyleCompressed, EnableSourceMap: true, SourceMapIncludeSources: true}, godartsass.Result{CSS: "div{color:blue}", SourceMap: "{\"version\":3,\"sourceRoot\":\"\",\"sources\":[\"file://myproject/main.scss\"],\"names\":[],\"mappings\":\"AAAA\",\"sourcesContent\":[\"div{color:blue;}\"]}"}}, {"Sass syntax", godartsass.Options{}, godartsass.Args{ Source: `$font-stack: Helvetica, sans-serif $primary-color: #333 body font: 100% $font-stack color: $primary-color `, OutputStyle: godartsass.OutputStyleCompressed, SourceSyntax: godartsass.SourceSyntaxSASS, }, godartsass.Result{CSS: "body{font:100% Helvetica,sans-serif;color:#333}"}}, {"Import resolver with source map", godartsass.Options{}, godartsass.Args{Source: "@import \"colors\";\ndiv { p { color: $white; } }", EnableSourceMap: true, ImportResolver: colorsResolver}, godartsass.Result{CSS: "div p {\n color: white;\n}", SourceMap: "{\"version\":3,\"sourceRoot\":\"\",\"sources\":[\"data:;charset=utf-8,@import%20%22colors%22;%0Adiv%20%7B%20p%20%7B%20color:%20$white;%20%7D%20%7D\",\"file:///mycolors/scss/colors_myfile.scss\"],\"names\":[],\"mappings\":\"AACM;EAAI,OCDC\"}"}}, {"Import resolver with indented source syntax", godartsass.Options{}, godartsass.Args{Source: "@import \"main\";\n", ImportResolver: resolverIndented}, godartsass.Result{CSS: "#main {\n color: blue;\n}"}}, // Error cases {"Invalid syntax", godartsass.Options{}, godartsass.Args{Source: "div { color: $white; }"}, false}, {"Import not found", godartsass.Options{}, godartsass.Args{Source: "@import \"foo\""}, false}, {"Import with ImportResolver, not found", godartsass.Options{}, godartsass.Args{Source: "@import \"foo\"", ImportResolver: colorsResolver}, false}, {"Error in ImportResolver.CanonicalizeURL", godartsass.Options{}, godartsass.Args{Source: "@import \"colors\";", ImportResolver: testImportResolver{name: "colors", failOnCanonicalizeURL: true}}, false}, {"Error in ImportResolver.Load", godartsass.Options{}, godartsass.Args{Source: "@import \"colors\";", ImportResolver: testImportResolver{name: "colors", failOnLoad: true}}, false}, {"Invalid OutputStyle", godartsass.Options{}, godartsass.Args{Source: "a", OutputStyle: "asdf"}, false}, {"Invalid SourceSyntax", godartsass.Options{}, godartsass.Args{Source: "a", SourceSyntax: "asdf"}, false}, {"Erro logging", godartsass.Options{}, godartsass.Args{Source: `@error "foo";`}, false}, } { test := test c.Run(test.name, func(c *qt.C) { b, ok := test.expect.(bool) shouldFail := ok && !b transpiler, clean := newTestTranspiler(c, test.opts) defer clean() result, err := transpiler.Execute(test.args) if shouldFail { c.Assert(err, qt.Not(qt.IsNil)) // Verify that the communication is still up and running. _, err2 := transpiler.Execute(test.args) c.Assert(err2.Error(), qt.Equals, err.Error()) } else { expectedResult := test.expect.(godartsass.Result) c.Assert(err, qt.IsNil) // printJSON(result.SourceMap) c.Assert(result, qt.Equals, expectedResult) } }) } } func TestDebugWarn(t *testing.T) { c := qt.New(t) args := godartsass.Args{ URL: "/a/b/c.scss", Source: ` $color: #333; body { color: $color; } @debug "foo"; @warn "bar"; `, } var events []godartsass.LogEvent eventHandler := func(e godartsass.LogEvent) { events = append(events, e) } opts := godartsass.Options{ LogEventHandler: eventHandler, } transpiler, clean := newTestTranspiler(c, opts) defer clean() result, err := transpiler.Execute(args) c.Assert(err, qt.IsNil) c.Assert(result.CSS, qt.Equals, "body {\n color: #333;\n}") c.Assert(events, qt.DeepEquals, []godartsass.LogEvent{ {Type: 2, Message: "/a/b/c.scss:6:1: foo"}, {Type: 0, Message: "bar"}, }) } func TestIncludePaths(t *testing.T) { dir1, _ := ioutil.TempDir(os.TempDir(), "libsass-test-include-paths-dir1") defer os.RemoveAll(dir1) dir2, _ := ioutil.TempDir(os.TempDir(), "libsass-test-include-paths-dir2") defer os.RemoveAll(dir2) colors := filepath.Join(dir1, "_colors.scss") content := filepath.Join(dir2, "_content.scss") ioutil.WriteFile(colors, []byte(` $moo: #f442d1 !default; `), 0o644) ioutil.WriteFile(content, []byte(` content { color: #ccc; } `), 0o644) c := qt.New(t) src := ` @import "colors"; @import "content"; div { p { color: $moo; } }` transpiler, clean := newTestTranspiler(c, godartsass.Options{}) defer clean() result, err := transpiler.Execute( godartsass.Args{ Source: src, OutputStyle: godartsass.OutputStyleCompressed, IncludePaths: []string{dir1, dir2}, }, ) c.Assert(err, qt.IsNil) c.Assert(result.CSS, qt.Equals, "content{color:#ccc}div p{color:#f442d1}") } func TestTranspilerParallel(t *testing.T) { c := qt.New(t) transpiler, clean := newTestTranspiler(c, godartsass.Options{}) defer clean() var wg sync.WaitGroup for i := 0; i < 10; i++ { wg.Add(1) go func(num int) { defer wg.Done() for j := 0; j < 4; j++ { src := fmt.Sprintf(` $primary-color: #%03d; div { color: $primary-color; }`, num) result, err := transpiler.Execute(godartsass.Args{Source: src}) c.Check(err, qt.IsNil) c.Check(result.CSS, qt.Equals, fmt.Sprintf("div {\n color: #%03d;\n}", num)) if c.Failed() { return } } }(i) } wg.Wait() } func TestTranspilerParallelImportResolver(t *testing.T) { c := qt.New(t) createImportResolver := func(width int) godartsass.ImportResolver { return testImportResolver{ name: "widths", content: fmt.Sprintf(`$width: %d`, width), } } transpiler, clean := newTestTranspiler(c, godartsass.Options{}) defer clean() var wg sync.WaitGroup for i := 0; i < 10; i++ { wg.Add(1) go func(i int) { defer wg.Done() for j := 0; j < 10; j++ { for k := 0; k < 20; k++ { args := godartsass.Args{ OutputStyle: godartsass.OutputStyleCompressed, ImportResolver: createImportResolver(j + i), Source: ` @import "widths"; div { p { width: $width; } }`, } result, err := transpiler.Execute(args) c.Check(err, qt.IsNil) c.Check(result.CSS, qt.Equals, fmt.Sprintf("div p{width:%d}", j+i)) if c.Failed() { return } } } }(i) } wg.Wait() } func TestTranspilerClose(t *testing.T) { c := qt.New(t) transpiler, _ := newTestTranspiler(c, godartsass.Options{}) var wg sync.WaitGroup for i := 0; i < 10; i++ { wg.Add(1) go func(gor int) { defer wg.Done() for j := 0; j < 4; j++ { src := fmt.Sprintf(` $primary-color: #%03d; div { color: $primary-color; }`, gor) num := gor + j if num == 10 { err := transpiler.Close() if err != nil { c.Check(err, qt.Equals, godartsass.ErrShutdown) } } result, err := transpiler.Execute(godartsass.Args{Source: src}) if err != nil { c.Check(err, qt.Equals, godartsass.ErrShutdown) } else { c.Check(err, qt.IsNil) c.Check(result.CSS, qt.Equals, fmt.Sprintf("div {\n color: #%03d;\n}", gor)) } if c.Failed() { return } } }(i) } wg.Wait() c.Assert(transpiler.IsShutDown(), qt.Equals, true) } func BenchmarkTranspiler(b *testing.B) { type tester struct { src string expect string transpiler *godartsass.Transpiler clean func() } newTester := func(b *testing.B, opts godartsass.Options) tester { c := qt.New(b) transpiler, clean := newTestTranspiler(c, godartsass.Options{}) return tester{ transpiler: transpiler, clean: clean, } } runBench := func(b *testing.B, t tester) { defer t.clean() b.ResetTimer() for n := 0; n < b.N; n++ { result, err := t.transpiler.Execute(godartsass.Args{Source: t.src}) if err != nil { b.Fatal(err) } if result.CSS != t.expect { b.Fatalf("Got: %q\n", result.CSS) } } } b.Run("SCSS", func(b *testing.B) { t := newTester(b, godartsass.Options{}) t.src = sassSample t.expect = sassSampleTranspiled runBench(b, t) }) // This is the obviously much slower way of doing it. b.Run("Start and Execute", func(b *testing.B) { for n := 0; n < b.N; n++ { t := newTester(b, godartsass.Options{}) t.src = sassSample t.expect = sassSampleTranspiled result, err := t.transpiler.Execute(godartsass.Args{Source: t.src}) if err != nil { b.Fatal(err) } if result.CSS != t.expect { b.Fatalf("Got: %q\n", result.CSS) } t.transpiler.Close() } }) b.Run("SCSS Parallel", func(b *testing.B) { t := newTester(b, godartsass.Options{}) t.src = sassSample t.expect = sassSampleTranspiled defer t.clean() b.RunParallel(func(pb *testing.PB) { for pb.Next() { result, err := t.transpiler.Execute(godartsass.Args{Source: t.src}) if err != nil { b.Fatal(err) } if result.CSS != t.expect { b.Fatalf("Got: %q\n", result.CSS) } } }) }) } func TestVersion(t *testing.T) { c := qt.New(t) version, err := godartsass.Version(getSassEmbeddedFilename()) c.Assert(err, qt.IsNil) c.Assert(version, qt.Not(qt.Equals), "") c.Assert(version.ProtocolVersion, qt.Equals, "2.0.0") } func newTestTranspiler(c *qt.C, opts godartsass.Options) (*godartsass.Transpiler, func()) { opts.DartSassEmbeddedFilename = getSassEmbeddedFilename() transpiler, err := godartsass.Start(opts) c.Assert(err, qt.IsNil) return transpiler, func() { err := transpiler.Close() c.Assert(err, qt.IsNil) } } func getSassEmbeddedFilename() string { // https://github.com/sass/dart-sass/releases if filename := os.Getenv("DART_SASS_BINARY"); filename != "" { return filename } return "sass" } // used for debugging func printJSON(s string) { m := make(map[string]interface{}) json.Unmarshal([]byte(s), &m) b, _ := json.MarshalIndent(m, "", " ") fmt.Printf("%s", b) }